/* Frontend Styles for WooCommerce Cart Notification Popup */

/* Overlay */
.wcnp-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999999999 !important;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.wcnp-popup-overlay.wcnp-show {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto;
}

/* Popup Container - Slides in from right */
.wcnp-popup {
    position: fixed !important;
    top: 20px;
    right: -500px;
    background: #fff !important;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: calc(100% - 40px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    z-index: 1000000000 !important;
    transition: right 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Show popup - slide in from right with smooth animation */
.wcnp-popup-overlay.wcnp-show .wcnp-popup {
    right: 20px;
}


/* Position Top */
.wcnp-popup.wcnp-position-top {
    top: 20px;
}

/* Position Bottom - still slides in from right */
.wcnp-popup.wcnp-position-bottom {
    top: auto;
    bottom: 20px;
}

/* Both positions slide from right side */
.wcnp-popup-overlay.wcnp-show .wcnp-popup.wcnp-position-top,
.wcnp-popup-overlay.wcnp-show .wcnp-popup.wcnp-position-bottom {
    right: 20px;
}


/* Close Button */
.wcnp-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    padding: 0;
}

.wcnp-close:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.wcnp-close svg {
    width: 18px;
    height: 18px;
    color: #333;
}

/* Popup Content */
.wcnp-popup-content {
    padding: 30px;
}

/* Header */
.wcnp-popup-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.wcnp-success-icon {
    width: 24px;
    height: 24px;
    color: #10b981;
    flex-shrink: 0;
}

.wcnp-popup-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

/* Product Info */
.wcnp-product-info {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 8px;
}

/* Layout: Left (Image on left side) */
.wcnp-layout-left .wcnp-product-info {
    flex-direction: row;
}

.wcnp-layout-left .wcnp-product-image {
    flex-shrink: 0;
}

.wcnp-layout-left .wcnp-product-image img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
}

/* Layout: Background (Image as background) */
.wcnp-layout-background .wcnp-popup-content {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 300px;
}

.wcnp-layout-background .wcnp-popup-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.7) 100%);
    z-index: 1;
    border-radius: 12px;
}

.wcnp-layout-background .wcnp-popup-content > * {
    position: relative;
    z-index: 2;
}

.wcnp-layout-background .wcnp-popup-header h3,
.wcnp-layout-background .wcnp-product-details h4,
.wcnp-layout-background .wcnp-product-details p {
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.wcnp-layout-background .wcnp-success-icon {
    color: #fff;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.wcnp-layout-background .wcnp-product-info {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.wcnp-layout-background .wcnp-close {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.wcnp-layout-background .wcnp-close:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.4);
}

.wcnp-layout-background .wcnp-close svg {
    color: #fff;
}

.wcnp-layout-background .wcnp-product-image {
    display: none;
}

/* Product Details */
.wcnp-product-details {
    flex: 1;
}

.wcnp-product-details h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
}

.wcnp-product-price {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    font-size: 14px;
}

.wcnp-product-price #wcnp-product-price {
    font-weight: 600;
    color: #1f2937;
    font-size: 16px;
}

.wcnp-layout-background .wcnp-product-price {
    color: rgba(255, 255, 255, 0.9);
}

.wcnp-layout-background .wcnp-product-price #wcnp-product-price {
    color: #fff;
}

/* Popup Actions */
.wcnp-popup-actions {
    display: flex;
    gap: 10px;
}

.wcnp-btn {
    flex: 1;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    display: inline-block;
}

.wcnp-btn-cart {
    background: #1f2937;
    color: #fff;
}

.wcnp-btn-cart:hover {
    background: #111827;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.wcnp-layout-background .wcnp-btn-cart {
    background: rgba(255, 255, 255, 0.95);
    color: #1f2937;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.wcnp-layout-background .wcnp-btn-cart:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* Animation */
@keyframes wcnp-slideInTop {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes wcnp-slideInBottom {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 600px) {
    .wcnp-popup {
        max-width: 100%;
        width: calc(100% - 20px);
        right: -100%;
        top: 10px;
        border-radius: 8px;
    }
    
    .wcnp-popup-overlay.wcnp-show .wcnp-popup {
        right: 10px;
    }
    
    .wcnp-popup.wcnp-position-bottom {
        top: auto;
        bottom: 10px;
    }
    
    .wcnp-popup-content {
        padding: 20px;
    }
    
    .wcnp-product-info {
        flex-direction: column;
        padding: 12px;
    }
    
    .wcnp-layout-left .wcnp-product-image img {
        width: 100%;
        height: auto;
        max-height: 200px;
    }
    
    .wcnp-popup-header h3 {
        font-size: 18px;
    }
    
    .wcnp-product-details h4 {
        font-size: 15px;
    }
    
    .wcnp-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 400px) {
    .wcnp-popup {
        width: calc(100% - 10px);
        right: -100%;
        top: 5px;
    }
    
    .wcnp-popup-overlay.wcnp-show .wcnp-popup {
        right: 5px;
    }
    
    .wcnp-popup.wcnp-position-bottom {
        bottom: 5px;
    }
    
    .wcnp-popup-content {
        padding: 15px;
    }
    
    .wcnp-popup-header {
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .wcnp-popup-header h3 {
        font-size: 16px;
    }
    
    .wcnp-product-details h4 {
        font-size: 14px;
    }
    
    .wcnp-close {
        width: 28px;
        height: 28px;
        top: 10px;
        right: 10px;
    }
    
    .wcnp-close svg {
        width: 16px;
        height: 16px;
    }
}

/* RTL Support */
.rtl .wcnp-close {
    right: auto;
    left: 15px;
}

.rtl .wcnp-product-info {
    direction: rtl;
}

/* Print Hide */
@media print {
    .wcnp-popup-overlay {
        display: none !important;
    }
}
