/* ============================================
   CATEGORIES - HERO-STYLE PREMIUM BACKGROUND
   Spinny Energy + Apple Smoothness
   ============================================ */

.home-categories {
    padding: 60px 0 70px;
    position: relative;
    overflow: hidden;
    
    /* HERO-STYLE GRADIENT BACKGROUND */
    background: radial-gradient(120% 120% at 55% 0%, #1E3A8A 0%, #0F172A 45%, #090D16 100%);
    border-top: 1px solid rgba(255, 183, 3, 0.15);
    border-bottom: 1px solid rgba(255, 183, 3, 0.15);
    
    /* Subtle glass effect overlay */
    isolation: isolate;
}

/* ============================================
   AMBIENT GLOW - HERO INSPIRED
============================================ */
.home-categories::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255, 42, 0, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 183, 3, 0.10) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(37, 99, 235, 0.08) 0%, transparent 60%);
    filter: blur(60px);
    pointer-events: none;
    animation: categoryGlow 8s ease-in-out infinite alternate;
    z-index: 0;
}

@keyframes categoryGlow {
    0%   { opacity: 0.6; transform: scale(1) rotate(0deg); }
    100% { opacity: 1; transform: scale(1.1) rotate(5deg); }
}

/* ============================================
   FLOATING PARTICLES - HERO INSPIRED
============================================ */
.home-categories::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(2px 2px at 10% 20%, rgba(255, 183, 3, 0.15), transparent),
        radial-gradient(2px 2px at 30% 60%, rgba(255, 42, 0, 0.10), transparent),
        radial-gradient(2px 2px at 50% 10%, rgba(255, 183, 3, 0.12), transparent),
        radial-gradient(2px 2px at 70% 80%, rgba(255, 42, 0, 0.08), transparent),
        radial-gradient(2px 2px at 90% 30%, rgba(255, 183, 3, 0.14), transparent),
        radial-gradient(2px 2px at 15% 90%, rgba(37, 99, 235, 0.10), transparent),
        radial-gradient(2px 2px at 85% 50%, rgba(255, 183, 3, 0.11), transparent);
    background-size: 200px 200px;
    pointer-events: none;
    z-index: 0;
    animation: particleDrift 20s linear infinite;
}

@keyframes particleDrift {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-20px, -20px) rotate(360deg); }
}

/* ============================================
   SECTION WRAPPER - CONTENT ABOVE GLOW
============================================ */
.home-categories .container {
    position: relative;
    z-index: 1;
}

/* ============================================
   SECTION TITLE - GLOW TEXT
============================================ */
.section-title {
    text-align: center;
    margin-bottom: 28px;
    padding: 0 16px;
}

.section-title span {
    display: inline-block;
    background: rgba(255, 183, 3, 0.12);
    border: 1px solid rgba(255, 183, 3, 0.25);
    color: #FFB703;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 4px 16px;
    border-radius: 9999px;
    margin-bottom: 8px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.section-title h2 {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: clamp(1.4rem, 5vw, 2rem);
    font-weight: 800;
    color: #FFFFFF;
    letter-spacing: -0.5px;
    line-height: 1.15;
    margin-bottom: 6px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.section-title h2 .highlight {
    background: linear-gradient(135deg, #FFB703 0%, #FF2A00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-title p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    max-width: 320px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ============================================
   CATEGORY GRID - MOBILE FIRST (3 columns)
============================================ */
.category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 10px;
    padding: 0 12px;
}

/* ============================================
   CATEGORY CARD - GLASSMORPHISM
============================================ */
.category-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 183, 3, 0.20);
    border-radius: 20px;
    padding: 16px 8px 14px;
    overflow: visible;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    cursor: pointer;
    
    /* Scroll Animation */
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.category-card.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.category-card:active {
    transform: scale(0.94);
    background: rgba(255, 255, 255, 0.08);
}

/* Hover effect - Apple smooth with Gold Glow */
.category-card:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 183, 3, 0.55);
    box-shadow: 
        0 12px 36px rgba(0, 0, 0, 0.35),
        0 0 30px rgba(255, 183, 3, 0.18);
    transform: translateY(-4px) scale(1.02);
}

/* ============================================
   IMAGE - Perfect Circle with Glow
============================================ */
.category-image {
    width: 100%;
    max-width: 110px;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
    margin: 0 auto 10px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 2px solid rgba(255, 255, 255, 0.08);
}

/* Glow ring around image - Hero inspired */
.category-image::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255, 183, 3, 0.2), rgba(255, 42, 0, 0.2));
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
    filter: blur(8px);
}

.category-card:hover .category-image::before {
    opacity: 1;
}

.category-card:active .category-image {
    transform: scale(0.94);
    border-color: rgba(255, 183, 3, 0.3);
}

.category-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.category-card:hover .category-image img {
    transform: scale(1.06);
}

/* ============================================
   FALLBACK ICON - Glowing
============================================ */
.fallback-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    background: radial-gradient(circle at 30% 30%, rgba(255, 183, 3, 0.1), rgba(255, 42, 0, 0.05));
    color: #FFB703;
    border-radius: 50%;
    text-shadow: 0 0 20px rgba(255, 183, 3, 0.3);
}

/* ============================================
   CATEGORY BADGE - Premium
============================================ */
.category-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 0.6rem;
    padding: 4px 8px;
    border-radius: 9999px;
    z-index: 2;
    border: 2px solid rgba(9, 13, 22, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.category-badge.popular {
    background: linear-gradient(135deg, #FF2A00, #F59E0B);
    color: #FFFFFF;
}

.category-badge.new {
    background: linear-gradient(135deg, #2563EB, #06B6D4);
    color: #FFFFFF;
}

.category-badge.sale {
    background: linear-gradient(135deg, #FFB703, #FF2A00);
    color: #FFFFFF;
}

/* ============================================
   CONTENT - White Text
============================================ */
.category-content {
    padding: 0 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.category-content h3 {
    font-family: 'Outfit', 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.2;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.category-desc {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 3px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
}

.count {
    font-size: 0.6rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    gap: 3px;
}

.count .arrow {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 0.6rem;
    color: #FFB703;
}

.category-card:hover .count .arrow {
    transform: translateX(4px);
}

.category-card:active .count .arrow {
    transform: translateX(2px);
}

/* ============================================
   VIEW ALL BUTTON - Glowing
============================================ */
.category-footer {
    text-align: center;
    margin-top: 32px;
    padding: 0 16px;
}

.view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--navy, #090D16);
    font-weight: 800;
    font-size: 0.95rem;
    font-family: var(--font-heading, 'Outfit', sans-serif);
    padding: 12px 32px;
    border: none;
    border-radius: 9999px;
    background: var(--grad-flame, linear-gradient(135deg, #FF2A00 0%, #F59E0B 50%, #FFB703 100%));
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    box-shadow: 0 6px 24px rgba(255, 183, 3, 0.35);
}

.view-all-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 32px rgba(255, 42, 0, 0.45);
}

.view-all-btn:active {
    transform: scale(0.97);
}

.view-all-btn .arrow {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.view-all-btn:hover .arrow {
    transform: translateX(4px);
}

.view-all-btn:active .arrow {
    transform: translateX(2px);
}

/* ============================================
   SHIMMER LOADING EFFECT - Dark
============================================ */
@keyframes shimmerDark {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.category-image.loading {
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
    animation: shimmerDark 1.5s infinite;
}

/* ============================================
   EMPTY STATE - Dark
============================================ */
.category-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.08);
}

/* ============================================
   RESPONSIVE - TABLET (4 columns)
============================================ */
@media (min-width: 640px) {
    .home-categories {
        padding: 70px 0 80px;
    }
    
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px 16px;
        padding: 0 16px;
    }
    
    .category-card {
        padding: 20px 12px 18px;
    }
    
    .category-image {
        max-width: 130px;
    }
    
    .category-content h3 {
        font-size: 0.9rem;
    }
    
    .category-desc {
        font-size: 0.65rem;
    }
    
    .count {
        font-size: 0.7rem;
    }
    
    .section-title p {
        font-size: 0.95rem;
        max-width: 420px;
    }
}

/* ============================================
   RESPONSIVE - DESKTOP (6 columns)
============================================ */
@media (min-width: 1024px) {
    .home-categories {
        padding: 80px 0 90px;
    }
    
    .section-title {
        margin-bottom: 40px;
    }
    
    .section-title h2 {
        font-size: clamp(2rem, 3vw, 2.6rem);
    }
    
    .section-title p {
        font-size: 0.97rem;
        max-width: 480px;
    }
    
    .category-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 24px;
        padding: 0;
    }
    
    .category-card {
        padding: 24px 14px 20px;
        border-radius: 24px;
        border: 1px solid rgba(255, 255, 255, 0.06);
    }
    
    .category-image {
        max-width: 150px;
        border-width: 3px;
    }
    
    /* Desktop Hover Effects - Premium */
    .category-card:hover {
        transform: translateY(-8px) scale(1.02);
        background: rgba(255, 255, 255, 0.08);
        border-color: rgba(255, 183, 3, 0.2);
        box-shadow: 
            0 20px 60px rgba(0, 0, 0, 0.4),
            0 0 60px rgba(255, 183, 3, 0.06);
    }
    
    .category-card:hover .category-image {
        box-shadow: 
            0 12px 40px rgba(0, 0, 0, 0.4),
            0 0 40px rgba(255, 183, 3, 0.1);
        transform: translateY(-6px);
    }
    
    .category-card:hover .category-image img {
        transform: scale(1.08);
    }
    
    .category-card:hover .count .arrow {
        transform: translateX(6px);
    }
    
    .category-content h3 {
        font-size: 1rem;
    }
    
    .category-desc {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
    }
    
    .count {
        font-size: 0.75rem;
    }
    
    .category-footer {
        margin-top: 52px;
    }
    
    .view-all-btn {
        font-size: 1rem;
        padding: 14px 40px;
        border-width: 2px;
        border-color: rgba(255, 183, 3, 0.4);
    }
    
    .view-all-btn:hover {
        background: linear-gradient(135deg, rgba(255, 183, 3, 0.15), rgba(255, 42, 0, 0.1));
        border-color: #FFB703;
        box-shadow: 
            0 8px 32px rgba(255, 183, 3, 0.2),
            inset 0 1px 0 rgba(255, 183, 3, 0.1);
        transform: translateY(-2px);
    }
    
    .view-all-btn:hover .arrow {
        transform: translateX(6px);
    }
}

/* ============================================
   RESPONSIVE - SMALL PHONES
============================================ */
@media (max-width: 420px) {
    .home-categories {
        padding: 40px 0 50px;
    }
    
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px 8px;
        padding: 0 8px;
    }
    
    .category-card {
        padding: 12px 6px 10px;
        border-radius: 16px;
    }
    
    .section-title {
        padding: 0 12px;
        margin-bottom: 20px;
    }
    
    .section-title h2 {
        font-size: 1.2rem;
    }
    
    .category-image {
        max-width: 80px;
        border-width: 1.5px;
    }
    
    .category-content h3 {
        font-size: 0.7rem;
    }
    
    .category-desc {
        font-size: 0.5rem;
        -webkit-line-clamp: 1;
    }
    
    .count {
        font-size: 0.55rem;
    }
    
    .fallback-icon {
        font-size: 2rem;
    }
    
    .category-badge {
        font-size: 0.45rem;
        padding: 2px 6px;
        top: -3px;
        right: -3px;
        border-width: 1.5px;
    }
    
    .view-all-btn {
        font-size: 0.8rem;
        padding: 10px 20px;
    }
    
    /* Adjust glow for small screens */
    .home-categories::before {
        filter: blur(40px);
    }
}

/* ============================================
   ACCESSIBILITY - Reduced Motion
============================================ */
@media (prefers-reduced-motion: reduce) {
    .home-categories::before,
    .home-categories::after {
        animation: none !important;
    }
    
    .category-card {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    
    .category-card:hover {
        transform: none !important;
    }
    
    .category-image img,
    .category-image::before,
    .count .arrow {
        transition: none !important;
    }
    
    .view-all-btn .arrow {
        transition: none !important;
    }
}

/* ============================================
   PRINT STYLES
============================================ */
@media print {
    .home-categories {
        background: white !important;
        border: 1px solid #ddd !important;
        padding: 30px 0 !important;
    }
    
    .home-categories::before,
    .home-categories::after {
        display: none !important;
    }
    
    .category-card {
        background: white !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .category-content h3 {
        color: #000 !important;
    }
    
    .section-title h2 {
        color: #000 !important;
    }
    
    .section-title h2 .highlight {
        background: none !important;
        -webkit-text-fill-color: #000 !important;
        color: #000 !important;
    }
}