/* ===================================
   CATEGORY CARDS SECTION
   Horizontal scrollable category cards
   =================================== */

.category-cards-section {
    padding: 3rem 0;
    background: var(--bg-primary);
}

.category-cards-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 3rem;
}

.category-cards-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    /* Centers items vertically */
    gap: 1rem;
}

/* Navigation Arrow Button */
.category-nav-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #a3e635 0%, #4ade80 100%);
    border: none;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(163, 230, 53, 0.25);
    align-self: center;
    position: relative;
    overflow: hidden;
}

/* Shine effect on hover */
.category-nav-btn::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    transform: rotate(45deg);
    transition: all 0.5s ease;
}

.category-nav-btn:hover::before {
    left: 100%;
}

.category-nav-btn:hover {
    background: linear-gradient(135deg, #bef264 0%, #86efac 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(163, 230, 53, 0.4);
}

.category-nav-btn:active {
    transform: scale(0.95);
}

.category-nav-btn i {
    font-size: 1rem;
    color: #14532d;
    font-weight: 600;
    z-index: 1;
}

/* Horizontal Scroll Container */
.category-cards-scroll {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 1rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* Firefox */
}

.category-cards-scroll::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Edge */
}

/* Individual Category Card */
.category-card {
    flex: 0 0 auto;
    width: 160px;
    background: linear-gradient(145deg, var(--card-bg) 0%, rgba(99, 102, 241, 0.02) 100%);
    border-radius: 20px;
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid rgba(99, 102, 241, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.5s;
}

.category-card:hover::before {
    left: 100%;
}

.category-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.25), 0 4px 8px rgba(99, 102, 241, 0.15);
    background: linear-gradient(145deg, var(--card-bg) 0%, rgba(99, 102, 241, 0.05) 100%);
}

/* Category Icon/Image */
.category-card-icon {
    width: 85px;
    height: 85px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    overflow: visible;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(74, 222, 128, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
}

.category-card-icon::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #4ade80, #6366f1);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s;
}

.category-card:hover .category-card-icon {
    background: linear-gradient(135deg, #6366f1 0%, #4ade80 100%);
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35), 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.category-card:hover .category-card-icon::after {
    opacity: 1;
    animation: rotate 3s linear infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

.category-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Font Awesome icon styling */
.category-card-icon i {
    font-size: 2.75rem;
    background: linear-gradient(135deg, #6366f1 0%, #4ade80 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.4s ease;
    filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.2));
}

.category-card:hover .category-card-icon i {
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
    transform: scale(1.2);
    filter: drop-shadow(0 4px 8px rgba(255, 255, 255, 0.3));
    animation: iconBounce 0.6s ease-in-out;
}

@keyframes iconBounce {

    0%,
    100% {
        transform: scale(1.2);
    }

    50% {
        transform: scale(1.3);
    }
}

/* Highlight effect for product cards when navigated to */
.product-card.highlight-card {
    animation: highlightPulse 2s ease-in-out;
    transform: scale(1.05);
}

@keyframes highlightPulse {

    0%,
    100% {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4), 0 0 0 4px rgba(99, 102, 241, 0.2);
        transform: scale(1.02);
    }
}

/* Pulse animation for icons */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1.1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* Category Name */
.category-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

/* Category Subtitle/Description */
.category-card-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.2;
}

/* See All Button Card */
.category-card.see-all {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
}

.category-card.see-all:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.category-card.see-all i {
    font-size: 2rem;
    color: #ffffff;
}

.category-card.see-all .category-card-name {
    color: #ffffff;
    font-size: 1.1rem;
}

.category-card.see-all .arrow-icon {
    font-size: 1.5rem;
    color: #ffffff;
    margin-top: 0.5rem;
}

/* Dark Mode Support */
[data-theme="dark"] .category-card {
    background: var(--card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .category-card:hover {
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
}

[data-theme="dark"] .category-card-icon {
    background: var(--bg-secondary);
}

/* Responsive Design */
@media (max-width: 768px) {
    .category-cards-section {
        padding: 2rem 0;
    }

    .category-cards-container {
        padding: 0 1rem;
    }

    .category-cards-scroll {
        gap: 1rem;
    }

    .category-nav-btn {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .category-nav-btn i {
        font-size: 0.9rem;
    }

    .category-card {
        width: 140px;
        padding: 1.25rem 0.75rem;
    }

    .category-card-icon {
        width: 70px;
        height: 70px;
    }

    .category-card-name {
        font-size: 0.9rem;
    }

    .category-card-subtitle {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .category-cards-section {
        padding: 1.5rem 0;
    }

    .category-cards-scroll {
        gap: 0.75rem;
    }

    .category-nav-btn {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }

    .category-nav-btn i {
        font-size: 0.85rem;
    }

    .category-card {
        width: 120px;
        padding: 1rem 0.5rem;
    }

    .category-card-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 0.75rem;
    }

    .category-card-icon i {
        font-size: 2rem;
    }

    .category-card-name {
        font-size: 0.85rem;
    }

    .category-card-subtitle {
        font-size: 0.7rem;
    }

    .category-card.see-all i {
        font-size: 1.5rem;
    }

    .category-card.see-all .category-card-name {
        font-size: 0.95rem;
    }
}

/* Smooth scroll snap for better UX on mobile */
@media (max-width: 768px) {
    .category-cards-scroll {
        scroll-snap-type: x proximity;
    }

    .category-card {
        scroll-snap-align: start;
    }
}