:root {
    /* 60% Fondo (Blanco Puro) */
    --bg-main: #FFFFFF;
    --bg-header: #F7FAFC;
    /* Dark header to contrast with white background */
    --bg-card: #F7FAFC;

    /* 30% Texto y Contenedores (Gris Oscuro/Plomo) */
    --text-primary: #2D3748;
    --text-secondary: #4A4A4A;
    /* Variations of dark gray for hierarchy */
    --bg-container: #F7FAFC;
    /* Used for secondary background areas */
    --border-color: #E2E8F0;

    /* 10% Acento Transaccional (Verde Conversión) */
    --accent: #3182CE;
    --cta-color: #ED8936;
    --cta-hover: #DD6B20;
    --accent-hover: #2B6CB0;
    --price-color: #2D3748;
    --green-success: #00C853;
    /* Redundant but kept for compatibility if needed */

    --font-main: 'Outfit', sans-serif;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.12);
    --transition: all 0.2s ease-out;
    --border-radius: 6px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Container logic - Mercado Libre style breathing room */
.container {
    max-width: 1450px;
    /* Wider for desktop */
    margin: 0 auto;
    padding: 0 10px;
    width: 100%;
}

/* Header */
.glass-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 2100;
    /* Above modal (2000) and close button (2005) */
    background: var(--bg-header);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 10px 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-primary);
    /* White text on dark header */
    letter-spacing: -1px;
    font-style: italic;
}

.logo span {
    color: var(--accent);
    /* Green accent on dark header */
}

/* Nav & Cart */
.cart-btn,
.nav-link,
.header-filter-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    /* White icons/text on dark header */
    font-size: 1.1rem;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.cart-btn {
    font-size: 1.4rem;
}

.cart-btn:hover {
    transform: scale(1.05);
}

#cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 50%;
    color: #fff;
    font-weight: bold;
}

/* Search Suggestions */
/* Search Suggestions */
.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    z-index: 10000 !important;
    /* Force top */
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.suggestions-list.active {
    display: block;
}

.suggestion-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: var(--bg-container);
    color: var(--accent);
}

.suggestion-item img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 2px;
}

/* Carousel Styles */
.hero-carousel {
    position: relative;
    width: 100%;
    /* Default Mobile: Square or slightly taller for visibility */
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--bg-container);
    /* Soft gray for contained images */
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    /* Subtle shadow for depth */
}

@media (min-width: 769px) {
    .hero-carousel {
        /* Desktop: Widescreen Banner */
        aspect-ratio: 21 / 9;
        /* approx 2.33 */
        max-height: 500px;
        /* Cap height on very large screens */
    }
}

.carousel-slide {
    display: none;
    width: 100%;
    height: 100%;
    animation: fadeEffect 0.5s;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes fadeEffect {
    from {
        opacity: 0.6
    }

    to {
        opacity: 1
    }
}

.carousel-slide.active {
    display: flex;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Ensure full image is visible */
    display: block;
}

/* Double slide layout */
.double-slide {
    display: none;
}

.double-slide.active {
    display: flex;
}

.double-slide img {
    width: 50%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    /* Spacing between images */
}

/* Controls */
.carousel-prev,
.carousel-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    color: var(--text-primary);
    font-weight: bold;
    font-size: 18px;
    transition: 0.3s ease;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    user-select: none;
}

.carousel-prev {
    left: 15px;
}

.carousel-next {
    right: 15px;
}

.carousel-prev:hover,
.carousel-next:hover {
    background-color: var(--bg-card);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Dots/bullets */
.carousel-dots {
    position: absolute;
    bottom: 15px;
    width: 100%;
    text-align: center;
    z-index: 10;
}

.dot {
    cursor: pointer;
    height: 10px;
    width: 10px;
    margin: 0 5px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    display: inline-block;
    transition: all 0.3s ease;
}

.active.dot,
.dot:hover {
    background-color: var(--accent);
    transform: scale(1.2);
}

/* Catalog Section */
.catalog-section {
    padding: 60px 20px 100px;
    /* More bottom padding */
    margin-top: 20px;
}

/* Cart Drawer */
.cart-drawer {
    position: fixed;
    right: -400px;
    width: 350px;
    top: 0;
    bottom: 0;
    height: 100%;
    max-height: 100dvh;
    background: var(--bg-card);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.05);
    z-index: 1500;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Prevent drawer itself from scrolling, inner containers scroll */
    padding-top: 80px;
    /* Clear fixed header */
}

.cart-drawer.active {
    right: 0;
}

.cart-header {
    background: var(--bg-card);
    /* Changed from --bg-header to ensure white background */
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.cart-header h3 {
    margin: 0;
    color: var(--text-primary);
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.cart-total-row.final-total {
    color: var(--text-primary);
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: color 0.2s;
}

.close-cart:hover {
    color: var(--accent);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 15px;
}

.cart-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #eee;
}

.item-details {
    flex: 1;
}

.item-details h4 {
    font-size: 0.9rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.item-price {
    color: var(--price-color);
    font-weight: 600;
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.qty-btn {
    background: #f0f0f0;
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
}

.remove-btn {
    color: red;
    background: none;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
    margin-left: auto;
}

.cart-footer {
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    background: #f9f9f9;
    flex-shrink: 0;
    /* Never shrink the footer */
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.checkout-btn {
    width: 100%;
    padding: 15px;
    background: var(--cta-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.checkout-btn:hover {
    background: var(--cta-hover);
}

.btn-whatsapp {
    background: #25d366 !important;
    /* Force green override if needed */
    transition: background-color 0.2s ease;
}

.btn-whatsapp:hover {
    background: #128C7E !important;
}

/* Elegant Free Shipping Progress */
.free-shipping-banner {
    background: transparent;
    padding: 10px 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
    /* Important: Never collapse */
}

/* Specifics for Global Top Bar */
.free-shipping-banner.global-banner {
    background: transparent;
    border-top: none;
    margin-bottom: 0;
    padding: 10px 0;
    width: 100%;
}

.free-shipping-banner.global-banner .banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.free-shipping-banner.global-banner .progress-wrapper {
    max-width: 500px;
    /* Wider */
    height: 12px;
    /* Thicker */
    background: rgba(255, 255, 255, 0.5);
    /* Semi-transparent white backing */
}

.free-shipping-banner .banner-text {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #444;
    margin-bottom: 8px;
}

.free-shipping-banner .banner-text i {
    color: #00a650;
}

.progress-wrapper {
    width: 100%;
    height: 4px;
    background: #eef7f2;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #00a650;
    transition: width 0.4s ease-out;
}

.free-shipping-msg-success {
    color: #00a650 !important;
    font-weight: 600;
}

@media (max-width: 768px) {
    .free-shipping-banner-global .banner-content {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }

    .free-shipping-banner-global .progress-wrapper {
        max-width: 100%;
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.section-header h2 {
    font-size: 2rem;
    color: #333;
    font-weight: 300;
}

.filters {
    display: flex;
    gap: 10px;
}

.filters-row {
    margin-top: 10px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 0.9rem;
}

.filter-group select,
.filter-group input {
    border: none;
    outline: none;
    background: transparent;
    color: #333;
    font-family: var(--font-main);
    cursor: pointer;
}

.filter-group select {
    appearance: none;
    /* Remove default arrow to style cleaner if needed, or keep standard */
    padding-right: 15px;
    /* Space for arrow if custom, but standard is fine for now */
}

/* Mobile/Tablet Header Optimization */
@media (max-width: 1024px) {
    .header-filter-btn span {
        display: none;
        /* Hide 'Filtros' word on small screens to save space */
    }

    .logo {
        display: flex !important;
        font-size: 0.7rem;
        /* Very small text */
        margin-right: 10px;
        order: 0;
        /* Show first */
        white-space: nowrap;
        align-items: center;
        flex-shrink: 0;
        /* Prevent squashing */
    }

    /* ... omitted h1/i styles ... */

    /* ... omitted h1/i styles ... */

    .header-center {
        margin: 0 !important;
        flex: 1 !important;
        /* Simple flex grow */
        width: auto !important;
        position: relative;
        order: 1;
        display: block !important;
    }

    #search-input {
        width: 100% !important;
        padding-right: 40px !important;
    }

    .header-content nav {
        flex: 0 0 auto !important;
        /* Keep cart fixed size */
        display: flex !important;
        align-items: center !important;
        order: 2;
        margin-left: 10px;
        flex-shrink: 0;
    }

    .logo h1 {
        font-size: 1rem;
        /* Adjust h1 inside logo */
        margin: 0;
    }

    .logo i {
        font-size: 1rem;
        margin-right: 2px;
    }

    /* Only hide nav links, not logo */
    a.nav-link {
        display: none !important;
    }

    .header-content {
        display: grid !important;
        grid-template-columns: auto 1fr auto !important;
        /* Logo, Search (Expand), Cart */
        align-items: center !important;
        gap: 10px !important;
        padding: 5px 15px !important;
        width: 100% !important;
        justify-content: stretch !important;
    }

    /* Reset Flex properties that might interfere */
    .logo,
    .header-center,
    .header-content nav {
        order: unset !important;
        flex: unset !important;
        width: auto !important;
    }

    .header-center {
        margin: 0 !important;
        display: block !important;
        width: 100% !important;
        /* Fill grid cell */
    }

    /* Ensure search input takes full width of its cell */
    #search-input {
        width: 100% !important;
    }

    /* Search Container Clear Button */
    .search-container {
        position: relative;
        width: 100%;
        overflow: visible !important;
        /* Ensure suggestions can overflow */
    }

    /* Force suggestions to be visible and wide on mobile */
    .suggestions-list {
        width: 120% !important;
        /* Make it wider than the input */
        left: -10% !important;
        /* Center it roughly */
        z-index: 100000 !important;
    }

    .clear-search-btn {
        position: absolute;
        right: 40px;
        /* Left of search button */
        top: 50%;
        transform: translateY(-50%);
        background: none;
        border: none;
        color: #999;
        font-size: 1rem;
        cursor: pointer;
        padding: 5px;
        z-index: 10;
        display: none;
        /* Toggled via JS */
    }

    .clear-search-btn:hover {
        color: #333;
    }

    .header-center {
        margin: 0 !important;
        flex: 1 1 auto !important;
        /* Grow, shrink, auto basis */
        width: 100% !important;
        /* Force width */
        min-width: 0;
        order: 1;
        display: block !important;
        /* Ensure block-level for width */
    }

    #search-input {
        width: 100% !important;
        padding-right: 70px !important;
        /* Space for X and Search buttons */
    }

    .header-content nav {
        flex: 0 0 auto !important;
        /* Do not grow or shrink */
        width: auto !important;
        display: flex !important;
        align-items: center !important;
        order: 2;
        /* Cart second */
    }

    /* Adjust Close Button for shorter header */
    .close-modal {
        top: 90px !important;
        /* Safe position below compact header */
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .modal-content {
        margin-top: 0;
    }

    .modal-overlay {
        padding-top: 80px;
        /* Aligned with header */
    }
}

.filter-group i {
    color: #999;
}

.filter-btn {
    background: transparent;
    border: none;
    color: #666;
    padding: 8px 16px;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font-main);
    font-weight: 500;
    position: relative;
}

.filter-btn:hover {
    color: var(--accent);
}

.filter-btn.active {
    color: var(--accent);
    background: transparent;
    border: none;
    font-weight: 600;
}

.main-tabs .filter-btn {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.main-tabs .filter-btn.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    /* Align with border-bottom of container */
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.sub-pills .filter-btn {
    background: #f5f5f5;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85rem;
    color: #555;
    font-weight: 400;
}

.sub-pills .filter-btn.active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}

.sub-pills .filter-btn:hover {
    background: #e0e0e0;
    color: #333;
}

.sub-pills .filter-btn.active:hover {
    background: var(--accent);
    color: #fff;
}

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 columns for desktop as requested */
    gap: 20px;
    padding: 10px 0;
}

.product-card {
    background: var(--bg-card);
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    padding: 0;
    /* Removing padding for edge-to-edge image look */
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    backdrop-filter: none;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.product-card:hover {
    transform: none;
    /* Mercado Libre doesn't lift much */
    box-shadow: var(--shadow-hover);
}

.card-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    /* Square ratio for consistent framing */
    border-radius: 0;
    border-bottom: 1px solid #eee;
    overflow: hidden;
    margin-bottom: 0px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Fill space removing white edges */
    transition: transform 0.3s ease;
}

.product-card:hover .card-image img {
    transform: none;
}

.card-info {
    padding: 20px;
}

.card-info h3 {
    font-size: 1rem;
    color: #333;
    margin-bottom: 8px;
    font-weight: 400;
    line-height: 1.3;
    /* Limit lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
}

.card-info .category {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 5px;
    display: none;
    /* Hide category to clean up card */
}

.card-footer {
    display: flex;
    flex-direction: column;
    /* Stack price and shipping */
    align-items: flex-start;
}

/* Video Support Styles */
.video-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(52, 131, 250, 0.9);
    /* Accent blue */
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 5;
    text-transform: uppercase;
}

.price {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--price-color);
    margin-bottom: 5px;
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 30px;
    box-shadow: 2px 2px 3px #999;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    background-color: #128C7E;
    transform: scale(1.1);
    color: white;
}

.whatsapp-float i {
    margin-top: 0px;
    /* Adjust if icon is not centered vertically */
}

@media (max-width: 768px) {
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
        font-size: 25px;
    }
}

/* Simulated Free Shipping Badge */
/* Delivery Badge */
.shipping-badge {
    color: #00a650;
    /* ML Green */
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.shipping-badge i {
    font-size: 0.9em;
}

.full-badge {
    color: #00a650;
    font-weight: 800;
    font-style: italic;
    margin-left: 5px;
    font-size: 0.8rem;
    display: inline-block;
}

.add-btn {
    display: none;
    /* Remove circle button, whole card is clickable */
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    /* Lighter backdrop */
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    /* Start from top instead of center */
    justify-content: center;
    padding-top: 80px;
    /* Space for the fixed header */
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #fff;
    /* White background */
    width: 90%;
    max-width: 1000px;
    border-radius: 4px;
    /* Squarer corners like ML */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    position: relative;
    max-height: calc(100vh - 120px);
    /* Adjust height to fit within viewport minus header/padding */
    margin-top: 0;
    /* Reset margin */
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding-bottom: 50px;
    /* Extra space at bottom */
}

.close-modal {
    position: absolute;
    top: 90px;
    /* Aligned with header */
    right: 20px;
    background: #fff;
    border-radius: 50%;
    border: 2px solid #ddd;
    /* Thicker border for visibility */
    color: #333;
    width: 45px;
    height: 45px;
    cursor: pointer;
    z-index: 2200;
    /* Higher than header (2100) */
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s;
}

.close-modal:hover {
    transform: scale(1.1);
    color: var(--accent);
    border-color: var(--accent);
}

/* Image Navigation Arrows */
.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    color: #333;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background 0.3s, transform 0.2s;
}

.nav-arrow:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.1);
}

.nav-arrow.prev {
    left: 10px;
}

.nav-arrow.next {
    right: 10px;
}

@media (max-width: 768px) {
    .close-modal {
        top: 10px;
        right: 10px;
        width: 45px;
        /* Even larger on mobile */
        height: 45px;
        font-size: 1.5rem;
        background: #fff;
        /* Solid white on mobile for max visibility */
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
}

.modal-body {
    display: flex;
    flex-direction: column;
    padding: 30px;
    gap: 30px;
}

@media (min-width: 768px) {
    .modal-body {
        flex-direction: row;
        align-items: flex-start;
        gap: 40px;
    }

    .modal-image-container {
        flex: 1.5;
        display: flex;
        gap: 15px;
        position: sticky;
        top: 0;
    }

    .modal-details {
        flex: 1;
        position: sticky;
        top: 0;
        align-self: flex-start;
    }
}

/* Gallery Styles */
.thumbnail-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 60px;
}

.thumbnail {
    width: 60px;
    height: 60px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    padding: 2px;
    background: #fff;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Quantity Selector */
.quantity-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.qty-btn {
    background: #f9f9f9;
    border: none;
    width: 35px;
    height: 35px;
    font-size: 1.1rem;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-btn:hover {
    background: #eee;
}

#modal-qty-input {
    width: 40px;
    height: 35px;
    border: none;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-card);
    -moz-appearance: textfield;
    appearance: textfield;
}

#modal-qty-input::-webkit-outer-spin-button,
#modal-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    -moz-appearance: textfield;
    margin: 0;
}

.payment-logos {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    font-size: 1.2rem;
    color: #444;
}

.payment-logos i {
    opacity: 0.8;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--accent);
    border-width: 2px;
}

.main-image {
    width: 450px;
    height: 450px;
    flex: 0 0 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    position: relative;
}

.main-image img,
#modal-video-display {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

#modal-video-display {
    display: none;
    background: #000;
    width: 100%;
    border-radius: 4px;
}

/* Modal Details */
.modal-details h2 {
    font-size: 1.6rem;
    margin-bottom: 10px;
    line-height: 1.2;
    color: #333;
    font-weight: 600;
}

.modal-details .badge {
    color: rgba(0, 0, 0, 0.55);
    font-size: 0.85rem;
    margin-bottom: 15px;
    display: block;
}

.modal-details .price {
    font-size: 2.2rem;
    margin: 5px 0 15px;
    display: block;
    font-weight: 700;
    color: var(--text-primary);
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto;
    background: #fff;
    padding: 10px 0 0;
    border-top: 1px solid #eee;
    z-index: 10;
}

@media (max-width: 768px) {
    .sidebar-footer {
        position: sticky;
        bottom: 0;
        padding-bottom: 20px;
        /* Extra padding for mobile touch */
    }
}

.stock-info {
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.modal-details .description {
    color: var(--text-secondary);
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 1rem;
    line-height: 1.5;
    white-space: pre-line;
}

.whatsapp-button {
    display: block;
    width: 100%;
    background-color: var(--cta-color);
    /* Orange for primary action */
    color: white;
    text-decoration: none;
    padding: 16px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    text-align: center;
    margin-top: 15px;
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.3);
}

.whatsapp-button:hover {
    background-color: var(--cta-hover);
}

.whatsapp-button i {
    margin-right: 8px;
}

/* Animations */
.fade-in-up {
    animation: fadeInUp 1s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* Loader */
.loader {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

/* Quick Categories Mobile Layout */
.quick-categories {
    display: none;
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px 5px;
    margin: 0px 5px 15px;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.quick-categories::-webkit-scrollbar {
    display: none;
}

.quick-cat-btn {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.quick-cat-btn i {
    font-size: 1.1rem;
    color: #3483fa;
    /* MercadoLibre style blue icon */
}

.quick-cat-btn:hover,
.quick-cat-btn.active {
    background: var(--cta-color);
    color: white;
    border-color: var(--cta-color);
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.2);
}

.quick-cat-btn.active i,
.quick-cat-btn:hover i {
    color: white;
}

/* Presentation Hero Base (Desktop & Mobile) */
.presentation-hero {
    display: flex;
    position: relative;
    width: 100%;
    height: 65vh;
    background: url('../img/vengo_hero_premium.png') center/cover no-repeat;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 40px;
    margin-top: 0;
    overflow: hidden;
}

.splash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.splash-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.splash-logo {
    width: 50%;
    max-width: 350px;
    margin-bottom: 40px;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.4));
}

.presentation-hero .quick-categories {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    width: 95%;
    max-width: 1100px;
    padding: 0 10px;
    margin-bottom: 0;
}

/* Visual Image Category Cards */
.quick-cat-visual {
    width: 100%;
    height: 64px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    border: none;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}

.quick-cat-visual:hover,
.quick-cat-visual.active {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 24px rgba(0,0,0,0.55);
}

.qc-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0.25) 100%);
    transition: background 0.25s;
}

.quick-cat-visual:hover .qc-overlay,
.quick-cat-visual.active .qc-overlay {
    background: linear-gradient(90deg, rgba(0,180,255,0.45) 0%, rgba(0,0,0,0.2) 100%);
}

.qc-label {
    position: relative;
    z-index: 2;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-shadow: 0 1px 6px rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 5px;
    height: 100%;
    width: 100%;
    text-align: center;
    white-space: normal;
    line-height: 1.2;
}

.qc-label i {
    font-size: 1.3rem;
    color: #fff;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.6));
}

.presentation-hero .quick-cat-btn.quick-cat-visual {
    background-color: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35);
    padding: 0;
    flex: 1;
    min-width: 0;
    width: auto;
    height: 100px;
    border-radius: 12px;
    justify-content: flex-start;
}

.presentation-hero .quick-cat-btn.quick-cat-visual:hover,
.presentation-hero .quick-cat-btn.quick-cat-visual.active {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 24px rgba(0,0,0,0.55);
    background-color: transparent;
    border-color: transparent;
}

.scroll-indicator:hover {
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .presentation-hero {
        height: 100vh;
        padding-bottom: 70px;
    }

    .splash-logo {
        width: 70%;
        max-width: 250px;
        margin-bottom: 30px;
    }

    .presentation-hero .quick-categories {
        flex-direction: column;
        align-items: stretch;
        max-width: 90%;
        gap: 9px;
    }

    .presentation-hero .quick-cat-btn.quick-cat-visual {
        flex: none;
        width: 100%;
        height: 58px;
    }

    body,
    html {
        overflow-x: hidden;
        width: 100%;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
        /* Stretch to occupy full width */
    }

    .filters {
        flex-wrap: wrap;
        /* Wrap filter groups */
        gap: 8px;
    }

    .main-tabs {
        flex-wrap: wrap;
        gap: 5px !important;
    }

    .apply-filters-btn.mobile-only {
        display: block !important;
    }

    /* Hide floating elements when filters or auth are open */
    body.filters-open .whatsapp-float,
    body.filters-open .floating-shipping-widget,
    body.auth-modal-open .floating-shipping-widget,
    body.auth-modal-open .whatsapp-float {
        display: none !important;
    }

    /* Ensure Sticky Footer works by setting sidebar height/overflow */
    #filters-sidebar {
        display: none;
        /* Hidden by default */
        flex-direction: column;
        height: 100vh;
        overflow-y: auto;
        padding-bottom: 0;
    }

    #filters-sidebar.active {
        display: flex;
        /* Visible as Flex when active */
    }

    /* Mobile Grid Overrides - FIXED strictly inside media query */
    .product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        /* 3 columns on mobile as requested */
        gap: 8px;
        padding: 0 5px;
    }

    .product-card {
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }

    .card-image {
        height: auto;
        /* Let aspect-ratio handle it */
    }

    .card-info {
        padding: 10px;
    }

    .card-info h3 {
        font-size: 0.7rem;
        line-height: 1.2;
        margin-bottom: 4px;
        height: 2.4em;
        /* Enforce height for alignment */
        overflow: hidden;
    }

    .price {
        font-size: 0.95rem;
    }
}

.main-tabs .filter-btn {
    font-size: 0.8rem;
    padding: 5px 8px;
}

.filter-group {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    flex-wrap: nowrap;
    /* Keep label and selects in one line within group if possible, but the group itself is 100% width */
}

.filter-group select {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
}

.filter-group label i {
    display: none;
}



/* Compact Free Shipping Banner for Mobile */
.global-banner {
    padding: 5px 0 !important;
    /* Reduced padding */
}

.global-banner .banner-text {
    font-size: 0.8rem !important;
    /* Smaller text */
    margin-bottom: 2px !important;
}

.global-banner .progress-wrapper {
    height: 4px !important;
    margin-top: 2px !important;
}

.global-banner i {
    font-size: 0.9rem !important;
}





/* Hide Free Shipping Banner when Cart/Checkout is Open */
body.active-modal #global-free-shipping,
/* If we want it hidden for modal too */
body.cart-open #global-free-shipping {
    display: none !important;
}

/* Adjust top padding when banner is hidden to avoid gap */
body.cart-open .cart-drawer,
body.cart-open .checkout-form-container {
    padding-top: 80px !important;
}

.shipping-badge {
    font-size: 0.6rem;
    /* Simplify badge on mobile */
}

.full-badge {
    font-size: 0.6rem;
    margin-left: 2px;
}

/* Modal Mobile Fixes */
.modal-body {
    padding: 15px;
    gap: 20px;
}

.modal-image-container {
    flex-direction: column-reverse;
    gap: 10px;
    position: static;
}

.thumbnail-list {
    flex-direction: row;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 5px;
    justify-content: center;
}

/* --- Consolidated Modal Styles --- */
.modal-content {
    background: #fff;
    width: 95%;
    max-width: 1000px;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-body {
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
}

@media (min-width: 768px) {
    .modal-body {
        flex-direction: row;
        align-items: flex-start;
        padding: 40px;
        gap: 40px;
    }
}

.modal-image-container {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

@media (min-width: 768px) {
    .modal-image-container {
        flex-direction: row;
        position: sticky;
        top: 0;
    }
}

.main-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.modal-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Mobile Fix: Compact layout to show button above the fold */
@media (max-width: 768px) {
    .modal-content {
        width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .modal-body {
        padding: 15px;
        gap: 15px;
    }

    .main-image {
        max-height: 35vh;
        /* Limit image height to bring content up */
        margin-bottom: 10px;
    }

    .main-image img {
        max-height: 35vh;
        width: auto;
    }

    .modal-details h2 {
        font-size: 1.4rem;
        margin: 0;
    }

    .price-container {
        margin: 5px 0;
    }

    .quantity-selector {
        margin: 10px 0;
    }

    .whatsapp-button {
        padding: 15px;
        font-size: 1.1rem;
        margin-top: auto;
        position: sticky;
        bottom: 10px;
        z-index: 100;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        width: 100%;
        border-radius: 8px;
    }
}

.thumbnail-list {
    display: flex;
    flex-direction: row;
    gap: 10px;
    overflow-x: auto;
    padding: 5px 0;
}

@media (min-width: 768px) {
    .thumbnail-list {
        flex-direction: column;
        width: 70px;
    }
}



.modal-details h2 {
    font-size: 1.3rem;
}

.modal-details .price {
    font-size: 1.8rem;
}

/* Hide filter sidebar and adjust layout if needed, 
       but for now assuming vertical scroll is fine */



/* Footer Styles */
.site-footer {
    background-color: var(--text-primary);
    color: var(--bg-main);
    padding: 60px 0 20px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    color: var(--accent);
    font-size: 1.2rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-section p {
    color: #cccccc;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    color: #cccccc;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-section ul li a:hover {
    color: #ffe600;
}

.footer-section i {
    color: var(--accent);
    width: 20px;
    margin-right: 10px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s;
}

.social-icons a:hover {
    background: #ffe600;
    color: #333;
    transform: translateY(-3px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 0.9rem;
    color: #999;

}

/* Checkout Form Styles */
.checkout-form-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    animation: fadeIn 0.3s ease;
    padding-top: 80px;
    /* Clear header */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.back-btn {
    background: none;
    border: none;
    color: #333;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    margin-right: 15px;
}

.form-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: var(--font-main);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--accent);
}

/* Selected City Card */
.selected-city-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f0f7ff;
    border: 1px solid #3483fa;
    padding: 12px 15px;
    border-radius: 8px;
    margin-top: 5px;
    animation: fadeInCity 0.3s ease;
}

@keyframes fadeInCity {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.selected-city-card .card-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #3483fa;
    font-weight: 600;
}

.btn-change-city {
    background: #fff;
    border: 1px solid #3483fa;
    color: #3483fa;
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-change-city:hover {
    background: var(--accent);
    color: var(--bg-main);
}

/* Floating Tooltip Refinement */
.floating-tooltip {
    position: absolute;
    left: calc(100% + 15px);
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: #333;
    /* Darker more professional */
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    width: 200px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.floating-tooltip::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid #333;
}

.floating-tooltip.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

/* Floating Tooltip Styles */
.floating-tooltip i {
    margin-right: 8px;
    font-size: 1.1rem;
}

/* responsive mobile tooltip */
@media (max-width: 992px) {
    .floating-tooltip {
        left: 0;
        top: calc(100% + 5px);
        width: 100%;
        transform: translateY(5px);
    }

    .floating-tooltip::before {
        display: none;
    }
}

/* Payment Selector Redesign */
.payment-selector-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.payment-card {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
}

.payment-card:hover {
    border-color: #ddd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.payment-card.active {
    border-color: #3483fa;
    background: #f0f7ff;
}

.payment-card .card-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 5px;
}

.payment-card .badge {
    background: #3483fa;
    color: white;
    font-size: 0.65rem;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: bold;
}

.payment-card .card-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.payment-card .payment-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.payment-card .main-icon {
    font-size: 1.5rem;
    color: #555;
    width: 30px;
    text-align: center;
}

.payment-card.active .main-icon {
    color: #3483fa;
}

.payment-card .text-content {
    display: flex;
    flex-direction: column;
}

.payment-card .text-content strong {
    font-size: 0.95rem;
    color: #333;
}

.payment-card .text-content span {
    font-size: 0.8rem;
    color: #777;
}

.payment-card .payment-logos {
    margin-top: 5px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 10px;
}

.payment-card.subtle {
    border-width: 1px;
    opacity: 0.9;
}

.payment-card.subtle.active {
    border-width: 2px;
    opacity: 1;
}

/* Related Products Section in Modal */
.related-products-section {
    padding: 0 30px 30px;
    border-top: 1px solid #eee;
    margin-top: 20px;
    flex-shrink: 0;
    /* Prevent collapsing */
    background: #fff;
    width: 100%;
    display: block;
    /* Ensure it takes space */
}

.related-products-section h3 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.related-card {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 10px;
    cursor: pointer;
    transition: box-shadow 0.2s;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
}

.related-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.related-card img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    margin-bottom: 10px;
}

.related-card h4 {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-card .price {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Floating Shipping Widget Styles (Global) */
.floating-shipping-widget {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 10px 15px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 200px;
    text-align: center;
    transition: all 0.3s ease;
}

.fsw-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.fsw-progress-bg {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
}

.fsw-progress-bar {
    height: 100%;
    background: var(--accent);
    /* Green accent */
    width: 0%;
    transition: width 0.3s ease;
}

/* Hide widget when cart or modal is open */
/* Floating Widget Rules */
body.cart-open .floating-shipping-widget,
body.active-modal .floating-shipping-widget {
    display: none !important;
}

/* --- NEW SIDEBAR CATALOG STYLES --- */

.catalog-container {
    display: flex;
    gap: 30px;
    position: relative;
    align-items: flex-start;
}

/* Sidebar Desktop */
.catalog-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 20px;
    position: sticky;
    top: 90px;
    /* Below header */
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.filter-widget {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.filter-widget:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.widget-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #333;
}

.widget-header h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.widget-header i {
    color: var(--accent);
}

/* Search Sidebar */
.search-box-sidebar {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    transition: var(--transition);
}

.search-box-sidebar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(52, 131, 250, 0.1);
}

.search-box-sidebar input {
    flex: 1;
    border: none;
    padding: 8px 12px;
    outline: none;
    font-size: 0.9rem;
    width: 100%;
}

.search-box-sidebar button {
    background: #f9f9f9;
    border: none;
    padding: 0 12px;
    cursor: pointer;
    color: #666;
    border-left: 1px solid #eee;
}

.search-box-sidebar button:hover {
    background: #eee;
    color: var(--accent);
}

/* Categories Tree */
.search-categories input {
    width: 100%;
    padding: 8px;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.cat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    font-size: 0.9rem;
    color: #555;
    user-select: none;
}

.cat-item:hover {
    background: #f5f5f5;
    color: #333;
}

.cat-item.active {
    background: #eef6ff;
    color: var(--accent);
    font-weight: 500;
}

.cat-checkbox {
    margin-right: 10px;
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.cat-label {
    flex: 1;
}

.cat-count {
    font-size: 0.75rem;
    color: #999;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Price Slider - Dual Range */
.price-slider-container {
    position: relative;
    width: 100%;
    height: 30px;
    margin-top: 10px;
}

.slider-track {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 4px;
    width: 100%;
    background: #ddd;
    border-radius: 2px;
    z-index: 1;
}

.price-slider-container input[type="range"] {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    pointer-events: none;
    /* Let clicks pass through */
    -webkit-appearance: none;
    appearance: none;
    background: none;
    z-index: 2;
    margin: 0;
}

.price-slider-container input[type="range"]::-webkit-slider-thumb {
    pointer-events: auto;
    /* Re-enable pointer events for thumb */
    -webkit-appearance: none;
    appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    cursor: grab;
    margin-top: -7px;
    /* Align to center of track (if needed, or handle by flex) */
}

/* Inputs below slider */
.price-inputs {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 5px;
}

.price-field {
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
    color: #777;
    flex: 1;
}

.price-field input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
    margin-top: 2px;
    font-size: 0.85rem;
    color: #333;
}

/* Content Area */
.catalog-content {
    flex: 1;
    min-width: 0;
    /* Prevent flex overflow */
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.header-info h2 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--text-primary);
}

.product-count {
    font-size: 0.9rem;
    color: #777;
    margin-left: 5px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sort-control {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #555;
}

.sort-control select {
    padding: 5px 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-card);
    cursor: pointer;
    font-family: var(--font-main);
}

/* Active Filters Badges */
.active-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #eef6ff;
    color: var(--accent);
    border: 1px solid rgba(52, 131, 250, 0.2);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.filter-badge i {
    cursor: pointer;
    font-size: 0.8rem;
}

.filter-badge i:hover {
    color: #d90000;
}

@media (max-width: 768px) {
    .header-controls {
        flex-wrap: wrap;
        /* Anchors the active filter row under the top bar */
        position: sticky;
        top: 60px;
        z-index: 50;
        background: #f4f7f6;
        /* Matching the body background roughly to avoid transparency */
        padding: 10px 5px;
        margin: 0 -5px;
        border-bottom: 1px solid #eee;
    }

    .active-filters {
        flex-wrap: nowrap;
        overflow-x: auto;
        width: 100%;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .active-filters::-webkit-scrollbar {
        display: none;
    }

    .filter-badge {
        font-size: 0.75rem;
        padding: 4px 10px;
        flex-shrink: 0;
        border-radius: 12px;
    }
}

/* Mobile Adjustments */
.mobile-only {
    display: none;
}

@media (max-width: 900px) {
    .catalog-container {
        display: block;
        /* Stack */
    }

    .catalog-sidebar {
        display: none;
        /* Hidden by default, toggled via drawer */
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        max-height: 100%;
        z-index: 3000;
        border-radius: 0;
        border: none;
        box-shadow: none;
        padding: 20px;
        background: var(--bg-card);
        overflow-y: auto;
    }

    .catalog-sidebar.active {
        display: block;
        animation: slideInLeft 0.3s ease-out;
    }

    @keyframes slideInLeft {
        from {
            transform: translateX(-100%);
        }

        to {
            transform: translateX(0);
        }
    }

    .sidebar-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-card);
    }

    .sidebar-header h3 {
        margin: 0;
        font-size: 1.2rem;
        color: var(--text-primary);
        font-weight: 700;
    }

    .close-sidebar {
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 10px;
        color: var(--text-primary);
        transition: color 0.2s;
    }

    .close-sidebar:hover {
        color: var(--accent);
    }

    .mobile-only {
        display: flex;
    }

    .mobile-filter-btn {
        background: #fff;
        border: 1px solid #ccc;
        padding: 8px 15px;
        border-radius: 4px;
        font-weight: 600;
        cursor: pointer;
        align-items: center;
        gap: 8px;
    }

    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .header-controls {
        width: 100%;
        justify-content: space-between;
    }
}

/* Admin Global Dashboard Sidebar */
.admin-sidebar {
    position: fixed;
    top: 80px;
    left: 0;
    width: 250px;
    height: calc(100vh - 80px);
    background: #fff;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.05);
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    z-index: 900;
}

.sidebar-menu-item {
    padding: 12px 20px;
    color: #555;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.sidebar-menu-item:hover {
    background: #f8f9fa;
    color: var(--accent);
}

.sidebar-menu-item.active {
    background: #eef6ff;
    color: var(--accent);
    border-left-color: var(--accent);
}

.sidebar-menu-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1em;
}

.admin-main-content {
    margin-left: 250px;
    padding: 30px;
    min-height: calc(100vh - 80px);
    background: #f8f9fa;
}

@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 10px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    }

    .admin-main-content {
        margin-left: 0;
        padding: 15px;
    }

    .sidebar-menu-item {
        flex: 1;
        min-width: calc(50% - 10px);
        border-left: none;
        border-bottom: 3px solid transparent;
        justify-content: center;
        text-align: center;
        flex-direction: column;
        gap: 5px;
        padding: 10px;
        border-radius: 8px;
        font-size: 0.9em;
    }

    .sidebar-menu-item.active {
        border-left-color: transparent;
        border-bottom-color: var(--accent);
    }

    .sidebar-menu-item i {
        margin-bottom: 5px;
    }
}

/* Product Variants */
.variant-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    font-family: inherit;
    color: #4A4A4A;
}
.variant-btn.active {
    background: #3483fa;
    color: white;
    border-color: #3483fa;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(52, 131, 250, 0.3);
}
.variant-btn:hover:not(.active) {
    border-color: #3483fa;
    color: #3483fa;
}