/* ============================================================
   PuraSynth Cart Drawer — Self-contained sidebar
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* Overlay */
.psc-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.psc-drawer-overlay.psc-open {
    opacity: 1;
    visibility: visible;
}

/* Drawer Panel */
.psc-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 420px;
    max-width: 92vw;
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.15);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.psc-drawer.psc-open {
    transform: translateX(0);
}

/* Header */
.psc-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.psc-drawer-title {
    font-size: 18px;
    font-weight: 700;
    color: #0F1E3A;
    margin: 0;
    line-height: 1;
}

.psc-drawer-count {
    font-weight: 400;
    color: #64748b;
    font-size: 14px;
}

.psc-drawer-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #475569;
    transition: all 0.2s ease;
    padding: 0;
}

.psc-drawer-close:hover {
    background: #e2e8f0;
    color: #0F1E3A;
}

/* Body (scrollable items list) */
.psc-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    overscroll-behavior: contain;
}

/* Empty state */
.psc-drawer-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    gap: 16px;
}

.psc-drawer-empty p {
    font-size: 15px;
    color: #64748b;
    margin: 0;
}

.psc-continue-btn {
    display: inline-block;
    padding: 12px 28px;
    background: #0F1E3A;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.psc-continue-btn:hover {
    background: #1a2d4f;
    color: #ffffff !important;
}

/* Cart Item */
.psc-cart-item {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
    animation: pscFadeIn 0.3s ease forwards;
}

@keyframes pscFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.psc-cart-item:last-child {
    border-bottom: none;
}

/* Item Image */
.psc-item-img {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.psc-item-img a {
    display: block;
}

.psc-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Item Details */
.psc-item-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.psc-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #0F1E3A;
    text-decoration: none !important;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.psc-item-name:hover {
    color: #4E6FAE;
}

.psc-item-variant {
    font-size: 12px;
    color: #64748b;
}

.psc-item-discount {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: #16a34a;
    background: #f0fdf4;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 2px;
}

.psc-item-qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
}

/* Quantity Control */
.psc-qty-control {
    display: flex;
    align-items: center;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.psc-qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    padding: 0;
}

.psc-qty-btn:hover {
    background: #f1f5f9;
}

.psc-qty-value {
    width: 32px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #0F1E3A;
}

/* Item Price */
.psc-item-price {
    font-size: 14px;
    font-weight: 700;
    color: #0F1E3A;
}

/* Remove Button */
.psc-item-remove {
    position: absolute;
    top: 12px;
    right: 0;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    font-size: 18px;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.psc-item-remove:hover {
    background: #fef2f2;
    color: #ef4444;
}

/* Footer */
.psc-drawer-footer {
    flex-shrink: 0;
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    background: #fafafa;
}

.psc-drawer-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.psc-drawer-subtotal span:first-child {
    font-size: 15px;
    font-weight: 600;
    color: #475569;
}

.psc-subtotal-amount {
    font-size: 18px;
    font-weight: 800;
    color: #0F1E3A;
}

.psc-drawer-note {
    font-size: 12px;
    color: #94a3b8;
    margin: 0 0 16px;
}

.psc-checkout-btn {
    display: block;
    width: 100%;
    padding: 15px;
    background: #0F1E3A;
    color: #ffffff !important;
    text-decoration: none !important;
    text-align: center;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    transition: background 0.2s ease;
    margin-bottom: 10px;
}

.psc-checkout-btn:hover {
    background: #1a2d4f;
    color: #ffffff !important;
}

.psc-viewcart-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: transparent;
    color: #475569 !important;
    text-decoration: none !important;
    text-align: center;
    border-radius: 12px;
    border: 1.5px solid #e5e7eb;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.psc-viewcart-btn:hover {
    border-color: #0F1E3A;
    color: #0F1E3A !important;
}

/* Loading state */
.psc-drawer-body.psc-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Body scroll lock when drawer is open */
body.psc-drawer-open {
    overflow: hidden;
}

/* ============================================================
   Cart Count Badge — shows on header cart icon everywhere
   ============================================================ */

.psc-cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #dc2626;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 50%;
    padding: 0 5px;
    font-family: 'Inter', -apple-system, sans-serif;
    z-index: 10;
    pointer-events: none;
    animation: pscBadgePop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
}

.psc-cart-badge:empty,
.psc-cart-badge[data-count="0"] {
    display: none;
}

@keyframes pscBadgePop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* Ensure the cart icon container is positioned for the badge */
a.elementor-icon[href*="/cart"],
.icon-cart,
.cart-icon,
a.cart-contents {
    position: relative !important;
}

/* ============================================================
   WooCommerce Cart Page — Mobile image fix + notice hiding
   ============================================================ */

/* Hide "Customer matched zone" notices everywhere */
.woocommerce-info,
.woocommerce-message:not(.woocommerce-error) {
    display: none !important;
}

/* Continue Shopping button on WC cart page */
.psc-continue-shopping-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    margin-bottom: 10px;
}

.psc-continue-shopping-bar a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #0F1E3A;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Inter', -apple-system, sans-serif;
    transition: background 0.2s ease;
}

.psc-continue-shopping-bar a:hover {
    background: #1a2d4f;
    color: #ffffff !important;
}

.psc-continue-shopping-bar a svg {
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .psc-continue-shopping-bar a {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
    }
}

/* Show product images on mobile cart page */
.woocommerce table.cart .product-thumbnail {
    display: table-cell !important;
    width: 80px !important;
    min-width: 60px !important;
}

.woocommerce table.cart .product-thumbnail img {
    width: 70px !important;
    height: 70px !important;
    object-fit: cover;
    border-radius: 8px;
}

@media (max-width: 768px) {
    /* Force image column visible on mobile */
    .woocommerce table.shop_table td.product-thumbnail,
    .woocommerce table.shop_table th.product-thumbnail {
        display: table-cell !important;
        visibility: visible !important;
    }

    .woocommerce table.cart .product-thumbnail img {
        width: 60px !important;
        height: 60px !important;
    }

    /* Better mobile cart layout */
    .woocommerce table.cart td {
        padding: 10px 8px !important;
    }
}

/* ============================================================
   Responsive — Cart Drawer
   ============================================================ */

@media (max-width: 480px) {
    .psc-drawer {
        width: 100vw;
        max-width: 100vw;
    }

    .psc-drawer-header {
        padding: 16px 18px;
    }

    .psc-drawer-body {
        padding: 12px 18px;
    }

    .psc-drawer-footer {
        padding: 16px 18px;
    }

    .psc-item-img {
        width: 60px;
        height: 60px;
    }
}
