/**
 * Stili dedicati al template PHP single-prodotti (CPT prodotti).
 * Caricato condizionalmente da functions.php solo su is_singular('prodotti').
 *
 * Convenzione di naming: BEM-like su prefisso `.prodotto-*`.
 */

/* =========================================================
   HERO 2 COLONNE
   ========================================================= */
.prodotto-hero {
    padding: 40px 0 60px;
    background-color: #F9F9F9;
}

.prodotto-hero__inner {
    display: flex;
    gap: 60px;
    align-items: flex-start;
}

.prodotto-hero__left{
    background-color: #ffffff;
}

.prodotto-hero__left,
.prodotto-hero__right {
    flex: 1 1 50%;
    min-width: 0;
}

/* SX: slider Slick con immagine principale + disegni tecnici */
.prodotto-hero__slider {
    width: 100%;
    /* Riserva l'altezza prima del bootstrap di slick per evitare lo "scoppio" del layout */
    min-height: 320px;
}
.prodotto-hero__slider .slick-list,
.prodotto-hero__slider .slick-track {
    display: flex;
    align-items: center;
}
.prodotto-hero__slide {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}
/* Immagini mostrate alla loro dimensione naturale: nessuno scaling in larghezza/altezza,
   evita la sgranatura quando l'immagine intrinseca è più piccola del contenitore. */
.prodotto-hero__slide img {
    width: auto;
    height: auto;
    display: inline-block;
}
/* Frecce e dots: stile minimal coerente */
.prodotto-hero__slider .slick-prev,
.prodotto-hero__slider .slick-next {
    z-index: 2;
    width: 36px;
    height: 36px;
}
.prodotto-hero__slider .slick-prev { left: 0; }
.prodotto-hero__slider .slick-next { right: 0; }
.prodotto-hero__slider .slick-prev::before,
.prodotto-hero__slider .slick-next::before {
    color: #333;
    font-size: 28px;
    opacity: 0.6;
}
.prodotto-hero__slider .slick-dots {
    bottom: -28px;
}
.prodotto-hero__slider .slick-dots li button:before {
    color: #999;
}
.prodotto-hero__slider .slick-dots li.slick-active button:before {
    color: #333;
}

/* Thumbs come griglia statica, sempre a sinistra, perfettamente quadrate */
.prodotto-hero__thumbs {
    margin-top: 16px;
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    padding: 15px;
}
.prodotto-hero__thumb {
    width: 80px;
    height: 80px;
    box-sizing: border-box;
    cursor: pointer;
    outline: none;
    border: 1px solid #e1e1e1;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: border-color .2s;
    flex-shrink: 0;
}
.prodotto-hero__thumb img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
.prodotto-hero__thumb:hover,
.prodotto-hero__thumb--active {
    border-color: #333;
}

/* DX: container con sfondo grigino, distribuisce verticalmente heading e body */
.prodotto-hero__right {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-self: stretch;
    min-height: 100%;
    gap: 40px;
}

.prodotto-hero__heading,
.prodotto-hero__body {
    display: flex;
    flex-direction: column;
}

/* Nav prev/next sopra il titolo (dentro il box grigio) */
.prodotto-hero__nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    font-size: 14px;
}
.prodotto-hero__nav-prev,
.prodotto-hero__nav-next {
    min-height: 24px;
}
.prodotto-hero__nav-next {
    margin-left: auto;
    text-align: right;
}
.prodotto-hero__nav a {
    color: #1a1a1a;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.prodotto-hero__nav-icon {
    flex-shrink: 0;
    color: currentColor;
}

.prodotto-hero__title {
    font-size: 54px;
    line-height: 1.1;
    font-weight: 400;
    margin: 0 0 8px;
    color: #333;
}

.prodotto-hero__subtitle {
    font-size: 26px;
    font-weight: 400;
    color: #555;
    margin: 0;
}

.prodotto-hero__description {
    font-size: 15px;
    line-height: 1.55;
    color: #444;
    padding-bottom: 24px;
}
.prodotto-hero__description p {
    margin: 0 0 6px;
    font-size: 22px;
}

.prodotto-hero__icons {
    display: flex;
    gap: 16px;
    margin: 16px 0;
}
.prodotto-hero__icon {
    display: flex;
    background: #fff;
}
.prodotto-hero__icon img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    
    border: 1px solid #e0e0e0;
    box-sizing: border-box;
}
/* Titoli sotto le icone nascosti: la grafica non li prevede. */
.prodotto-hero__icon p {
    display: none;
}

.prodotto-hero__code {
    font-size: 13px;
    color: #999;
    text-align: right;
    margin: 0;
}

/* =========================================================
   STICKY MENU DI SEZIONE
   ========================================================= */
.prodotto-sticky {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #fff;
    border-top: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
    padding: 10px 0;
}
.prodotto-sticky__inner {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.prodotto-sticky__links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
}
.prodotto-sticky__links li a {
    display: block;
    padding: 18px 0;
    text-transform: uppercase;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.8px;
    color: #333;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-color .2s;
}
.prodotto-sticky__links li a:hover,
.prodotto-sticky__links li a.is-active {
    border-bottom-color: #333;
}

.prodotto-sticky__cta {
    display: flex;
    align-items: center;
    gap: 12px;
}
.prodotto-sticky__btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    padding: 14px 22px;
    background: #f4f4f4;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    transition: background .2s, border-color .2s;
}
.prodotto-sticky__btn:hover {
    background: #ebebeb;
    border-color: #cfcfcf;
    color: #1a1a1a;
}
.prodotto-sticky__btn-icon {
    flex-shrink: 0;
    color: currentColor;
}

/* =========================================================
   SEZIONI FINITURE
   ========================================================= */
.prodotto-finiture {
    background-color: #F9F9F9;
    padding: 50px 0;
    scroll-margin-top: 80px; /* compensa l'altezza dello sticky menu sull'anchor */
}
.prodotto-finiture__title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 32px;
    color: #333;
}
.prodotto-finiture__grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 14px;
}
.prodotto-finiture__card {
    display: flex;
    flex-direction: column;
    min-width: 0; /* evita sbordamento dei figli con max-width: 1fr */
}
.prodotto-finiture__img {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #eee;
}
.prodotto-finiture__label {
    margin: 10px 0 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #777;
}

/* =========================================================
   SEZIONE DOWNLOAD MATERIALE TECNICO
   ========================================================= */
.prodotto-download {
    padding: 50px 0 80px;
    scroll-margin-top: 80px;
    background-color: #F9F9F9;
}
.prodotto-download__title {
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 24px;
    color: #333;
}
.prodotto-download__list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.prodotto-download__item {
    margin: 0;
    padding: 0;
}
.prodotto-download__link {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    transition: color .2s;
}
.prodotto-download__link:hover {
    color: #97041f;
}
.prodotto-download__icon {
    flex-shrink: 0;
    color: #333;
}
.prodotto-download__link:hover .prodotto-download__icon {
    color: #97041f;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1199px) {
    .prodotto-finiture__grid {
        grid-template-columns: repeat(5, 1fr);
    }
}
@media (max-width: 991px) {
    .prodotto-hero__inner {
        flex-direction: column;
        gap: 30px;
    }
    .prodotto-hero__title {
        font-size: 36px;
    }
    .prodotto-finiture__grid {
        grid-template-columns: repeat(4, 1fr);
    }
    .prodotto-sticky {
        position: static;
    }
    .prodotto-sticky__inner {
        flex-direction: column;
        align-items: flex-start;
    }
    .prodotto-sticky__links {
        gap: 16px;
    }
}
@media (max-width: 600px) {
    .prodotto-hero__title {
        font-size: 28px;
    }
    .prodotto-finiture__grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .prodotto-hero__icons {
        flex-direction: column;
    }
}