/*
 * Category Showcase widget. Replaces a stale stylesheet (it forced a
 * four-column grid onto the widget root) and the <style> block the widget JS
 * appended to <head> with global selectors. Scoped to the widget root;
 * :where() keeps specificity low so the Columns and style controls win.
 */
:where(.flavor-category-showcase-wrapper) {
    width: 100%;
}

:where(.flavor-category-showcase-wrapper) .category-showcase-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

:where(.flavor-category-showcase-wrapper) .category-item {
    position: relative;
    transition: all 0.3s ease;
}

:where(.flavor-category-showcase-wrapper) .category-link {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

:where(.flavor-category-showcase-wrapper) .category-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
    pointer-events: none;
}

:where(.flavor-category-showcase-wrapper) .category-link:hover::before {
    left: 100%;
}

:where(.flavor-category-showcase-wrapper) .category-link:hover {
    text-decoration: none;
    color: inherit;
}

:where(.flavor-category-showcase-wrapper) .category-image {
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: 10px;
}

:where(.flavor-category-showcase-wrapper) .category-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    transition: all 0.3s ease;
}

:where(.flavor-category-showcase-wrapper) .category-icon {
    font-size: 32px;
    color: var(--e-global-color-accent, #007cba);
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

:where(.flavor-category-showcase-wrapper) .category-icon svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

:where(.flavor-category-showcase-wrapper) .category-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

:where(.flavor-category-showcase-wrapper) .category-title {
    font-size: 20px;
    font-weight: 600;
    color: #333333;
    margin: 0 0 15px 0;
    line-height: 1.3;
    transition: all 0.3s ease;
}

:where(.flavor-category-showcase-wrapper) .category-description {
    font-size: 14px;
    color: #666666;
    line-height: 1.6;
    margin: 0 0 15px 0;
    text-align: center;
}

:where(.flavor-category-showcase-wrapper) .category-count {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #999999;
    margin-top: auto;
}

:where(.flavor-category-showcase-wrapper) .count-number {
    font-weight: 600;
    color: var(--e-global-color-accent, #007cba);
    font-size: 16px;
}

:where(.flavor-category-showcase-wrapper) .count-text {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hover animation classes (CSS fallback when GSAP is absent). */
:where(.flavor-category-showcase-wrapper) .hover-lift {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

:where(.flavor-category-showcase-wrapper) .hover-scale {
    transform: scale(1.05);
}

:where(.flavor-category-showcase-wrapper) .hover-tilt {
    transform: perspective(1000px) rotateY(5deg) rotateX(2deg);
}

:where(.flavor-category-showcase-wrapper) .hover-glow {
    box-shadow: 0 0 30px rgba(0, 124, 186, 0.4);
}

:where(.flavor-category-showcase-wrapper) .hover-glow .category-title {
    text-shadow: 0 0 10px currentColor;
}

:where(.flavor-category-showcase-wrapper) .animate-fadeIn {
    animation: flavorCategoryFadeIn 0.8s ease-out;
}

@keyframes flavorCategoryFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

:where(.flavor-category-showcase-wrapper) .animate-slideUp {
    animation: flavorCategorySlideUp 0.8s ease-out;
}

@keyframes flavorCategorySlideUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

:where(.flavor-category-showcase-wrapper) .animate-zoomIn {
    animation: flavorCategoryZoomIn 0.8s ease-out;
}

@keyframes flavorCategoryZoomIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

:where(.flavor-category-showcase-wrapper) .animate-flipIn {
    animation: flavorCategoryFlipIn 0.8s ease-out;
}

@keyframes flavorCategoryFlipIn {
    from { opacity: 0; transform: rotateY(90deg); }
    to { opacity: 1; transform: rotateY(0); }
}

@media (max-width: 768px) {
    :where(.flavor-category-showcase-wrapper) .category-link {
        padding: 25px;
    }

    :where(.flavor-category-showcase-wrapper) .category-icon {
        font-size: 28px;
    }

    :where(.flavor-category-showcase-wrapper) .category-title {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    :where(.flavor-category-showcase-wrapper) .category-link {
        padding: 20px;
    }

    :where(.flavor-category-showcase-wrapper) .category-icon {
        font-size: 24px;
        margin-bottom: 15px;
    }

    :where(.flavor-category-showcase-wrapper) .category-title {
        font-size: 16px;
        margin-bottom: 10px;
    }

    :where(.flavor-category-showcase-wrapper) .category-description {
        font-size: 13px;
        margin-bottom: 10px;
    }
}

:where(.flavor-category-showcase-wrapper) .category-link:focus-visible {
    outline: 2px solid var(--e-global-color-accent, #007cba);
    outline-offset: 2px;
}

@media (prefers-contrast: high) {
    :where(.flavor-category-showcase-wrapper) .category-link {
        border: 2px solid #000000;
    }

    :where(.flavor-category-showcase-wrapper) .category-title,
    :where(.flavor-category-showcase-wrapper) .category-description,
    :where(.flavor-category-showcase-wrapper) .category-icon {
        color: #000000;
    }
}

@media (prefers-reduced-motion: reduce) {
    :where(.flavor-category-showcase-wrapper) .category-item,
    :where(.flavor-category-showcase-wrapper) .category-link,
    :where(.flavor-category-showcase-wrapper) .category-image img,
    :where(.flavor-category-showcase-wrapper) .category-icon,
    :where(.flavor-category-showcase-wrapper) .category-title {
        transition: none;
        animation: none;
    }

    :where(.flavor-category-showcase-wrapper) .category-link::before {
        display: none;
    }
}

@media print {
    :where(.flavor-category-showcase-wrapper) .category-showcase-grid {
        display: block;
    }

    :where(.flavor-category-showcase-wrapper) .category-item {
        break-inside: avoid;
        margin-bottom: 20px;
    }

    :where(.flavor-category-showcase-wrapper) .category-link {
        box-shadow: none;
        border: 1px solid #000000;
    }
}
