/**
 * ITG Categories Unified CSS
 * Combina scroll orizzontale mobile + dropdown funzionante
 */

/* Import Google Font Oswald */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@300;400;500;600&display=swap');

/* Container wrapper */
#itg-categories-wrapper {
    width: 100%;
    position: relative;
}

/* Grid base desktop - ora in una sola riga */
.itg-cats {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
}

/* Scrollbar sottile su desktop */
.itg-cats::-webkit-scrollbar {
    height: 6px;
}

.itg-cats::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.itg-cats::-webkit-scrollbar-thumb {
    background: #ff5722;
    border-radius: 3px;
}

/* Dimensioni fisse per evitare wrap */
@media (min-width: 769px) {
    .itg-cat {
        flex: 0 0 auto;
        width: 120px;
    }
}

/* Singola categoria */
.itg-cat {
    position: relative;
    background: #fff;
    border-radius: 12px;
    overflow: visible !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 1;
    border: 2px solid #e0e0e0;
}

.itg-cat-link {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px !important;
    text-align: center;
    text-decoration: none;
    color: #3A3A3C;
    position: relative;
    transition: all 0.3s ease;
}

.itg-cat-link img {
    width: 100%;
    height: 50px;
    object-fit: contain;
    margin-bottom: 5px;
}

.itg-cat-link h3 {
    font-family: 'Oswald', sans-serif;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    color: #3A3A3C;
    transition: color 0.3s;
    line-height: 1.2;
}

.itg-cat:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.itg-cat:hover h3 {
    color: #FF6B35;
}

/* Mobile - SCROLL ORIZZONTALE */
@media (max-width: 768px) {
    .itg-cats {
        display: flex !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        gap: 12px;
        -webkit-overflow-scrolling: touch;
        padding: 10px 0 15px 0;
        /* Aggiungo padding top per l'animazione hover */
        position: relative;
        z-index: 9999 !important;
        /* Rimuovi grid su mobile */
        grid-template-columns: unset !important;
    }

    .itg-cat {
        flex: 0 0 calc(25% - 11.25px);
        min-width: 80px;
        max-width: 100px;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }

    .itg-cat-link {
        padding: 10px 5px !important;
    }

    .itg-cat-link img {
        height: 50px;
    }

    .itg-cat-link h3 {
        font-size: 12px;
    }

    /* Disabilita transform su mobile per evitare taglio */
    .itg-cat:hover {
        transform: none !important;
    }
}

/* DROPDOWN NEL BODY */
.itg-dropdown-body {
    position: absolute !important;
    min-width: 250px !important;
    background: #fff !important;
    border: 2px solid #4B3F8C !important;
    /* Bordo viola corretto */
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(75, 63, 140, 0.15) !important;
    /* Shadow viola */
    padding: 8px 0 !important;
    /* Padding uniforme */
    display: none !important;
    z-index: 999999 !important;
}

.itg-dropdown-body.show {
    display: block !important;
}

.itg-dropdown-body a {
    display: block !important;
    padding: 14px 24px !important;
    color: #3A3A3C !important;
    /* Colore testo principale */
    text-decoration: none !important;
    border-bottom: 1px solid #f0f0f0 !important;
    font-size: 15px !important;
    font-family: 'Oswald', sans-serif !important;
    font-weight: 400 !important;
    transition: all 0.3s ease !important;
    position: relative !important;
}

.itg-dropdown-body a:last-child {
    border-bottom: none !important;
}

.itg-dropdown-body a:hover {
    background: #FFF5F2 !important;
    /* Background arancione chiaro */
    color: #FF6B35 !important;
    /* Testo arancione al hover */
}

/* Indicatore attivo sulla categoria */
.itg-cat-link.dropdown-active {
    background: rgba(75, 63, 140, 0.08) !important;
    border-color: #4B3F8C !important;
}

.itg-cat-link.dropdown-active h3 {
    color: #4B3F8C !important;
}

/* Cursore pointer per categorie con dropdown */
[data-has-dropdown="true"] {
    cursor: pointer !important;
}