/*
 * BoCategorySlider
 * Layout leggero: griglia su desktop, scroll-snap orizzontale su mobile.
 * Nessuna dipendenza esterna (no owl, no font-awesome).
 */

/* clear + flow-root: alcuni moduli del tema (es. il carosello prodotti owl)
   lasciano float non chiusi che invaderebbero questa sezione, spingendo la riga
   del titolo sotto il float e gonfiando l'altezza del blocco. */
.bcs-wrapper {
    clear: both;
    display: flow-root;
    margin: 24px 0;
}

/* Il titolo usa .section-title / h2.title del tema: nessuno stile qui,
   così eredita colore, font e dimensione dai titoli di sezione del tema. */
.bcs-wrapper .section-title {
    margin-bottom: 16px;
}

.bcs-viewport {
    position: relative;
}

/* Track: flex con scroll orizzontale. Le tessere hanno larghezza calcolata
   in base al numero di elementi visibili impostato in configurazione. */
.bcs-track {
    display: flex;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.bcs-track::-webkit-scrollbar { display: none; }

.bcs-item {
    flex: 0 0 calc((100% - (var(--bcs-mobile) - 1) * 12px) / var(--bcs-mobile));
    scroll-snap-align: start;
}

/* ---- Tessera ---- */
.bcs-link {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    background: #f2f2f2;
}
.bcs-link:hover,
.bcs-link:focus { text-decoration: none; color: inherit; }

/* Immagine: aspect-ratio dalle dimensioni reali => niente CLS. */
.bcs-img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: var(--bcs-ratio);
    object-fit: cover;
    transition: transform .45s ease;
}
.bcs-link:hover .bcs-img { transform: scale(1.05); }

/* ---- Overlay nome + CTA ---- */
.bcs-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 28px 12px 14px;
    text-align: center;
    color: #fff;
}
.bcs-name {
    display: block;
    font-size: .95rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
.bcs-btn {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid rgba(255, 255, 255, .85);
    border-radius: 3px;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    line-height: 1.4;
    transition: background-color .25s ease, color .25s ease;
}
.bcs-link:hover .bcs-btn,
.bcs-link:focus .bcs-btn {
    background: #fff;
    color: #222;
}

/* Variante 1 (default): sfumatura elegante, niente bordi netti */
.bcs-ov-gradient .bcs-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, .78) 0%, rgba(0, 0, 0, .45) 55%, rgba(0, 0, 0, 0) 100%);
}

/* Variante 2: banda piena, stile classico */
.bcs-ov-bar .bcs-overlay {
    background: rgba(0, 0, 0, .55);
    padding: 12px;
}

/* Variante 3: nome sotto l'immagine, senza overlay */
.bcs-ov-below .bcs-overlay {
    position: static;
    color: inherit;
    padding: 10px 4px 0;
    background: none;
}
.bcs-ov-below .bcs-name { text-shadow: none; }
.bcs-ov-below .bcs-btn {
    border-color: currentColor;
}
.bcs-ov-below .bcs-link:hover .bcs-btn {
    background: #222;
    color: #fff;
}

/* ---- Frecce ---- */
.bcs-arrow {
    position: absolute;
    top: calc(50% - 20px);
    transform: translateY(-50%);
    z-index: 2;
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
    color: #222;
    cursor: pointer;
}
.bcs-arrow:hover { background: #fff; }
.bcs-prev { left: -8px; }
.bcs-next { right: -8px; }
.bcs-arrow[disabled] { opacity: .35; cursor: default; }

/* ---- Dots ---- */
.bcs-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}
.bcs-dots button {
    width: 9px;
    height: 9px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
}
.bcs-dots button.is-active { background: #333; }

/* ---- Desktop ---- */
@media (min-width: 768px) {
    .bcs-item {
        flex: 0 0 calc((100% - (var(--bcs-desktop) - 1) * 12px) / var(--bcs-desktop));
    }
    .bcs-has-nav .bcs-arrow { display: flex; }
    .bcs-name { font-size: 1.02rem; }
}

/* Griglia statica (slider disattivato): a capo automatico, niente scroll */
.bcs-wrapper:not(.bcs-is-slider) .bcs-track {
    flex-wrap: wrap;
    overflow: visible;
}

/* Rispetta le preferenze di movimento ridotto */
@media (prefers-reduced-motion: reduce) {
    .bcs-img { transition: none; }
    .bcs-link:hover .bcs-img { transform: none; }
}
