:root {
    --bg-main: #0f172a;
    --bg-header: #1e293b;
    --bg-card: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --accent: #FFBF00;
    --accent-hover: #e5ab00;
    --price-color: #00D9FF;
    --green-success: #00D9FF;
    --font-main: 'Outfit', sans-serif;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 10px 15px -3px rgba(0, 217, 255, 0.2);
    --transition: all 0.2s ease-out;
    --border-radius: 8px;
}

body.theme-tecnologia {
    --accent: #00D9FF;
    --accent-hover: #00b0d4;
    --bg-main: #0a101f;
}

body.theme-hogar {
    --accent: #FF8C00;
    --accent-hover: #e07b00;
    --bg-main: #14100b;
}

body.theme-belleza {
    --accent: #ff4081;
    --accent-hover: #e03571;
    --bg-main: #1a0a11;
}

body.theme-herramientas {
    --accent: #eab308;
    --accent-hover: #ca8a04;
    --bg-main: #17150a;
}

* {
    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.1);
    padding: 10px 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo h1 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #00D9FF;
    letter-spacing: -1px;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo img {
    height: 81px;
    object-fit: contain;
}

.logo span {
    color: #FFBF00;
}

/* Nav & Cart */
.cart-btn {
    background: none;
    border: none;
    color: #333;
    font-size: 1.4rem;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.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: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 10000 !important;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.suggestions-list.active {
    display: block;
}

.suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 15px;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: #f5f5f5;
    color: var(--accent);
}

.suggestion-item img {
    width: 65px;
    height: 65px;
    object-fit: contain;
    border-radius: 6px;
    background: #fff;
    padding: 2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

/* Carousel Styles */
.hero-carousel {
    position: relative;
    width: 100%;
    /* Default Mobile: Square or slightly taller for visibility */
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f9f9f9;
    /* Soft gray for contained images */
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* 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: #333;
    font-weight: bold;
    font-size: 18px;
    transition: 0.3s ease;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    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: #fff;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

/* 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);
}

.video-hero {
    position: relative;
    width: 100%;
    height: 60vh;
    min-height: 400px;
    background: #000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-hero video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    opacity: 0.6;
    object-fit: cover;
}

.video-overlay {
    position: relative;
    z-index: 10;
    text-align: center;
    color: #fff;
    padding: 20px;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.video-overlay .pill-badge {
    background: rgba(255, 191, 0, 0.2);
    color: var(--accent);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85em;
    font-weight: 700;
    letter-spacing: 2px;
    border: 1px solid var(--accent);
    box-shadow: 0 0 10px rgba(255, 191, 0, 0.3);
}

.video-overlay h2 {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1.1;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.video-overlay p {
    font-size: 1.2rem;
    opacity: 0.9;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.btn-glow {
    margin-top: 10px;
    padding: 12px 30px;
    background: linear-gradient(45deg, var(--accent), var(--accent-hover));
    color: #000;
    text-decoration: none;
    font-weight: 800;
    font-size: 1.1em;
    border-radius: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 191, 0, 0.4);
}

.btn-glow:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 191, 0, 0.6);
}

@media (max-width: 768px) {
    .video-overlay h2 {
        font-size: 2rem;
    }

    .video-hero {
        height: 50vh;
    }
}

/* Catalog Section */
.catalog-section {
    padding: 60px 20px 100px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .catalog-section {
        padding: 20px 10px 100px;
        margin-top: 5px;
    }
}

/* Cart Drawer */
.cart-drawer {
    position: fixed;
    right: -400px;
    width: 350px;
    top: 0;
    bottom: 0;
    height: 100%;
    max-height: 100dvh;
    background: #fff;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    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-header);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.cart-header h3 {
    margin: 0;
    color: #fff;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #555;
}

.cart-total-row.final-total {
    color: #333;
}

.close-cart {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #fff;
}

.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;
    color: #1e293b;
}

.item-price {
    color: var(--price-color);
    font-weight: 600;
}

.item-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
    color: #1e293b;
}

.qty-btn {
    background: #f0f0f0;
    color: #1e293b;
    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: #25D366;
    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: #128C7E;
}

.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) {

    .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 - TikTok / Modern Vertical */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.product-card {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0, 217, 255, 0.15);
    border-color: rgba(255, 191, 0, 0.3);
}

.card-image {
    width: 100%;
    aspect-ratio: 4 / 5;
    /* Makes the image taller than it is wide, taking up more space downwards */
    background: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    color: #475569;
    /* Subtle text if image fails */
    font-size: 0.9rem;
    text-align: center;
    padding: 10px;
    /* Slight padding so the image doesn't touch the edges completely */
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Contain to ensure the full product is seen and centered with the padding */
    transition: transform 0.5s ease;
}

.product-card:hover .card-image img {
    transform: scale(1.05);
}

/* Floating Action Overlay */
.card-overlay-actions {
    position: absolute;
    bottom: -50px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: bottom 0.3s ease;
    z-index: 10;
}

.product-card:hover .card-overlay-actions {
    bottom: 15px;
    /* Slide up on hover */
}

/* Info Section */
.card-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.card-info h3 {
    font-size: 1.05rem;
    color: #fff;
    font-weight: 500;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.price-container {
    display: flex;
    flex-direction: column;
}

.price {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 1.7rem;
    font-weight: 900;
    color: var(--price-color);
    letter-spacing: -1px;
}

.original-price {
    font-size: 0.9rem;
    color: #cbd5e1;
    text-decoration: line-through;
}

/* Video Support Styles */
.video-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    color: var(--accent);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 5;
    border: 1px solid rgba(255, 191, 0, 0.3);
}

.shipping-badge {
    color: #2ed573;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(46, 213, 115, 0.1);
    padding: 4px 8px;
    border-radius: 6px;
}

.shipping-badge i {
    font-size: 0.9em;
}

/* 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 #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
    color: #333;
    background: #fff;
    -moz-appearance: textfield;
    appearance: textfield;
}

#modal-qty-input::-webkit-outer-spin-button,
#modal-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    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: #fff;
    border: 1px solid #f0f0f0;
    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: #333;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

/* 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: #666;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    font-size: 1rem;
    line-height: 1.5;
    white-space: pre-line;
}

.whatsapp-button {
    display: block;
    width: 100%;
    background-color: var(--accent);
    /* ML Blue 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(52, 131, 250, 0.3);
}

.whatsapp-button:hover {
    background-color: var(--accent-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);
    }
}

/* Loader */
.loader {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 768px) {

    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 are open */
    body.filters-open .whatsapp-float,
    body.filters-open .floating-shipping-widget {
        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 */
    }
}

.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;
}

/* Mobile 3-Column Grid */
.product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 0 5px;
}

.product-card {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.card-image {
    height: 110px;
    /* Reduced specific height for mobile */
}

.card-info {
    padding: 6px;
}

.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;
}

/* 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;
}

/* Modal Mobile Fixes */
.modal-content {
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
}

.modal-body {
    padding: 15px;
    gap: 20px;
}

.modal-image-container {
    flex-direction: column-reverse;
    gap: 15px;
    position: static;
}

.thumbnail-list {
    flex-direction: row;
    width: 100%;
    overflow-x: auto;
    padding: 5px 0;
    justify-content: flex-start;
    /* Better for scrolling many items */
    gap: 10px;
    -webkit-overflow-scrolling: touch;
}

.modal-details {
    padding: 10px 5px;
}

.thumbnail {
    flex-shrink: 0;
    width: 55px;
    height: 55px;
}

.main-image {
    height: 500px;
    width: auto;
    /* Let aspect ratio drive width */
    aspect-ratio: 1 / 1;
    /* Force Square */
    margin: 0 auto;
    /* Center in modal */
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

@media (max-width: 768px) {
    .main-image {
        width: 100%;
        /* Full width on mobile */
        height: auto;
        /* Let width drive height */
        aspect-ratio: 1 / 1;
        /* Keep it square */
    }
}



.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: #333333;
    color: #ffffff;
    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: #ffe600;
    /* Yellow 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: #ffe600;
    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: #fff;
    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: #3483fa;
    color: #fff;
}

/* 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 #eee;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    background: #fff;
    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: #333;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.related-card {
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px;
    cursor: pointer;
    transition: box-shadow 0.2s;
    background: #fff;
    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: #333;
    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: #ffe600;
    /* Yellow 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: #fff;
    border-radius: 8px;
    border: 1px solid #eee;
    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: #333;
}

.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 #ddd;
    border-radius: 4px;
    background: #fff;
    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;
}

/* 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: #fff;
        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 #eee;
    }

    .sidebar-header h3 {
        margin: 0;
        font-size: 1.2rem;
    }

    .close-sidebar {
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 10px;
    }

    .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 {
        display: flex;
        flex-wrap: nowrap; /* Forzar en la misma linea */
        align-items: center;
        gap: 10px;
        margin-bottom: 0px; 
        padding: 5px;
        border-radius: 6px;
    }

    .mobile-filter-btn {
        padding: 4px 8px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .header-info {
        display: flex;
        align-items: baseline;
        gap: 5px;
        margin: 0;
        white-space: nowrap;
    }

    .header-info h2 {
        font-size: 1rem; /* Aún más pequeño */
        margin: 0;
    }

    .header-info .product-count {
        font-size: 0.75rem;
        margin: 0;
    }

    .header-controls {
        width: 100%;
        justify-content: space-between;
        margin-top: 5px;
        gap: 5px;
    }

    /* Ocultar etiquetas de subcategorias (filtros activos) en celular para ahorrar espacio */
    .active-filters {
        display: none !important;
    }
}