/* 
 * Premium Marketplace Styles 
 * Design: Luxury Organic / Minimal
 */

:root {
    --primary-sage: #7D8C7D;
    --primary-sage-dark: #5A665A;
    --accent-beige: #F5F5F0;
    --bg-white: #FFFFFF;
    --bg-off-white: #FCFCFA;
    --text-charcoal: #2D2D2D;
    --text-muted: #8E8E8E;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-full: 50px;
    --soft-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    --premium-shadow: 0 20px 50px rgba(125, 140, 125, 0.08);
    --transition-smooth: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

body {
    background-color: var(--bg-white);
    color: var(--text-charcoal);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Layout Containers */
.premium-container {
    max-width: 1536px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero Section - Lifestyle */
.hero-premium {
    position: relative;
    min-height: 350px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6.5rem 0 3rem 0;
    /* Adjusted for smaller height */
    background-color: var(--off-white, #fafaf7);
    /* Fallback Sage Beige */
    background-image: url('../images/product_banner.jpeg');
    background-size: cover;
    background-position: center 22%;
    /* Shifts the image down to perfectly reveal the bottle caps */
    border-radius: 0 0 40px 40px;
    overflow: hidden;
    margin-bottom: 6rem;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(250, 249, 246, 0.95) 0%, rgba(250, 249, 246, 0.35) 40%, rgba(16, 40, 28, 0.65) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 800px;
}

.hero-tagline {
    display: inline-block;
    padding: 0.6rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #ffffff;
    margin-bottom: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 300;
    letter-spacing: -0.02em;
    margin-bottom: 2.5rem;
    color: #ffffff;
    line-height: 1.1;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.btn-premium {
    display: inline-flex;
    align-items: center;
    padding: 1rem 3rem;
    background: #163529;
    color: white;
    border-radius: var(--radius-full);
    font-weight: 500;
    transition: var(--transition-smooth);
    border: none;
    cursor: pointer;
}

.btn-premium:hover {
    background: var(--primary-sage);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Marketplace Layout */
.marketplace-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 4rem;
    align-items: start;
}

/* Sidebar Filters */
.filter-sidebar {
    background: #FAFAFA;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 2rem;
    box-shadow: var(--soft-shadow);
}

.filter-group {
    margin-bottom: 3rem;
}

.filter-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    display: block;
}

.filter-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-charcoal);
    transition: var(--transition-smooth);
}

.checkbox-item span {
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: var(--transition-smooth);
}

.brand-filter-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    margin-right: 14px;
    opacity: 1;
    transition: var(--transition-smooth);
}

.checkbox-item.active .brand-filter-logo,
.checkbox-item:hover .brand-filter-logo {
    opacity: 1;
    transform: scale(1.1);
}

.checkbox-item:hover {
    color: var(--primary-sage);
}

.custom-checkbox {
    width: 20px;
    height: 20px;
    border: 1px solid #DEDEDE;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    background: white;
}

.checkbox-item.active .custom-checkbox {
    background: var(--primary-sage);
    border-color: var(--primary-sage);
}

.checkbox-item.active .custom-checkbox::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    color: white;
}

/* Product Cards Refresh */
.premium-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem 1.5rem;
    padding-bottom: 4rem;
}

.product-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-smooth);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--premium-shadow);
}

.image-wrapper {
    position: relative;
    aspect-ratio: 1/1;
    overflow: hidden;
    background: #F8F8F6;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.product-card:hover .image-wrapper img {
    transform: scale(1.08);
}

.brand-badge-mini {
    position: absolute;
    bottom: 0.8rem;
    left: 0.8rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    padding: 0.3rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    z-index: 10;
    transition: var(--transition-smooth);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.brand-badge-mini img {
    height: 22px;
    width: auto;
    object-fit: contain;
}

.product-card:hover .brand-badge-mini {
    transform: translateY(-2px);
    background: white;
}

.modal-brand-tag {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    background: var(--accent-beige);
    color: var(--text-charcoal);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.category-badge {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary-sage-dark);
}

.card-info {
    padding: 1rem 1.2rem;
}

.product-name {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-charcoal);
}

.price-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.8rem;
}

.product-price-wrap {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.product-price-original {
    font-size: 0.95rem;
    font-weight: 500;
    color: #9ca3af;
    text-decoration: line-through;
}

.product-price-selling {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-green, #10B981);
}

.product-price {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-charcoal);
}

.modal-price .product-price-selling {
    font-size: 1.75rem;
}

.modal-price .product-price-original {
    font-size: 1.1rem;
}

.add-to-cart-btn {
    padding: 0.45rem 1rem;
    border-radius: var(--radius-full);
    background: var(--text-charcoal);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 180px;
}

.product-card:hover .add-to-cart-btn {
    background: #000;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
}

/* Animations & Interaction */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.8s forwards cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Adjustments */
@media (max-width: 1024px) {
    .marketplace-layout {
        grid-template-columns: 1fr;
    }

    .filter-sidebar {
        display: none !important;
    }

    .premium-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        /* Increased gap for single column spacing */
    }

    .mobile-filter-trigger {
        display: flex !important;
        position: fixed;
        bottom: 2rem;
        left: 50%;
        transform: translateX(-50%);
        /* Center on mobile */
        z-index: 100;
        background: var(--text-charcoal);
        color: white;
        padding: 0.9rem 1.8rem;
        border-radius: var(--radius-full);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
        font-weight: 600;
        font-size: 0.95rem;
        letter-spacing: 0.02em;
        border: none;
        align-items: center;
        gap: 0.8rem;
        transition: var(--transition-smooth);
    }

    .modal-grid {
        grid-template-columns: 1fr !important;
        /* Stack vertically */
    }

    .modal-image-pane {
        padding: 2rem !important;
        aspect-ratio: 1/1;
    }

    .modal-info-pane {
        padding: 2rem !important;
    }

    .modal-product-title {
        font-size: 1.5rem !important;
    }
}

/* Mobile Drawer Styling */
.mobile-filter-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    /* Hidden by default */
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: white;
    z-index: 10000;
    /* Above everything */
    padding: 2.5rem;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.1);
}

.mobile-filter-drawer.active {
    right: 0;
}

.drawer-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #F5F5F0;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-charcoal);
}

@media (min-width: 1025px) {

    .mobile-filter-trigger,
    .mobile-filter-drawer {
        display: none !important;
    }
}

/* More Dense Cards */
.product-name {
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--text-charcoal);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--primary-sage-dark);
}

/* Premium Modals Design */
.premium-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(25, 25, 25, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-smooth);
}

.premium-modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.premium-modal-content {
    background: white;
    width: 100%;
    max-width: 720px;
    height: auto;
    max-height: 85vh;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.12);
    transform: translateY(15px) scale(0.98);
    transition: var(--transition-smooth);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.premium-modal-backdrop.active .premium-modal-content {
    transform: translateY(0) scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-charcoal);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.modal-close-btn:hover {
    background: var(--text-charcoal);
    color: white;
    transform: rotate(90deg);
}

.modal-grid {
    display: grid;
    grid-template-columns: 40% 60%;
    height: 100%;
    min-height: 420px;
}

.modal-image-pane {
    background: #fdfdfc;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    position: relative;
}

.qv-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image-pane img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.06));
    margin: 0 auto;
    display: block;
}

.modal-info-pane {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: white;
    overflow-y: auto;
}

.brand-info-wrap {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.qv-brand-logo {
    height: 24px;
    width: auto;
    object-fit: contain;
}

.modal-brand-tag {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--primary-sage);
    background: var(--accent-beige);
    padding: 0.35rem 0.8rem;
    border-radius: 50px;
}

.modal-product-title {
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin-bottom: 0.6rem;
    color: var(--text-charcoal);
}

.modal-price {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-sage-dark);
    margin-bottom: 1.2rem;
}

.divider-line {
    width: 100%;
    height: 1px;
    background: rgba(0, 0, 0, 0.04);
    margin-bottom: 1.2rem;
}

.desc-scroll {
    max-height: 120px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    padding-right: 0.6rem;
}

.desc-scroll::-webkit-scrollbar {
    width: 4px;
}

.desc-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.desc-scroll::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.modal-product-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.modal-actions {
    margin-top: auto;
}

.qv-add-btn {
    width: 100%;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
    padding: 1.2rem !important;
    font-size: 1rem;
    border-radius: 14px !important;
    background: #163529 !important;
    box-shadow: 0 8px 20px rgba(100, 187, 60, 0.15) !important;
}

.qv-add-btn:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 15px 35px rgba(100, 187, 60, 0.3) !important;
}

/* Mobile Responsive Adjustments */
@media (max-width: 900px) {
    .premium-modal-content {
        max-height: 90vh;
        border-radius: 24px;
        max-width: 92%;
        margin: 1rem;
    }

    .modal-grid {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .modal-image-pane {
        padding: 0;
        height: 280px;
        background: white;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .qv-image-container {
        width: 100%;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }

    .modal-info-pane {
        padding: 1.5rem 1.8rem 2rem;
    }

    .modal-product-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .modal-price {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .divider-line {
        margin-bottom: 1rem;
    }

    .desc-scroll {
        max-height: 100px;
        margin-bottom: 1.5rem;
    }

    .modal-close-btn {
        top: 0.75rem;
        right: 0.75rem;
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }

    .qv-add-btn {
        padding: 1rem !important;
        font-size: 0.95rem;
        border-radius: 12px !important;
    }
}

@media (max-width: 480px) {
    .premium-modal-content {
        max-width: 96%;
    }

    .modal-image-pane {
        height: 240px;
        background: white;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .modal-info-pane {
        padding: 1.2rem 1.4rem 1.8rem;
    }
}

/* Form Styles for Order Modal */
.premium-form-group {
    margin-bottom: 1.2rem;
}

/* Custom Order Modal Replication */
.custom-order-modal .premium-modal-content {
    max-width: 500px;
    padding: 2rem;
    border-radius: 20px;
    overflow-y: auto;
    /* Ensure scrollability */
}

.modal-title-bold {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2D3748;
    margin-bottom: 1.5rem;
}

.summary-box-green {
    background-color: #F0FFF4;
    border: 1px solid #C6F6D5;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    color: #38A169;
    font-weight: 500;
}

.custom-label {
    display: block;
    font-size: 0.8rem;
    color: #4A5568;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.custom-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #2D3748;
    transition: all 0.2s;
}

.custom-input:focus {
    border-color: #38A169;
    background: white;
    box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.1);
}

.place-order-btn {
    width: 100%;
    background: #163529;
    color: white;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 700;
    margin-top: 1.5rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(100, 187, 60, 0.2);
}

.place-order-btn:hover {
    background: #52a331;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(100, 187, 60, 0.3);
}

.modal-trust-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.75rem;
    color: #718096;
}

/* Modern Success Modal Redesign */
.modern-success-modal .premium-modal-content {
    max-width: 400px;
    padding: 3.5rem 2.5rem;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.95);
}

.success-checkmark-svg {
    width: 80px;
    height: 80px;
    margin: 0 auto 2.5rem;
    display: block;
}

.checkmark-circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #7D8C7D;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.checkmark-check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke: #7D8C7D;
    stroke-width: 3;
    fill: none;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

.success-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-charcoal);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.6s cubic-bezier(0.2, 1, 0.3, 1) 0.4s;
}

.success-message {
    color: #718096;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.6s cubic-bezier(0.2, 1, 0.3, 1) 0.6s;
}

.premium-modal-backdrop.active .success-title,
.premium-modal-backdrop.active .success-message {
    opacity: 1;
    transform: translateY(0);
}

.done-btn-premium {
    width: 100%;
    padding: 1rem;
    background: var(--text-charcoal);
    color: white;
    border-radius: 14px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.done-btn-premium:hover {
    background: #000;
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

/* Floating Cart Button */
.cart-floating-trigger {
    position: fixed;
    bottom: 7rem;
    right: 2rem;
    width: 65px;
    height: 65px;
    background: #163529;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 15px 35px rgba(100, 187, 60, 0.3);
    cursor: pointer;
    z-index: 999;
    transition: var(--transition-smooth);
    border: none;
}

.cart-floating-trigger:hover {
    transform: scale(1.1) rotate(-5deg);
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #000;
    color: white;
    font-size: 0.7rem;
    font-weight: 800;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Cart Toast Notification */
.cart-toast {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 1000;
    transform: translateX(-120%);
    transition: var(--transition-smooth);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.cart-toast.active {
    transform: translateX(0);
}

.cart-toast .icon {
    width: 35px;
    height: 35px;
    background: #F0FFF4;
    color: #163529;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* =========================================
   CART MODAL — CUSTOM DESIGN SYSTEM
   ========================================= */

/* Box */
.cart-modal-box {
    background: #fff;
    width: 100%;
    max-width: 400px;
    margin: auto;
    height: auto;
    max-height: 92vh;
    border-radius: 24px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 80px rgba(0,0,0,0.15);
    transform: translateY(15px) scale(0.98);
    transition: transform 0.35s cubic-bezier(0.16,1,0.3,1), opacity 0.3s ease;
}

.premium-modal-backdrop.active .cart-modal-box {
    transform: translateY(0) scale(1);
}

/* Header */
.cart-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    border-bottom: 1px solid #e8f5e9;
    flex-shrink: 0;
}

.cart-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cart-icon-wrap {
    width: 38px;
    height: 38px;
    background: #d1fae5;
    color: #059669;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.cart-title-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1a202c;
    letter-spacing: -0.01em;
}

.cart-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 0.8rem;
    transition: background 0.2s, color 0.2s;
}

.cart-close-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Items list */
.cart-items-container {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem 1.25rem;
    max-height: 360px;
}

.cart-items-container::-webkit-scrollbar {
    width: 3px;
}

.cart-items-container::-webkit-scrollbar-track {
    background: transparent;
}

.cart-items-container::-webkit-scrollbar-thumb {
    background: #a7f3d0;
    border-radius: 10px;
}

/* Cart item row */
.cart-item-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid #f3f4f6;
    /* No animation here — re-render triggers glitch */
}

.cart-item-row:last-child {
    border-bottom: none;
}

.cart-item-img-wrap {
    position: relative;
    flex-shrink: 0;
}

.cart-item-img-wrap img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 14px;
    background: #f9fafb;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.cart-qty-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #059669;
    color: white;
    font-size: 0.6rem;
    font-weight: 900;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(5,150,105,0.4);
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.15rem;
}

.cart-item-brand {
    font-size: 0.7rem;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-qty-stepper {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border-radius: 10px;
    overflow: hidden;
}

.cart-qty-stepper button {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #6b7280;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.cart-qty-stepper button:hover {
    background: #e5e7eb;
}

.cart-qty-stepper span {
    font-size: 0.8rem;
    font-weight: 800;
    color: #374151;
    width: 22px;
    text-align: center;
    user-select: none;
}

.cart-item-price {
    font-size: 0.9rem;
    font-weight: 800;
    color: #059669;
}

.cart-item-remove {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
    font-size: 0.75rem;
    transition: background 0.2s, color 0.2s;
}

.cart-item-remove:hover {
    background: #fef2f2;
    color: #ef4444;
}

/* Empty cart state */
.cart-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    gap: 0.75rem;
}

.cart-empty-icon-wrap {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: #f0fdf4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #6ee7b7;
    margin-bottom: 0.25rem;
}

.cart-empty-title {
    font-size: 1rem;
    font-weight: 800;
    color: #374151;
}

.cart-empty-sub {
    font-size: 0.75rem;
    color: #9ca3af;
    max-width: 170px;
    line-height: 1.5;
}

/* Footer */
.cart-modal-footer {
    padding: 0.9rem 1.25rem;
    background: #f9fafb;
    border-top: 1px solid #f3f4f6;
    flex-shrink: 0;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.04);
}

.cart-subtotal-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 0.6rem 0.9rem;
    border-radius: 12px;
    border: 1px solid #f3f4f6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    margin-bottom: 0.75rem;
}

.cart-subtotal-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.cart-subtotal-amount {
    font-size: 1.2rem;
    font-weight: 900;
    color: #059669;
    letter-spacing: -0.02em;
}

.cart-checkout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.01em;
    box-shadow: 0 6px 16px rgba(5,150,105,0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cart-checkout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(5,150,105,0.4);
}

.cart-checkout-btn:active {
    transform: scale(0.97);
}

.cart-secure-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
    font-size: 0.68rem;
    color: #9ca3af;
}

.cart-secure-text i {
    color: #6ee7b7;
}

/* Floating trigger pulse */
.cart-floating-trigger.has-items {
    animation: cartPulse 2.5s ease-in-out infinite;
}

@keyframes cartPulse {
    0%, 100% { box-shadow: 0 15px 35px rgba(16,185,129,0.3); }
    50%       { box-shadow: 0 15px 35px rgba(16,185,129,0.6), 0 0 0 10px rgba(16,185,129,0.08); }
}

@media (max-width: 1024px) {
    .cart-floating-trigger {
        bottom: 2rem;
        right: auto;
        left: 2rem;
        z-index: 999;
    }
}
