/* Sottocategorie a pulsanti (modulo ivsubcat).
   Da 1200px: una riga, pulsanti a sinistra e "Ordina per" a destra.
   Sotto 1200px: pulsanti a tutta larghezza che scorrono, sopra l'ordinamento (che resta quello del tema). */
.iv-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 2px 0;
}
.iv-chips .iv-chip {
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 18px;
    border: 1.5px solid #00422e;
    border-radius: 999px;
    background: transparent;
    color: #00422e !important;
    font-family: "Inter", sans-serif !important;
    font-size: 15px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none !important;
    transition: background-color .2s ease, color .2s ease;
}
.iv-chips .iv-chip:hover {
    background: rgba(0, 66, 46, .07);
}
.iv-chips .iv-chip.is-active {
    background: #00422e;
    color: #fff7ef !important;
}
.iv-chips .iv-chip--pers {
    border-color: #b5634b;
    color: #b5634b !important;
}
.iv-chips .iv-chip--pers:hover {
    background: rgba(181, 99, 75, .08);
}
.iv-chips .iv-chip--pers.is-active {
    background: #b5634b;
    color: #fff7ef !important;
}
#js-product-list-top:has(.iv-chips) .total-products {
    display: block !important;
}
#js-product-list-top:has(.iv-chips) .total-products > :not(.iv-chips) {
    display: none !important;
}

@media (min-width: 1200px) {
    #js-product-list-top:has(.iv-chips) > .row {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
    }
    #js-product-list-top:has(.iv-chips) .total-products {
        flex: 1 1 auto;
        width: auto;
        max-width: none;
        min-width: 0;
    }
    #js-product-list-top:has(.iv-chips) .total-products + div {
        flex: 0 0 auto;
        width: auto;
        max-width: none;
    }
    /* "Ordina per:" su una riga, select a larghezza fissa (su tutte le categorie, anche senza pulsanti) */
    #js-product-list-top .sort-by-row {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: flex-end;
        gap: 14px;
        margin: 0;
    }
    #js-product-list-top .sort-by-row .sort-by {
        flex: 0 0 auto;
        width: auto;
        max-width: none;
        padding: 0;
        white-space: nowrap;
    }
    #js-product-list-top .sort-by-row .products-sort-order {
        flex: 0 0 230px;
        width: 230px;
        max-width: none;
        padding: 0;
    }
}
/* schermi medi: pulsanti un po' più compatti per stare su una riga */
@media (min-width: 1200px) and (max-width: 1366px) {
    .iv-chips {
        gap: 8px;
    }
    .iv-chips .iv-chip {
        height: 38px;
        padding: 0 14px;
        font-size: 14px;
    }
    #js-product-list-top .sort-by-row .products-sort-order {
        flex-basis: 200px;
        width: 200px;
    }
}
@media (max-width: 1199px) {
    #js-product-list-top:has(.iv-chips) .total-products {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        margin-bottom: 12px;
    }
    .iv-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* sfumatura a destra: si capisce che i pulsanti scorrono */
        -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
        mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
    }
    .iv-chips::-webkit-scrollbar {
        display: none;
    }
    .iv-chips .iv-chip {
        height: 36px;
        padding: 0 15px;
        font-size: 14px;
    }
}
