/* ============================================================
   IsoPep 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;
}

/* Unified scroll container — holds cart items + upsell together */
.psc-drawer-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.psc-drawer-scroll::-webkit-scrollbar {
    width: 6px;
}
.psc-drawer-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.psc-drawer-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

/* Cart items list (inside the scroll container, no longer scrolls itself) */
.psc-drawer-body {
    padding: 16px 24px;
    flex-shrink: 0;
}

/* 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-variants {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-top: 2px;
}

.psc-item-attr {
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.psc-attr-label {
    font-weight: 600;
    color: #475569;
}

.psc-item-bundle {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #1e40af;
    background: #eff6ff;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 2px;
}

.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-unit-price {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    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;
}

/* ============================================================
   Consent Checkbox (21+ / research use)
   ============================================================ */

.psc-consent-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #f0f9ff;
    border: 1.5px solid #bae6fd;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 14px;
    transition: background 0.2s ease, border-color 0.2s ease;
    user-select: none;
}

.psc-consent-row:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
}

/* Hide the native checkbox but keep it accessible */
.psc-consent-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* Custom checkbox visual */
.psc-consent-box {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid #0EA5E9;
    border-radius: 5px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
    margin-top: 1px;
}

.psc-consent-checkbox:checked + .psc-consent-box {
    background: #0EA5E9;
    color: #ffffff;
    transform: scale(1.05);
}

.psc-consent-checkbox:focus-visible + .psc-consent-box {
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
}

.psc-consent-text {
    font-size: 12.5px;
    line-height: 1.45;
    color: #0c4a6e;
    font-weight: 500;
}

.psc-consent-text strong {
    color: #0EA5E9;
    font-weight: 700;
}

/* Shake animation when user tries to checkout without consent */
.psc-consent-row.psc-shake {
    animation: pscShake 0.45s cubic-bezier(.36,.07,.19,.97) both;
    border-color: #ef4444;
    background: #fef2f2;
}

.psc-consent-row.psc-shake .psc-consent-box {
    border-color: #ef4444;
}

@keyframes pscShake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

/* Disabled checkout state */
.psc-checkout-btn.psc-checkout-disabled {
    background: #cbd5e1;
    color: #ffffff !important;
    cursor: not-allowed;
    pointer-events: auto; /* still clickable so we can trigger shake */
    box-shadow: none;
}

.psc-checkout-btn.psc-checkout-disabled:hover {
    background: #cbd5e1;
}

.psc-checkout-hint {
    font-size: 11.5px;
    color: #94a3b8;
    text-align: center;
    margin: 0 0 10px;
    transition: color 0.2s ease, opacity 0.2s ease;
    min-height: 14px;
}

.psc-checkout-hint.psc-hidden {
    opacity: 0;
    height: 0;
    min-height: 0;
    margin: 0;
    overflow: hidden;
}

/* 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 ALL WooCommerce info/success notices everywhere (zone matching, item removed, item added, etc.) */
.woocommerce-info,
.woocommerce-message,
.wc-block-components-notice-banner:not(.is-error),
.wc-block-components-notice-banner.is-success,
.wc-block-components-notice-banner.is-info,
.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-info,
div.woocommerce-message:not(.woocommerce-error),
.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info,
.woocommerce-cart .woocommerce-message,
.woocommerce-shop .woocommerce-message,
.single-product .woocommerce-message,
[role="alert"].woocommerce-message {
    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;
    }

    .psc-consent-row {
        padding: 10px 12px;
        gap: 8px;
    }

    .psc-consent-text {
        font-size: 12px;
        line-height: 1.4;
    }

    .psc-consent-box {
        width: 18px;
        height: 18px;
    }
}

/* ============================================================
   Upsell Section — "You may also like"
   Brand colors: white (#ffffff) + sky blue (#0EA5E9)
   ============================================================ */

.psc-drawer-upsell-wrap {
    flex-shrink: 0;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
}

.psc-upsell-section {
    padding: 16px 20px 14px;
    background: linear-gradient(180deg, #f0f9ff 0%, #ffffff 100%);
    border-top: 2px solid #0EA5E9;
}

.psc-upsell-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.psc-upsell-title {
    font-size: 14px;
    font-weight: 700;
    color: #0c4a6e;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.psc-upsell-sub {
    font-size: 11px;
    font-weight: 500;
    color: #0EA5E9;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* Horizontal scroll container (mobile-first, also clean on desktop) */
.psc-upsell-scroll {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 8px;
    margin: 0 -2px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #bae6fd transparent;
}

.psc-upsell-scroll::-webkit-scrollbar {
    height: 6px;
}

.psc-upsell-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.psc-upsell-scroll::-webkit-scrollbar-thumb {
    background: #bae6fd;
    border-radius: 10px;
}

.psc-upsell-scroll::-webkit-scrollbar-thumb:hover {
    background: #7dd3fc;
}

/* Individual card */
.psc-upsell-card {
    flex: 0 0 150px;
    width: 150px;
    box-sizing: border-box;
    background: #ffffff;
    border: 1.5px solid #e0f2fe;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-snap-align: start;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 1px 2px rgba(14, 165, 233, 0.04);
    overflow: hidden;
}

.psc-upsell-card * {
    box-sizing: border-box;
}

.psc-upsell-card:hover {
    border-color: #0EA5E9;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.psc-upsell-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    background: #f0f9ff;
}

.psc-upsell-thumb img,
.psc-upsell-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

.psc-upsell-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 44px;
}

.psc-upsell-name {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    color: #0f172a;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 32px;
}

.psc-upsell-name:hover {
    color: #0EA5E9;
}

.psc-upsell-price {
    font-size: 13px;
    font-weight: 700;
    color: #0c4a6e;
    line-height: 1.2;
}

.psc-upsell-price del {
    color: #94a3b8;
    font-weight: 500;
    margin-right: 4px;
    font-size: 11px;
}

.psc-upsell-price ins {
    text-decoration: none;
    color: #0EA5E9;
}

/* Variant pills — inline size selector for variable products */
.psc-upsell-variants {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    margin-top: -2px;
}

.psc-upsell-variant-pill {
    box-sizing: border-box;
    padding: 5px 4px;
    border: 1px solid #e0f2fe;
    border-radius: 6px;
    background: #ffffff;
    color: #475569;
    font-size: 10.5px;
    font-weight: 700;
    font-family: 'Inter', -apple-system, sans-serif;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    line-height: 1.2;
    text-align: center;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.psc-upsell-variant-pill:hover {
    border-color: #0EA5E9;
    color: #0EA5E9;
    background: #f0f9ff;
}

.psc-upsell-variant-pill.psc-active {
    background: #0EA5E9;
    border-color: #0EA5E9;
    color: #ffffff;
}

.psc-upsell-variant-pill.psc-active:hover {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}

/* Add / Select button */
.psc-upsell-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 6px;
    border: 1.5px solid #0EA5E9;
    border-radius: 8px;
    background: #ffffff;
    color: #0EA5E9;
    font-size: 11.5px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    font-family: 'Inter', -apple-system, sans-serif;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.psc-upsell-btn:hover {
    background: #0EA5E9;
    color: #ffffff;
}

.psc-upsell-btn:active {
    background: #0284c7;
    color: #ffffff;
}

.psc-upsell-btn:disabled {
    cursor: not-allowed;
    opacity: 0.85;
}

.psc-upsell-loading {
    background: #e0f2fe;
    color: #0EA5E9;
    animation: pscUpsellPulse 1s infinite;
}

.psc-upsell-added {
    background: #0EA5E9 !important;
    color: #ffffff !important;
    border-color: #0EA5E9 !important;
}

@keyframes pscUpsellPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Mobile refinements */
@media (max-width: 480px) {
    .psc-upsell-section {
        padding: 14px 16px 12px;
    }

    .psc-upsell-card {
        flex: 0 0 138px;
        width: 138px;
        padding: 8px;
    }

    .psc-upsell-title {
        font-size: 13px;
    }

    .psc-upsell-sub {
        font-size: 10px;
    }

    .psc-upsell-name {
        font-size: 11.5px;
        min-height: 30px;
    }

    .psc-upsell-price {
        font-size: 12px;
    }

    .psc-upsell-btn {
        padding: 7px 8px;
        font-size: 11px;
    }

    .psc-upsell-variant-pill {
        font-size: 10px;
        padding: 4px 3px;
    }
}
