/* ============================================
   🌟 ULTRA-LIGHTWEIGHT CATEGORY SECTION
   Minimal CSS - Maximum Performance
   ============================================ */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --section-bg: #f8f9fa;
    --card-bg: #ffffff;
    --card-border: #e0e0e0;
    --text-color: #1a1a1a;
    --accent: #ff6b6b;
}

.sublime-navbar.dark-mode ~ .categories-section {
    --section-bg: #1a1a1a;
    --card-bg: #2a2a2a;
    --card-border: #3a3a3a;
    --text-color: #ffffff;
}

/* ============================================
   MAIN SECTION
   ============================================ */
.categories-section {
    padding: 60px 20px 40px 20px;
    background: var(--section-bg);
    max-width: 1400px;
    margin: 0 auto;
}

/* ============================================
   SECTION TITLE
   ============================================ */
.section-title {
    font-size: clamp(40px, 6vw, 64px);
    font-weight: 900;
    color: var(--text-color);
    margin-bottom: 50px;
    text-align: center;
    letter-spacing: -1px;
}

/* ============================================
   CATEGORIES GRID - 3 COLUMNS
   ============================================ */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

/* ============================================
   CATEGORY CARD - MINIMAL STYLING
   ============================================ */
.category-card {
    background: var(--card-bg);
    border-radius: 24px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--card-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Lightweight hover - slight lift + shadow */
.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.category-card:active {
    transform: translateY(-2px);
}

/* ============================================
   PRODUCT IMAGE - SINGLE IMAGE
   ============================================ */
.category-products {
    display: block;
    padding: 0;
    border-radius: 20px 20px 0 0;
    aspect-ratio: 1;
    overflow: hidden;
}

.product-item {
    display: none !important;
}

.product-item:nth-child(2) {
    display: flex !important;
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
}

.product-item:nth-child(2) img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.2s ease;
}

/* Subtle image fade on hover */
.category-card:hover .product-item:nth-child(2) img {
    opacity: 0.9;
}

/* ============================================
   CARD FOOTER - SIMPLE
   ============================================ */
.category-footer {
    padding: 20px 24px;
    background: var(--card-bg);
    border-radius: 0 0 20px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--card-border);
}

/* ============================================
   CATEGORY TITLE - PLAIN TEXT
   ============================================ */
.category-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.5px;
    transition: color 0.2s ease;
}

/* Title color change on hover */
.category-card:hover .category-title {
    color: var(--accent);
}

/* ============================================
   VIEW ALL BUTTON - SIMPLE
   ============================================ */
.view-all-btn {
    padding: 10px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: opacity 0.2s ease;
}

.view-all-btn:hover {
    opacity: 0.9;
}

.view-all-btn:active {
    opacity: 0.7;
}

/* ============================================
   📱 RESPONSIVE BREAKPOINTS
   ============================================ */

/* TABLET: 601px - 900px */
@media (min-width: 601px) and (max-width: 900px) {
    .categories-section {
        padding: 50px 18px 35px 18px;
    }
    
    .section-title {
        font-size: 38px;
        margin-bottom: 40px;
    }
    
    .categories-grid {
        gap: 20px;
    }
    
    .category-footer {
        padding: 16px 18px;
    }
    
    .category-title {
        font-size: 16px;
    }
    
    .view-all-btn {
        padding: 8px 16px;
        font-size: 11px;
    }
}

/* MOBILE: 481px - 600px */
@media (min-width: 481px) and (max-width: 600px) {
    .categories-section {
        padding: 45px 15px 30px 15px;
    }
    
    .section-title {
        font-size: 34px;
        margin-bottom: 35px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .category-card {
        border-radius: 18px;
    }
    
    .category-products {
        border-radius: 18px 18px 0 0;
    }
    
    .category-footer {
        padding: 14px 14px;
        border-radius: 0 0 18px 18px;
    }
    
    .category-title {
        font-size: 14px;
    }
    
    .view-all-btn {
        padding: 7px 14px;
        font-size: 10px;
        gap: 5px;
    }
    
    .view-all-btn svg {
        width: 13px;
        height: 13px;
    }
}

/* MOBILE: Below 480px */
@media (max-width: 480px) {
    .categories-section {
        padding: 25px 12px 20px 12px;
    }
    
    .section-title {
        font-size: 32px;
        margin-bottom: 18px;
        letter-spacing: -1.5px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .category-card {
        border-radius: 20px;
    }
    
    .category-products {
        border-radius: 20px 20px 0 0;
        aspect-ratio: 0.65;
        min-height: 140px;
    }
    
    /* Show FIRST image on mobile */
    .product-item {
        display: none !important;
    }
    
    .product-item:first-child {
        display: flex !important;
        width: 100%;
        height: 100%;
    }
    
    .product-item:first-child img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .category-footer {
        padding: 16px 12px;
        flex-direction: column;
        gap: 0;
        border-radius: 0 0 20px 20px;
    }
    
    .view-all-btn {
        display: none !important;
    }
    
    .category-title {
        font-size: 16px;
        font-weight: 900;
        text-align: center;
        width: 100%;
        letter-spacing: -0.4px;
        line-height: 1.3;
    }
    
    /* Mobile tap feedback */
    .category-card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}

/* SMALLER MOBILE: 361px - 400px */
@media (max-width: 400px) {
    .categories-section {
        padding: 22px 10px 18px 10px;
    }
    
    .section-title {
        font-size: 30px;
        margin-bottom: 16px;
    }
    
    .categories-grid {
        gap: 10px;
    }
    
    .category-card {
        border-radius: 18px;
    }
    
    .category-products {
        border-radius: 18px 18px 0 0;
        min-height: 120px;
    }
    
    .category-footer {
        padding: 14px 10px;
        border-radius: 0 0 18px 18px;
    }
    
    .category-title {
        font-size: 14px;
        font-weight: 800;
    }
}

/* ULTRA TINY: Below 360px */
@media (max-width: 360px) {
    .categories-section {
        padding: 20px 8px 16px 8px;
    }
    
    .section-title {
        font-size: 28px;
        margin-bottom: 14px;
    }
    
    .categories-grid {
        gap: 9px;
    }
    
    .category-card {
        border-radius: 16px;
    }
    
    .category-products {
        border-radius: 16px 16px 0 0;
        min-height: 110px;
    }
    
    .category-footer {
        padding: 13px 8px;
        border-radius: 0 0 16px 16px;
    }
    
    .category-title {
        font-size: 13px;
    }
}

/* ============================================
   💻 LAPTOP / DESKTOP OPTIMIZATION
   ============================================ */
@media (min-width: 1024px) {
    .categories-section {
        max-width: 1200px;
        padding: 40px 20px 30px;
    }

    .categories-section .section-title {
        font-size: clamp(34px, 4.5vw, 50px) !important;
        margin-bottom: 40px;
        letter-spacing: -2px;
    }

    .categories-grid {
        gap: 20px;
    }

    .category-card {
        border-radius: 20px;
    }

    .category-products {
        aspect-ratio: 0.85;
    }

    .category-footer {
        padding: 14px 18px;
    }

    .category-title {
        font-size: 16px;
    }

    .view-all-btn {
        padding: 8px 16px;
        font-size: 11px;
        letter-spacing: 0.8px;
    }
}
/* ── Palette fix — replace red with navy×yellow ── */
:root {
    --section-bg: #f5f5f5;
    --card-bg: #ffffff;
    --card-border: #e8e8e8;
    --text-color: #1a1a1a;
    --accent: #141E30;        /* navy instead of red */
    --accent-hover: #243B55;
    --btn-color: #F8D800;     /* yellow for button */
}

/* Dark mode — fix sibling selector to body.dark-mode */
body.dark-mode .categories-section {
    --section-bg: #1a1a1a;
    --card-bg: #242424;
    --card-border: #333;
    --text-color: #e0e0e0;
    --accent: #F8D800;
    --btn-color: #141E30;
}

/* Remove the old sibling selector */
.sublime-navbar.dark-mode ~ .categories-section {
    all: unset;
}

/* ── Section title — match DM Sans style ── */
.section-title {
    font-family: 'DM Sans', system-ui, sans-serif !important;
    font-weight: 900 !important;
    color: var(--text-color) !important;
    position: relative !important;
    display: inline-block !important;
    width: 100% !important;
    text-align: center !important;
}

/* Gold underline accent under title */
.section-title::after {
    content: '' !important;
    display: block !important;
    width: 48px !important;
    height: 3px !important;
    background: linear-gradient(90deg, #141E30, #F8D800) !important;
    border-radius: 2px !important;
    margin: 12px auto 0 !important;
}

body.dark-mode .section-title::after {
    background: linear-gradient(90deg, #F8D800, #FFB300) !important;
}

/* ── Card hover — navy instead of lift only ── */
.category-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 8px 24px rgba(20,30,48,0.12) !important;
    border-color: rgba(20,30,48,0.20) !important;
}

body.dark-mode .category-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.35) !important;
    border-color: rgba(248,216,0,0.20) !important;
}

/* ── Category title hover — navy instead of red ── */
.category-card:hover .category-title {
    color: #141E30 !important;
}

body.dark-mode .category-card:hover .category-title {
    color: #F8D800 !important;
}

/* ── View All button — navy bg, yellow text ── */
.view-all-btn {
    background: linear-gradient(to right, #141E30 50%, #243B55 50%) !important;
    background-size: 200% 100% !important;
    background-position: right center !important;
    color: #ffffff !important;
    border: none !important;
    font-family: 'DM Sans', system-ui, sans-serif !important;
    transition: background-position 0.32s cubic-bezier(0.4,0,0.2,1),
                box-shadow 0.2s ease !important;
}

.view-all-btn:hover {
    background-position: left center !important;
    opacity: 1 !important;
    box-shadow: 0 4px 14px rgba(20,30,48,0.25) !important;
}

body.dark-mode .view-all-btn {
    background: linear-gradient(to right, #F8D800 50%, #FFB300 50%) !important;
    background-size: 200% 100% !important;
    background-position: right center !important;
    color: #141E30 !important;
}

body.dark-mode .view-all-btn:hover {
    box-shadow: 0 4px 14px rgba(248,216,0,0.25) !important;
}

/* ── Category footer border ── */
.category-footer {
    border-top: 1px solid var(--card-border) !important;
    font-family: 'DM Sans', system-ui, sans-serif !important;
}

/* ── Category title font ── */
.category-title {
    font-family: 'DM Sans', system-ui, sans-serif !important;
}