/**
 * Top Categories Carousel Styles
 * 
 * Styles for the top-level categories carousel shortcode
 * with circular category icons.
 * 
 * @package merida-theme
 */

/* CSS Variables - Top Categories Carousel */
:root {
    --tcc-primary-color: #007cba;
    --tcc-text-color: #333;
    --tcc-border-color: #DADADA;
    --tcc-border-hover: #007cba;
    --tcc-bg-white: #ffffff;
    --tcc-shadow-base: rgba(0, 0, 0, 0.08);
    --tcc-shadow-hover: rgba(0, 124, 186, 0.15);
    --tcc-shadow-arrow: rgba(0, 124, 186, 0.2);
    --tcc-arrow-bg: rgba(255, 255, 255, 0.95);
    --tcc-arrow-border: #e9ecef;
}

/* Base carousel styles inherit from universal-product-carousel.css */
/* This file adds specific styles for circular icon display */

/* Container adjustments for top categories carousel */
.merida-top-categories-carousel {
    margin: 30px 0;
    padding: 20px 0;
    overflow: visible !important;
    /* Override base overflow: hidden */
    position: relative;
    /* For gradient and arrow positioning */
}

.merida-top-categories-carousel h3 {
    margin-bottom: 20px;
    font-size: 34px;
    font-weight: 700;
    color: var(--tcc-text-color);
    text-align: left;
}

/* Category item wrapper */
.merida-top-categories-carousel .category-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
    min-width: 100px;
    max-width: 120px;
    text-align: center;
}

.merida-top-categories-carousel .category-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    padding: 10px;
    transition: all 0.3s ease;
    height: 100%;
}

.merida-top-categories-carousel .category-link:hover {
    transform: translateY(-3px);
}

/* Circular icon container - KEY STYLES */
.merida-top-categories-carousel .category-icon-circle {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tcc-bg-white);
    border: 1px solid var(--tcc-border-color);
    margin-bottom: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--tcc-shadow-base);
}

.merida-top-categories-carousel .category-link:hover .category-icon-circle {
    border-color: var(--tcc-border-hover);
    box-shadow: 0 4px 12px var(--tcc-shadow-hover);
    transform: scale(1.05);
}

/* Icon image inside circle */
.merida-top-categories-carousel .category-icon-circle img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
}

/* Category name styling */
.merida-top-categories-carousel .category-name {
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    line-height: 1.3;
    color: var(--tcc-text-color);
    word-wrap: break-word;
    display: block;
    max-width: 100%;
}

.merida-top-categories-carousel .category-link:hover .category-name {
    color: var(--tcc-primary-color);
    text-decoration: underline;
}

/* Track/carousel container adjustments */
.merida-top-categories-carousel .merida-carousel-track.categories {
    gap: 16px;
    padding: 20px 16px 20px 64px;
    /* Left: 48px (arrow+gap) + 16px (start space), Right: 16px (for gradient) */
    margin-left: 48px;
    /* Space for arrow (40px) + gap (8px) */
    margin-right: 48px;
    /* Space for arrow (40px) + gap (8px) */
}

/* Left gradient blend - positioned on container level, below heading */
.merida-top-categories-carousel::before {
    content: '';
    position: absolute;
    left: 32px;
    /* After arrow space, adjusted to not overlap first item */
    top: 74px;
    /* After heading (34px + 20px margin-bottom + ~20px) */
    bottom: 0;
    width: 24px;
    height: 100%;
    background: linear-gradient(to right, white 0%, rgba(255, 255, 255, 0.1) 100%);
    filter: blur(12px);
    z-index: 2;
    pointer-events: none;
}

/* Right gradient blend - positioned on container level, below heading */
.merida-top-categories-carousel::after {
    content: '';
    position: absolute;
    right: 32px;
    /* Before arrow space */
    top: 74px;
    /* After heading (34px + 20px margin-bottom + ~20px) */
    bottom: 0;
    width: 24px;
    background: linear-gradient(to left, white 0%, rgba(255, 255, 255, 0.1) 100%);
    filter: blur(12px);
    z-index: 2;
    pointer-events: none;
}

/* Navigation arrows - match existing carousel style */
.merida-top-categories-carousel .merida-carousel-arrow {
    position: absolute;
    top: 165px;
    /* Perfectly centered with circles (desktop) */
    background-color: var(--tcc-arrow-bg);
    border: 1px solid var(--tcc-arrow-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    padding: 0;
    margin: 0;
}

.merida-top-categories-carousel .merida-carousel-arrow:hover {
    background-color: var(--tcc-bg-white);
    border-color: var(--tcc-border-hover);
    box-shadow: 0 2px 8px var(--tcc-shadow-arrow);
}

.merida-top-categories-carousel .merida-carousel-arrow .merida-carousel-icon {
    width: 20px;
    height: 20px;
    filter: invert(0.4);
    transition: filter 0.3s ease;
}

.merida-top-categories-carousel .merida-carousel-arrow:hover .merida-carousel-icon {
    filter: invert(0.2);
}

.merida-top-categories-carousel .merida-carousel-prev {
    left: 8px;
    /* 8px gap from edge */
}

.merida-top-categories-carousel .merida-carousel-next {
    right: 8px;
    /* 8px gap from edge */
}

/* Responsive Design - Tablet */
@media (max-width: 991px) {
    .merida-top-categories-carousel h3 {
        font-size: 30px;
        font-weight: 700;
        margin-bottom: 16px;
    }

    /* Adjust gradient top position for tablet */
    .merida-top-categories-carousel::before,
    .merida-top-categories-carousel::after {
        top: 66px;
        /* 30px + 16px + ~20px */
    }

    /* Adjust arrow vertical position for tablet */
    .merida-top-categories-carousel .merida-carousel-arrow {
        top: 151px;
        /* Perfectly centered with circles */
    }

    .merida-top-categories-carousel .category-item {
        min-width: 90px;
        max-width: 110px;
    }

    .merida-top-categories-carousel .category-icon-circle {
        width: 80px;
        height: 80px;
        margin-bottom: 10px;
    }

    .merida-top-categories-carousel .category-icon-circle img {
        width: 22px;
        height: 22px;
    }

    .merida-top-categories-carousel .category-name {
        font-size: 12px;
    }
}

/* Responsive Design - Mobile */
@media (max-width: 767px) {
    .merida-top-categories-carousel {
        margin: 20px 0;
        padding: 15px 0;
    }

    .merida-top-categories-carousel h3 {
        font-size: 26px;
        font-weight: 700;
        margin-bottom: 14px;
    }

    /* Adjust gradient top position for mobile */
    .merida-top-categories-carousel::before,
    .merida-top-categories-carousel::after {
        top: 60px;
        /* 26px + 14px + ~20px */
    }

    /* Adjust arrow vertical position for mobile */
    .merida-top-categories-carousel .merida-carousel-arrow {
        top: 133px;
        /* Perfectly centered with circles */
    }

    .merida-top-categories-carousel .merida-carousel-track.categories {
        padding: 20px 12px 20px 12px;
        margin-left: 44px;
        /* Space for arrow (36px) + gap (8px) */
        margin-right: 44px;
        gap: 12px;
    }

    /* Adjust gradient position and width on mobile */
    .merida-top-categories-carousel::before {
        left: 44px;
        width: 24px;
    }

    .merida-top-categories-carousel::after {
        right: 44px;
        width: 24px;
    }

    .merida-top-categories-carousel .category-item {
        min-width: 80px;
        max-width: 95px;
    }

    .merida-top-categories-carousel .category-link {
        padding: 8px;
    }

    /* Smaller circular icons on mobile */
    .merida-top-categories-carousel .category-icon-circle {
        width: 70px;
        height: 70px;
        margin-bottom: 8px;
    }

    .merida-top-categories-carousel .category-icon-circle img {
        width: 20px;
        height: 20px;
    }

    .merida-top-categories-carousel .category-name {
        font-size: 11px;
        line-height: 1.2;
    }

    /* Smaller navigation arrows on mobile */
    .merida-top-categories-carousel .merida-carousel-arrow {
        width: 36px;
        height: 36px;
        /* top already adjusted above */
    }

    .merida-top-categories-carousel .merida-carousel-arrow .merida-carousel-icon {
        width: 18px;
        height: 18px;
    }

    .merida-top-categories-carousel .merida-carousel-prev {
        left: 6px;
        /* 6px gap on mobile */
    }

    .merida-top-categories-carousel .merida-carousel-next {
        right: 6px;
        /* 6px gap on mobile */
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .merida-top-categories-carousel .merida-carousel-track.categories {
        padding: 18px 10px 18px 10px;
        margin-left: 42px;
        /* Space for arrow (36px) + gap (6px) */
        margin-right: 42px;
        gap: 10px;
    }

    /* Adjust gradient position and width on extra small screens */
    .merida-top-categories-carousel::before {
        left: 42px;
        width: 20px;
    }

    .merida-top-categories-carousel::after {
        right: 42px;
        width: 20px;
    }

    /* Adjust arrow vertical position for extra small screens */
    .merida-top-categories-carousel .merida-carousel-arrow {
        top: 124px;
        /* Perfectly centered with circles */
    }

    .merida-top-categories-carousel .category-item {
        min-width: 70px;
        max-width: 85px;
    }

    .merida-top-categories-carousel .category-icon-circle {
        width: 64px;
        height: 64px;
    }

    .merida-top-categories-carousel .category-icon-circle img {
        width: 18px;
        height: 18px;
    }
}