/**
 * JOYEE SAUNA — Elenco prodotti e card commerciali Gutenberg
 * File: assets/css/landing-flex-product-list.css
 * Versione: 1.0.0 | 2026-11-23
 *
 * Componenti:
 * - joyee/product-list, modalità automatica (legacy)
 * - joyee/product-list + joyee/product-card, modalità editabile
 * - pattern Gutenberg joyee-card-commerciale
 * - visualizzazione dei blocchi nell'editor
 *
 * Stile condiviso, autonomo da landing-base.css.
 * I CSS landing-*.css possono modificare i token --joyee-list-*.
 * Non definisce gli stili della Hero o del modulo Fluent Forms.
 */

/* =========================================================
   1. TOKEN E STRUTTURA DELLA GRIGLIA
   ========================================================= */

.joyee-lf-product-list,
.joyee-lf-card-commerciale {
    --joyee-list-bg: #26211f;
    --joyee-list-bg-deep: #1e1a19;
    --joyee-list-border: #70553b;
    --joyee-list-text: #faf6ef;
    --joyee-list-muted: #d8c9b8;
    --joyee-list-gold: #f1bb6b;
    --joyee-list-gold-light: #ffd18a;
    --joyee-list-button-text: #231912;
    --joyee-list-media-bg: #e9dbc6;
    --joyee-list-gap: clamp(14px, 1.8vw, 22px);
    --joyee-list-radius: 16px;
    --joyee-list-shadow: 0 12px 28px rgb(0 0 0 / 17%);

    font-family: var(
        --wp--preset--font-family--inter,
        "Inter",
        Arial,
        sans-serif
    );
}

.joyee-lf-product-list {
    width: 100%;
    min-width: 0;
    max-width: none;
    container: joyee-list / inline-size;
}

.joyee-lf-product-list,
.joyee-lf-product-list *,
.joyee-lf-product-list *::before,
.joyee-lf-product-list *::after,
.joyee-lf-card-commerciale,
.joyee-lf-card-commerciale *,
.joyee-lf-card-commerciale *::before,
.joyee-lf-card-commerciale *::after {
    box-sizing: border-box;
}

.joyee-lf-product-list__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;

    gap: var(--joyee-list-gap);

    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.joyee-lf-product-list--cols-2 .joyee-lf-product-list__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.joyee-lf-product-list--cols-3 .joyee-lf-product-list__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.joyee-lf-product-list__item {
    min-width: 0;
    height: 100%;

    margin: 0;
    padding: 0;
    list-style: none;
}

/* =========================================================
   2. CARD AUTOMATICHE (MODALITÀ LEGACY)
   ========================================================= */

.joyee-lf-product-list__card {
    height: 100%;
    overflow: hidden;

    border: 1px solid var(--joyee-list-border);
    border-radius: var(--joyee-list-radius);

    background: linear-gradient(
        155deg,
        var(--joyee-list-bg),
        var(--joyee-list-bg-deep)
    );

    color: var(--joyee-list-text);
    box-shadow: var(--joyee-list-shadow);

    transition:
        transform .16s ease,
        box-shadow .16s ease,
        border-color .16s ease;
}

.joyee-lf-product-list__card:hover,
.joyee-lf-product-list__card:focus-within {
    transform: translateY(-3px);
    border-color: var(--joyee-list-gold);

    box-shadow: 0 16px 32px rgb(0 0 0 / 23%);
}

.joyee-lf-product-list__link {
    display: flex;
    flex-direction: column;

    height: 100%;
    min-width: 0;

    color: var(--joyee-list-text);
    text-decoration: none;
}

.joyee-lf-product-list__link:hover,
.joyee-lf-product-list__link:focus-visible {
    color: var(--joyee-list-text);
    text-decoration: none;
}

.joyee-lf-product-list__link:focus-visible {
    outline: 3px solid var(--joyee-list-gold-light);
    outline-offset: -4px;
}

.joyee-lf-product-list__media {
    display: grid;
    place-items: center;

    width: 100%;
    min-width: 0;
    aspect-ratio: 4 / 3;

    overflow: hidden;
    padding: 10px;

    background: var(--joyee-list-media-bg);
}

.joyee-lf-product-list__image {
    display: block;

    width: 100%;
    height: 100%;
    max-width: 100%;

    object-fit: contain;
}

.joyee-lf-product-list__no-image {
    padding: 12px;

    color: #504137;

    font-size: .86rem;
    line-height: 1.4;
    text-align: center;
}

.joyee-lf-product-list__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;

    gap: 10px;

    min-width: 0;
    padding: clamp(14px, 1.5vw, 20px);
}

.joyee-lf-product-list__title {
    overflow-wrap: anywhere;
    margin: 0;

    color: var(--joyee-list-text);
    font-family: inherit;

    font-size: clamp(1.12rem, 1.4vw, 1.35rem);
    font-weight: 800;
    line-height: 1.2;
}

.joyee-lf-product-list__excerpt {
    margin: 0;

    color: var(--joyee-list-muted);

    font-size: .92rem;
    line-height: 1.5;
}

.joyee-lf-product-list__price {
    display: grid;
    gap: 3px;

    margin: auto 0 0;
    padding-top: 12px;

    color: var(--joyee-list-text);
}

.joyee-lf-product-list__price-label {
    color: var(--joyee-list-muted);

    font-size: .78rem;
    line-height: 1.3;
}

.joyee-lf-product-list__price strong {
    color: var(--joyee-list-gold-light);

    font-size: clamp(1.17rem, 1.5vw, 1.4rem);
    font-weight: 800;
    line-height: 1.2;
}

.joyee-lf-product-list__cta {
    display: block;
    width: 100%;

    margin-top: 8px;
    padding: 11px 12px;

    border-radius: 999px;

    background: linear-gradient(
        135deg,
        var(--joyee-list-gold-light),
        var(--joyee-list-gold)
    );

    color: var(--joyee-list-button-text);

    font-size: .9rem;
    font-weight: 800;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
}

/* =========================================================
   3. CARD GUTENBERG MODIFICABILI
   ========================================================= */

.joyee-lf-product-list--editable .joyee-lf-product-list__grid {
    align-items: stretch;
}

.joyee-lf-product-card {
    display: flex;
    flex-direction: column;

    min-width: 0;
}

/* Il pattern può essere utilizzato anche singolarmente,
   purché il CSS del componente sia caricato nella pagina. */

.joyee-lf-card-commerciale {
    display: flex;
    flex-direction: column;

    width: 100%;
    min-width: 0;
    height: 100%;

    margin: 0;
    overflow: hidden;

    border: 1px solid var(--joyee-list-border);
    border-radius: var(--joyee-list-radius);

    background: linear-gradient(
        155deg,
        var(--joyee-list-bg),
        var(--joyee-list-bg-deep)
    );

    color: var(--joyee-list-text);
    box-shadow: var(--joyee-list-shadow);

    transition:
        transform .16s ease,
        box-shadow .16s ease,
        border-color .16s ease;
}

.joyee-lf-card-commerciale:hover,
.joyee-lf-card-commerciale:focus-within {
    transform: translateY(-3px);
    border-color: var(--joyee-list-gold);

    box-shadow: 0 16px 32px rgb(0 0 0 / 23%);
}

/* Fotografia del prodotto */

.joyee-lf-card-commerciale > .joyee-lf-card-commerciale__media {
    display: grid;
    place-items: center;

    width: 100%;
    min-width: 0;
    aspect-ratio: 4 / 3;

    margin: 0;
    overflow: hidden;

    background: var(--joyee-list-media-bg);
}

.joyee-lf-card-commerciale__media .joyee-lf-product-media,
.joyee-lf-card-commerciale__media .joyee-lf-product-media__link {
    display: block;

    width: 100%;
    height: 100%;
    min-width: 0;
}

.joyee-lf-card-commerciale__media .joyee-lf-product-media__image {
    display: block;

    width: 100%;
    height: 100%;
    max-width: 100%;

    padding: 10px;
    object-fit: contain;
}

/* Corpo della card */

.joyee-lf-card-commerciale > .joyee-lf-card-commerciale__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;

    min-width: 0;
    width: 100%;

    margin: 0;
    padding: clamp(14px, 1.5vw, 20px);
}

/* Nome dinamico della sauna */

.joyee-lf-card-commerciale .joyee-lf-product-field--title {
    margin: 0 0 12px;
}

.joyee-lf-card-commerciale
.joyee-lf-product-field--title
:is(h1, h2, h3, p, span, strong) {
    display: block;

    overflow-wrap: anywhere;
    margin: 0;

    color: var(--joyee-list-text);
    font-family: inherit;

    font-size: clamp(1.15rem, 1.5vw, 1.4rem);
    font-weight: 800;
    line-height: 1.2;
}

/* Prezzo di listino: contenuto Gutenberg facoltativo */

.joyee-lf-card-commerciale .joyee-lf-card-commerciale__list-price {
    margin: 0;

    color: var(--joyee-list-muted);

    font-size: .98rem;
    line-height: 1.4;
}

.joyee-lf-card-commerciale
.joyee-lf-card-commerciale__list-price
:is(del, s) {
    text-decoration: line-through;
    text-decoration-color: #eb7062;
    text-decoration-thickness: 2px;
}

/* Prezzo promozionale o messaggio commerciale */

.joyee-lf-card-commerciale .joyee-lf-card-commerciale__promo {
    margin: 8px 0 16px;

    color: var(--joyee-list-gold-light);

    font-size: clamp(1.35rem, 2vw, 1.9rem);
    font-weight: 850;
    line-height: 1.18;

    overflow-wrap: anywhere;
}

.joyee-lf-card-commerciale .joyee-lf-card-commerciale__promo small {
    font-size: .62em;
    font-weight: 650;
}

/* CTA commerciale */

.joyee-lf-card-commerciale .joyee-lf-card-commerciale__actions {
    display: flex;

    margin: auto 0 0;
    padding-top: 12px;
}

.joyee-lf-card-commerciale .joyee-lf-card-commerciale__cta {
    width: 100%;
    margin: 0;
}

.joyee-lf-card-commerciale
.joyee-lf-card-commerciale__cta
.wp-block-button__link {
    display: block;
    width: 100%;

    padding: 13px 14px;

    border: 1px solid #ffcd7e;
    border-radius: 999px;

    background: linear-gradient(
        135deg,
        var(--joyee-list-gold-light),
        var(--joyee-list-gold)
    );

    color: var(--joyee-list-button-text);
    box-shadow: none;

    font-family: inherit;
    font-size: .92rem;
    font-weight: 800;
    line-height: 1.3;

    text-align: center;
    text-decoration: none;
    white-space: normal;

    transition: filter .16s ease;
}

.joyee-lf-card-commerciale
.joyee-lf-card-commerciale__cta
.wp-block-button__link:hover {
    background: linear-gradient(
        135deg,
        var(--joyee-list-gold-light),
        var(--joyee-list-gold)
    );

    color: var(--joyee-list-button-text);

    filter: brightness(1.05);
    text-decoration: none;
}

.joyee-lf-card-commerciale
.joyee-lf-card-commerciale__cta
.wp-block-button__link:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

/* =========================================================
   4. EDITOR GUTENBERG
   ========================================================= */

.joyee-lf-product-list-editor {
    min-width: 0;
    padding: 12px;

    border: 1px dashed #aa8e71;
    border-radius: 10px;
}

.joyee-lf-product-list-editor__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;

    gap: 8px 16px;

    margin-bottom: 16px;
    padding: 12px 14px;

    border: 1px solid #dec6a7;
    border-radius: 8px;

    background: #fff3df;
    color: #34261b;

    font-size: .88rem;
}

.joyee-lf-product-list-editor__toolbar strong {
    margin-right: auto;
    font-weight: 800;
}

/* Gutenberg aggiunge dei wrapper intorno agli InnerBlocks */

.joyee-lf-product-list-editor
> .block-editor-inner-blocks
> .block-editor-block-list__layout {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;

    gap: var(--joyee-list-gap);
    min-width: 0;
}

.joyee-lf-product-list--cols-2.joyee-lf-product-list-editor
> .block-editor-inner-blocks
> .block-editor-block-list__layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.joyee-lf-product-list--cols-3.joyee-lf-product-list-editor
> .block-editor-inner-blocks
> .block-editor-block-list__layout {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.joyee-lf-product-card-editor {
    min-width: 0;
    height: 100%;

    padding: 5px;

    border: 1px dashed #ac906c;
    border-radius: 10px;
}

.joyee-lf-product-card-editor__heading {
    margin: 0 0 8px;
    padding: 7px 9px;

    border-radius: 5px;

    background: #f6e3c3;
    color: #352719;

    font-size: 11px;
    font-weight: 800;
    line-height: 1.45;
}

.joyee-lf-list-editor-items li {
    display: flex;
    align-items: center;

    gap: 4px;
    min-width: 0;
}

.joyee-lf-list-editor-items li span {
    flex: 1 1 auto;
    min-width: 0;

    overflow-wrap: anywhere;
}

/* =========================================================
   5. RESPONSIVE
   ========================================================= */

/* Tablet: gli elenchi da 3 o 4 colonne passano a 2 */

@media (max-width: 1080px) {
    .joyee-lf-product-list--cols-4 .joyee-lf-product-list__grid,
    .joyee-lf-product-list--cols-3 .joyee-lf-product-list__grid,
    .joyee-lf-product-list--cols-4.joyee-lf-product-list-editor
    > .block-editor-inner-blocks
    > .block-editor-block-list__layout,
    .joyee-lf-product-list--cols-3.joyee-lf-product-list-editor
    > .block-editor-inner-blocks
    > .block-editor-block-list__layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Container query:
   adatta la griglia alla larghezza reale del blocco,
   utile quando è inserito in un gruppo Gutenberg stretto. */

@container joyee-list (max-width: 900px) {
    .joyee-lf-product-list--cols-4 .joyee-lf-product-list__grid,
    .joyee-lf-product-list--cols-3 .joyee-lf-product-list__grid,
    .joyee-lf-product-list--cols-4.joyee-lf-product-list-editor
    > .block-editor-inner-blocks
    > .block-editor-block-list__layout,
    .joyee-lf-product-list--cols-3.joyee-lf-product-list-editor
    > .block-editor-inner-blocks
    > .block-editor-block-list__layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@container joyee-list (max-width: 530px) {
    .joyee-lf-product-list__grid,
    .joyee-lf-product-list--cols-2 .joyee-lf-product-list__grid,
    .joyee-lf-product-list--cols-3 .joyee-lf-product-list__grid,
    .joyee-lf-product-list--cols-4 .joyee-lf-product-list__grid,
    .joyee-lf-product-list-editor
    > .block-editor-inner-blocks
    > .block-editor-block-list__layout,
    .joyee-lf-product-list--cols-2.joyee-lf-product-list-editor
    > .block-editor-inner-blocks
    > .block-editor-block-list__layout,
    .joyee-lf-product-list--cols-3.joyee-lf-product-list-editor
    > .block-editor-inner-blocks
    > .block-editor-block-list__layout,
    .joyee-lf-product-list--cols-4.joyee-lf-product-list-editor
    > .block-editor-inner-blocks
    > .block-editor-block-list__layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Mobile: una sola colonna */

@media (max-width: 620px) {
    .joyee-lf-product-list__grid,
    .joyee-lf-product-list--cols-2 .joyee-lf-product-list__grid,
    .joyee-lf-product-list--cols-3 .joyee-lf-product-list__grid,
    .joyee-lf-product-list--cols-4 .joyee-lf-product-list__grid,
    .joyee-lf-product-list-editor
    > .block-editor-inner-blocks
    > .block-editor-block-list__layout,
    .joyee-lf-product-list--cols-2.joyee-lf-product-list-editor
    > .block-editor-inner-blocks
    > .block-editor-block-list__layout,
    .joyee-lf-product-list--cols-3.joyee-lf-product-list-editor
    > .block-editor-inner-blocks
    > .block-editor-block-list__layout,
    .joyee-lf-product-list--cols-4.joyee-lf-product-list-editor
    > .block-editor-inner-blocks
    > .block-editor-block-list__layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .joyee-lf-product-list__body,
    .joyee-lf-card-commerciale > .joyee-lf-card-commerciale__body {
        padding: 16px;
    }

    .joyee-lf-product-list__title,
    .joyee-lf-card-commerciale
    .joyee-lf-product-field--title
    :is(h1, h2, h3, p, span, strong) {
        font-size: 1.2rem;
    }

    .joyee-lf-card-commerciale .joyee-lf-card-commerciale__promo {
        font-size: 1.6rem;
    }
}

/* Accessibilità: rispetto delle preferenze di movimento */

@media (prefers-reduced-motion: reduce) {
    .joyee-lf-product-list__card,
    .joyee-lf-card-commerciale,
    .joyee-lf-card-commerciale
    .joyee-lf-card-commerciale__cta
    .wp-block-button__link {
        transition: none;
    }

    .joyee-lf-product-list__card:hover,
    .joyee-lf-product-list__card:focus-within,
    .joyee-lf-card-commerciale:hover,
    .joyee-lf-card-commerciale:focus-within {
        transform: none;
    }
}