/*Modifica per menu pagina ricette risoli */
.page-recipes-risoli .subheader,
.page-risoli .subheader-mobile,
.page-risoli-ricette .subheader,
.page-risoli-ricette .subheader-mobile {
    background-color: #42baee;
}

/* NUOVA VERSIONE PRODOTTI*/
.list-product-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(280px, 1fr));
    gap: 32px;
    margin-bottom: 2%;
}

.single-product-container {
    display: flex;
    justify-content: center;
    text-align: center;
    max-width: 320px;
    margin: 0 auto;
}

.single-product-container__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    text-decoration: none;
}

.product-box {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e1e1e1;
}

.product-box__image {
    width: 100%;
    max-width: 350px;
    object-fit: contain;
    display: block;
}

.product-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #ffffff;
    background-color: #c8003e;
    border-radius: 999px;
    padding: 12px 18px;
    letter-spacing: 0.05em;
    margin: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.single-product-container__link:hover, .single-product-container__link:focus {
    text-decoration: none;
}

.single-product-container__link:hover .product-title,
.single-product-container__link:focus .product-title {
    background-color: #fff;
    color: #c8003e;
    border: 1px solid #c8003e;
}

/*Pagina dettaglio prodotto*/
.info-product {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 35px 0;
}

.left-column {
    width: 40%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}

.left-column h1 {
    color: #c8003a;
}

.icons .list-icons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 8rem;
}

.right-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

.right-column img {
    width: 500px;
    height: 470px;
    object-fit: cover;
}

/* Zoom immagine prodotto */
.product-image-trigger {
    border: 0;
    padding: 0;
    background: none;
    display: block;
    width: 100%;
    cursor: zoom-in;
}

.product-image-trigger img {
    display: block;
    width: 100%;
    height: auto;
}

.product-image-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 9999;
}

.product-image-modal.is-active {
    display: flex;
}

.product-image-modal__overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    cursor: zoom-out;
}

.product-image-modal__dialog {
    position: relative;
    background: #fff;
    border-radius: 4px;
    max-width: 90vw;
    max-height: 90vh;
    padding: 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.product-image-modal__close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    border: 0;
    background: transparent;
    font-size: 2rem;
    line-height: 1;
    color: #333;
}

.product-image-modal__img {
    max-width: 80vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

body.product-image-modal-open {
    overflow: hidden;
}

.pdf a {
    border: 1px solid #c8003a;
    background-color: #c8003a;
    color: white;
    border-radius: 10px;
    padding: 10px 50px;
    text-decoration: none;
    display: inline-block;
    margin-bottom: 30px;
}

.pdf a:hover, .pdf a:focus {
    text-decoration: none;
    color: white;
}

.info {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    grid-template-rows: 1fr;
    overflow: hidden;
}

.info .vantaggi, .info .plus_di_prodotto {
    min-width: 45%;
}

.info #vantaggi-heading, .info #caratteristiche-heading, .formato #formato-heading {
    font-size: 4.5rem;
    font-weight: 600;
    color: #707070;
}

.info .list-vantaggi, .info .list-plus {
    background-color: #f8f8f8;
    padding: 20px 32px;
    text-decoration: none;
    list-style: none;
    margin-bottom: 20px;
    height: 100%;
}

.info .list-vantaggi li, .info .list-plus li {
    color: #72717d;
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 0 10px;
}

.info .list-vantaggi li::before, .info .list-plus li::before {
    width: 0;
    height: 0;
    content: '';
    display: block;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 10px solid #c8003a;

}

.scheda-tecnica {
    padding: 20px 0;
    margin-bottom: 40px;
}

.scheda-tecnica h3 {
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 700;
    color: #333;
}

.list-scheda {
    overflow-x: auto;
}

.list-scheda table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.list-scheda th {
    background: #c8003e;
    color: white;
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 0.5px;
}

.list-scheda td {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.list-scheda tr:last-child td {
    border-bottom: none;
}

.list-scheda tr:hover {
    background-color: #f8f9fa;
}

.formato .info-formato {
    background-color: #f8f8f8;
    padding: 20px 32px;
    color: #72717d;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .list-scheda th,
    .list-scheda td {
        padding: 10px 15px;
        font-size: 0.9em;
    }

    .list-scheda th:first-child,
    .list-scheda td:first-child {
        width: 60%;
    }

    .list-scheda th:last-child,
    .list-scheda td:last-child {
        width: 40%;
    }
}

/*ACCESSIBILITA'*/
/* Screen reader only content */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus indicators */
a:focus,
button:focus,
[tabindex]:focus {
    outline: 2px solid #c8003e;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    .list-scheda table {
        border: 2px solid;
    }

    .list-scheda th {
        border: 1px solid;
    }

    .list-scheda td {
        border: 1px solid;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #c8003e;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 6px;
}

/*
* Pagina ricette
*/

/* Personalizzazione Select2 */
.page-ricette [tabindex]:focus,
.post-type-archive-recipes [tabindex]:focus {
    outline: none;
}

.page-ricette .type-filter-selection,
.post-type-archive-recipes .type-filter-selection {
    border: 1px solid #c8003e !important;
    border-radius: 20px !important;
    width: 100%;
    text-align: center;
}

.type-filter-selection .select2-selection {
    height: 50px;
    border: none;
    border-radius: 20px;
    background-color: white;
    display: flex;
    align-items: center;
    padding: 0 15px;
}

.type-filter-selection .select2-selection__rendered {
    font-weight: 600;
    font-size: 0.9em;
    width: 100%;
    color: #c8003e !important;
}

.type-filter-selection .select2-selection__arrow {
    height: 50px;
    width: 30px;
    position: absolute;
    right: 15px;
    display: none; /* Nascondo la freccia predefinita */
}

/* Dropdown aperto */
.type-filter-dropdown {
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin-top: 0 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
}

.type-filter-dropdown .select2-results__options {
    background-color: #c8003e;
    border-radius: 0;
    padding: 0;
    max-height: 300px;
}

.type-filter-dropdown .select2-results__option {
    padding: 10px 15px;
    font-size: 0.85em;
    color: white;
    transition: background-color 0.2s;
}

.type-filter-dropdown .select2-results__option--highlighted[aria-selected] {
    background-color: white !important;
    color: #c8003e !important;
}

.type-filter-dropdown .select2-results__option[aria-selected=true] {
    background-color: white !important;
    color: #c8003e !important;
}

.select2-container--open .select2-dropdown--below {
    border-top: none !important;
}

/* Rimuovo bordi esterni */
.select2-container--default .select2-results > .select2-results__options {
    border: none !important;
}

/* Stile per l'elemento selezionato quando viene visualizzato nel dropdown */
.select2-container--default .select2-results__option[data-selected=true] {
    background-color: white !important;
    color: #c8003e !important;
}

/* Stile per il container dei filtri */
.container-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.type-filter, .product-filter {
    flex: 1;
}

/* Stile per il select disabilitato */
#product-filter:disabled {
    background-color: #f2f2f2;
    cursor: not-allowed;
}

/* Stile per il container Select2 quando il filtro è disabilitato */
#product-filter:disabled + .select2-container {
    opacity: 0.6;
    pointer-events: none;
}

.select2-container--disabled .select2-selection {
    background-color: #f2f2f2 !important;
    cursor: not-allowed !important;
}

/* Fixa la larghezza del dropdown */
.type-filter .select2-container, .product-filter .select2-container {
    width: 100% !important;
}

/* Responsive per filtri su mobile */
@media (max-width: 768px) {
    .container-filters {
        flex-direction: column;
        gap: 15px;
    }

    .type-filter-selection .select2-selection {
        height: 45px;
    }

    .type-filter-selection .select2-selection__rendered {
        font-size: 0.85em;
    }
}

/* Griglia ricette - 5 per riga */
.container-recipes {
    display: grid;
    grid-template-columns: repeat(5, 250px);
    gap: 20px;
    margin-bottom: 40px;
    justify-content: center;
}

.single-recipe {
    width: 250px;
    display: flex;
    flex-direction: column;
}

.single-recipe .recipe-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.single-recipe:hover .recipe-box {
    border-color: #c8003e;
}

.single-recipe:hover .recipe-title {
    color: #c8003e;
}

.recipe-box {
    width: 250px;
    height: 250px;
    overflow: hidden;
    border: 4px solid #383838;
    transition: border-color 0.3s ease;
}

.recipe-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    background-color: #f2f2f2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-image-placeholder::before {
    content: 'Nessuna immagine';
    color: #999;
    font-size: 0.9em;
}

.recipe-title {
    font-size: 1.4rem;
    font-weight: 600;
    flex: 1;
    margin: 0;
    text-align: center;
}

/* Responsive - Ricette */
@media (max-width: 1400px) {
    .container-recipes {
        grid-template-columns: repeat(4, 250px);
    }
}

@media (max-width: 1100px) {
    .container-recipes {
        grid-template-columns: repeat(3, 250px);
    }
}

@media (max-width: 850px) {
    .container-recipes {
        grid-template-columns: repeat(2, 250px);
        gap: 15px;
    }
}

@media (max-width: 600px) {
    .container-recipes {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .single-recipe {
        width: 100%;
        max-width: 300px;
    }

    .recipe-box {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
    }
}

/* SINGLE RICETTE */
/* Hero centrato stile mockup */
.recipe-hero--center {
    text-align: center;
    padding: 96px 0;
}

.recipe-hero--center .recipe-hero__badge {
    margin-bottom: 16px;
    letter-spacing: .06em;
}

.recipe-hero--center .recipe-hero__title {
    font-size: 44px;
    line-height: 1.15;
    font-weight: 800;
}

/* Meta pills */
.recipe-meta--pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 28px 0 36px;
    padding: 0;
    list-style: none;
}

.recipe-meta__pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f4f6f8;
    border: 1px solid #e7eaee;
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 600;
}

.recipe-meta__icon {
    font-size: 16px;
}

.recipe-meta__label {
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: 11px;
}

.recipe-meta__value {
    font-weight: 700;
}

/* Sezioni */
.recipe-section {
    margin: 56px 0;
    padding: 0;
}

.recipe-section__title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 20px;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: #6d6d6d;
}

.recipe-section__grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
}

.recipe-section--split {
    margin: 40px 0;
}

.recipe-ingredients-card,
.recipe-preparation-card {
    background: #f4f4f4;
    padding: 28px 32px;
    margin-bottom: 18px;
}

.recipe-ingredients-card__title,
.recipe-preparation-card__title {
    margin: 0 0 18px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .04em;
    color: #808080;
}

.recipe-ingredients-card__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recipe-ingredients-card__item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 6px 0;
    font-size: 15px;
    color: #707070;
    position: relative;
}

.recipe-ingredients-card__item::before {
    content: '►';
    color: #c8003e;
    font-size: 12px;
    margin-right: 4px;
}

.recipe-ingredients-card__item--product .recipe-ingredients-card__link {
    color: #c8003e;
    font-weight: 600;
    text-decoration: none;
}

.recipe-ingredients-card__item--product .recipe-ingredients-card__link:hover {
    text-decoration: underline;
}

.recipe-ingredients-card__text {
    color: inherit;
}

.recipe-ingredients-card__qty {
    color: #999999;
    font-weight: 500;
}

.recipe-preparation-card__content p {
    margin: 0 0 1em;
    line-height: 1.6;
    color: #5e5e5e;
}

.recipe-preparation-card__content ul,
.recipe-preparation-card__content ol {
    padding-left: 18px;
}

/* Condivisione */
.recipe-share {
    margin: 36px 0 0;
}

/* Prodotti correlati */
.recipe-related {
    padding: 50px 0;
    background: #ffffff;
    margin-top: 60px;
}

.recipe-related__title {
    font-size: 24px;
    font-weight: 800;
    margin: 0 0 30px;
    text-transform: uppercase;
    letter-spacing: .04em;
    text-align: center;
    color: #6d6d6d;
}

.recipe-related__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
}

.recipe-related__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    width: 100%;
    text-align: center;
}

.recipe-related__media-link {
    display: block;
    width: 100%;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.08);
    transition: transform .3s ease;
}

.recipe-related__thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #ffffff;
    margin: 0;
    display: block;
    border-radius: 22px;
    overflow: hidden;
}

.recipe-related__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
    border-radius: 22px;
}

.recipe-related__media-link:hover .recipe-related__img,
.recipe-related__media-link:focus .recipe-related__img {
    transform: scale(1.05);
}

.recipe-related__thumb--placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f2f2f2;
    color: #a6a6a6;
    font-size: 12px;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: 10px;
}

.recipe-related__button {
    background: #c8003e;
    color: #ffffff;
    text-decoration: none;
    border: none;
    border-radius: 999px;
    padding: 12px 30px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    min-width: 220px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 12px 30px rgba(200, 0, 62, 0.25);
    transition: background .2s ease, transform .2s ease;
    text-decoration: none;
}

.recipe-related__button:hover,
.recipe-related__button:focus {
    background: #a10033;
    color: #fff;
    transform: translateY(-2px);
}

/* Responsive affinamenti */
@media (max-width: 1200px) {
    .recipe-related__grid {
        grid-template-columns: repeat(2, minmax(200px, 1fr));
    }

    .recipe-head {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
}

@media (max-width: 992px) {
    .recipe-section__grid {
        grid-template-columns: 1fr;
    }

    .recipe-related__grid {
        grid-template-columns: repeat(2, minmax(200px, 1fr));
    }

    .recipe-hero--center .recipe-hero__title {
        font-size: 36px;
    }

    .recipe-head {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .recipe-head__right {
        order: -1;
    }

    .recipe-head__title {
        font-size: 28px;
    }
}

@media (max-width: 720px) {
    .recipe-related__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .recipe-head {
        gap: 24px;
    }

    .recipe-meta-list__icon {
        width: 42px;
        height: 42px;
    }

    .recipe-meta-list__text {
        font-size: 14px;
    }

    .recipe-ingredients-card,
    .recipe-preparation-card {
        padding: 20px;
    }
}

/* SINGLE RICETTE — head layout wireframe */
.recipe-head {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 60px;
    align-items: center;
    margin: 42px 0 54px;
}

.recipe-head__left {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.recipe-head__right {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: flex-end;
}

.recipe-head__title {
    margin: 0;
    font-size: 32px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #c8003e;
}

.recipe-meta-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.recipe-meta-list__item {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 0;
    border-bottom: 1px solid #dedede;
}

.recipe-meta-list__item:last-child {
    border-bottom: none;
}

.recipe-meta-list__icon {
    width: 54px;
    height: 54px;
    display: block;
}

.recipe-meta-list__icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.recipe-meta-list__text {
    font-size: 15px;
    font-weight: 500;
    color: #5f5f5f;
    line-height: 1.4;
}

.recipe-head__media {
    margin: 0;
    display: block;
    overflow: hidden;
}

.recipe-head__media .recipe-head__img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.recipe-head__placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #b1b1b1;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: 14px;
    background: #f5f5f5;
}
