/*
 | La première étape du tunnel — barre de réservation et cartes d'offres.
 |
 | Valeurs relevées dans le Figma (`Nos formules (cartes offres)`, 1440 et 375) :
 |
 |   section    padding 80 48 48 48 (64 16 16 16), gap 56 (32), fond #d8d3c6
 |   titre      STIX Two Text 56 / 61,6 / −3 %, #1c1917  (36 en mobile)
 |   barre      1344 × 91, padding 16 20 16 48, fond #ffffff, rayon 128
 |              → en mobile : colonne, gap 16, padding 16, rayon 20
 |   étiquettes Familjen Grotesk SemiBold 12 / 14,88, interlettrage +0,96 px
 |              — POSITIF, seul endroit du site dans ce cas
 |   carte      440 × 602, padding 12, fond #ffffff, rayon 20 (343 en mobile)
 |   photo      416 × 369,5, padding 16, rayon 14
 |   badge      padding 4 8 6 6, fond #d8d3c6, rayon 128
 |   titre      STIX Two Text 32 / 35,2 / −3 %, #1c1917
 |
 | Feuille scopée sous `.cw-tun` : elle est chargée dans un thème qui a la
 | sienne, aucune règle ne doit fuir.
 */

.cw-tun {
    --cw-tun-marge: 80px 48px 48px;
    --cw-tun-fond: #d8d3c6;
    --cw-tun-blanc: #fff;
    --cw-tun-encre: #1c1917;
    --cw-tun-sombre: #2d3e46;
    --cw-tun-discret: #78716c;
    --cw-tun-trait: #d6d3d1;
    --cw-tun-carte: 440px;
    --cw-tun-titre-police: "STIX Two Text", Georgia, "Times New Roman", serif;

    box-sizing: border-box;
    padding: var(--cw-tun-marge);
    background: var(--cw-tun-fond);
    color: var(--cw-tun-encre);
    font-size: 16px;
    letter-spacing: -0.02em;
    line-height: 1.24;
}

.cw-tun *,
.cw-tun *::before,
.cw-tun *::after {
    box-sizing: inherit;
}

.cw-tun-avis {
    max-width: 1344px;
    margin: 0 auto 24px;
    padding: 0.9rem 1.2rem;
    border: 1px dashed #c9a227;
    border-radius: 12px;
    background: #fffbe6;
    color: #6b5900;
    font-size: 14px;
}

.cw-tun-titre {
    margin: 0 0 56px;
    color: var(--cw-tun-encre);
    font-family: var(--cw-tun-titre-police);
    font-size: 56px;
    font-weight: 400;
    letter-spacing: -0.03em;
    line-height: 1.1;
    text-align: center;
}

/* 20 px entre la barre et les cartes : le `gap` du Figma. */
.cw-tun-corps {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 1344px;
    margin: 0 auto;
}

/* ── La barre de réservation ─────────────────────────────────────────────── */

.cw-tun-barre {
    display: flex;
    gap: 24px;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 16px 48px;
    border-radius: 128px;
    background: var(--cw-tun-blanc);
}

.cw-tun-champs {
    display: flex;
    gap: 32px;
    align-items: center;
    min-width: 0;
}

.cw-tun-champ {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

/*
 | ⚠️ Interlettrage POSITIF, et c'est le seul endroit du site.
 |
 | Partout ailleurs la maquette resserre les lettres (−2 %, −3 %). Ici elle les
 | écarte de +0,96 px sur 12 px, soit +0,08 em : c'est ce qui rend lisible une
 | étiquette en petites capitales, où les lettres se toucheraient sinon.
 */
.cw-tun-etiquette {
    color: var(--cw-tun-encre);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.24;
    letter-spacing: 0.08em;
    line-height: 1.24;
    text-transform: uppercase;
}

.cw-tun-valeur {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--cw-tun-encre);
}

/*
 | Le champ de date, et le champ de texte qui le remplace quand il est vide :
 | memes reglages, pour que la bascule ne se voie pas.
 */
.cw-tun-valeur input[type="date"],
.cw-tun-valeur input[type="text"] {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    letter-spacing: inherit;
}

/*
 | L'icone native du selecteur est retiree : la maquette en pose une, a gauche,
 | et deux calendriers cote a cote n'ont pas de sens. C'est la notre qui ouvre le
 | selecteur, par `showPicker()`.
 */
.cw-tun-valeur input[type="date"]::-webkit-calendar-picker-indicator {
    display: none;
}

/*
 | Tout le champ est cliquable — le mot « Date » comme l'icone. Un visiteur vise
 | le libelle avant de viser un champ de saisie, et sur un telephone la zone
 | utile doit etre large.
 */
.cw-tun-champ--date {
    cursor: pointer;
}

.cw-tun-champ--date input {
    cursor: pointer;
}

/*
 | Le format est annonce aux lecteurs d'ecran, ou il est utile, sans etre
 | affiche deux fois a l'ecran, ou il l'est deja dans le champ.
 */
.cw-tun-hors-ecran {
    position: absolute;
    overflow: hidden;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    clip-path: inset(50%);
    white-space: nowrap;
}

.cw-tun-trait {
    flex: none;
    width: 1px;
    height: 40px;
    background: var(--cw-tun-trait);
}

/* ── Le compteur de convives ─────────────────────────────────────────────── */

.cw-tun-compteur {
    gap: 18px;
}

.cw-tun-pas {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--cw-tun-trait);
    border-radius: 50%;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: 1;
    cursor: pointer;
}

.cw-tun-pas:hover:not(:disabled) {
    border-color: var(--cw-tun-encre);
}

.cw-tun-pas:disabled {
    opacity: 0.35;
    cursor: default;
}

/*
 | Le champ garde ses flèches natives tant que le script n'a pas branché les
 | boutons : sans lui, elles sont le seul moyen de changer le nombre. La classe
 | `--js` les retire une fois les boutons vivants.
 */
.cw-tun-compteur input[type="number"] {
    width: 2.5ch;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: center;
}

.cw-tun--js .cw-tun-compteur input[type="number"] {
    appearance: textfield;
}

.cw-tun--js .cw-tun-compteur input::-webkit-outer-spin-button,
.cw-tun--js .cw-tun-compteur input::-webkit-inner-spin-button {
    margin: 0;
    appearance: none;
}

/* ── Les deux boutons de la barre ────────────────────────────────────────── */

.cw-tun-actions {
    display: flex;
    flex: none;
    gap: 8px;
    align-items: center;
}

.cw-tun-bouton {
    display: inline-flex;
    gap: 16px;
    align-items: center;
    padding: 16px 24px 16px 8px;
    border: 0;
    border-radius: 128px;
    font: inherit;
    font-weight: 500;
    letter-spacing: -0.02em;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.cw-tun-bouton--clair {
    background: transparent;
    color: var(--cw-tun-encre);
}

.cw-tun-bouton--sombre {
    padding-right: 16px;
    background: var(--cw-tun-sombre);
    color: var(--cw-tun-blanc);
}

.cw-tun-rond {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--cw-tun-fond);
    color: var(--cw-tun-sombre);
}

/* ── Les cartes ──────────────────────────────────────────────────────────── */

/*
 | Une grille plutôt qu'un `flex-wrap` : les cartes d'une même rangée gardent
 | ainsi la même hauteur, quelle que soit la longueur des titres. Le Figma pose
 | des cartes de 440 px ; `auto-fill` en met autant que la largeur permet, et
 | elles s'étirent pour occuper la ligne.
 */
.cw-tun-offres {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(var(--cw-tun-carte), 100%), 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cw-tun-offre {
    display: flex;
    flex-direction: column;
    padding: 12px;
    border-radius: 20px;
    background: var(--cw-tun-blanc);
}

/* ── La photo et ce qu'elle porte ────────────────────────────────────────── */

.cw-tun-photo {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    /* 416 × 369,5 dans la maquette, soit très exactement 9/8. */
    aspect-ratio: 416 / 369;
    padding: 16px;
    overflow: hidden;
    border-radius: 14px;
}

.cw-tun-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cw-tun-image--vide {
    background: linear-gradient(135deg, #3d4f5c, #232e33);
}

/*
 | Le badge d'etat, en haut a gauche de la photo. Meme pastille beige que la
 | maquette ; c'est la PASTILLE qui change de couleur, pas le fond.
 |
 | Pourquoi la pastille et non le fond : le badge se pose sur une photo
 | quelconque, et un fond vert ou rouge y serait tantot lisible tantot non. Le
 | beige tient sur tout, et le point suffit a distinguer les deux etats — avec le
 | mot a cote, qui reste la vraie information pour qui distingue mal les teintes.
 */
.cw-tun-etat {
    position: relative;
    display: inline-flex;
    gap: 6px;
    align-items: center;
    padding: 4px 10px 6px 8px;
    border-radius: 128px;
    background: var(--cw-tun-fond);
    color: var(--cw-tun-encre);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.24;
}

.cw-tun-point {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2f7a4a;
}

.cw-tun-etat.is-complet .cw-tun-point {
    background: #9a3b3b;
}

.cw-tun-reperes {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.cw-tun-repere {
    padding: 4px 10px;
    border-radius: 128px;
    background: rgb(0 0 0 / 45%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.24;
    /* Le texte se pose sur une photo quelconque : le fond translucide garantit
       le contraste là où la photo ne le garantit pas. */
    backdrop-filter: blur(2px);
}

/* ── La fiche ────────────────────────────────────────────────────────────── */

.cw-tun-fiche {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
}

.cw-tun-nom {
    margin: 0;
    color: var(--cw-tun-encre);
    font-family: var(--cw-tun-titre-police);
    font-size: 32px;
    font-weight: 400;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

/*
 | Les prix sont alignés sur la LIGNE DE BASE, pas au milieu : le « 70 € » est
 | plus gros que le « À partir de », et les centrer verticalement ferait flotter
 | le petit texte.
 */
.cw-tun-prix {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: baseline;
    margin: 0;
    font-size: 14px;
}

.cw-tun-prix-mot,
.cw-tun-prix-unite {
    color: var(--cw-tun-discret);
}

/*
 | Les deux prix sont a 20 px : le barre comme le vif. Ils heritaient des 14 px
 | du conteneur, ce qui les rendait deux fois plus discrets que dans la maquette
 | — or le prix est ce qu'on vient lire sur une carte.
 |
 | Seul l'interligne differe, 26 contre 24,8, et c'est la maquette.
 */
.cw-tun-prix-barre {
    color: var(--cw-tun-discret);
    font-size: 20px;
    line-height: 1.3;
    text-decoration: line-through;
}

.cw-tun-prix-vif {
    color: var(--cw-tun-encre);
    font-size: 20px;
    font-weight: 400;
    line-height: 1.24;
}

.cw-tun-places {
    margin: 0;
    color: var(--cw-tun-sombre);
    font-size: 14px;
    font-weight: 600;
}

/* Les deux actions sont collées en bas : les cartes d'une rangée alignent donc
   leurs boutons, même si un titre tient sur deux lignes. */
.cw-tun-choix {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: auto;
}

.cw-tun-reserver {
    display: block;
    padding: 14px 20px;
    border-radius: 128px;
    background: var(--cw-tun-sombre);
    color: var(--cw-tun-blanc);
    font-weight: 500;
    text-align: center;
    text-decoration: none;
}

.cw-tun-reserver:hover {
    filter: brightness(1.15);
}

/*
 | Indisponible : le bouton reste, avec le motif à la place du mot « Réserver ».
 | Ce n'est plus un lien — il n'y a nulle part où aller — et c'est pourquoi c'est
 | un `<span>` : un lien désactivé est une contradiction, et un bouton grisé qui
 | prend le focus est une promesse en l'air.
 */
.cw-tun-reserver.is-desactive {
    background: var(--cw-tun-trait);
    color: var(--cw-tun-discret);
    cursor: default;
}

.cw-tun-infos {
    display: block;
    padding: 10px;
    color: var(--cw-tun-encre);
    /* C'est un bouton dans la maquette, pas une note de bas de carte : 16 / 500. */
    font-size: 16px;
    font-weight: 500;
    line-height: 1.24;
    text-align: center;
    text-decoration: none;
}

.cw-tun-infos:hover {
    text-decoration: underline;
}

.cw-tun-offre.is-indisponible .cw-tun-photo {
    /* La photo se ternit, sans disparaître : l'offre existe, elle n'est
       simplement pas ouverte ce jour-là. */
    filter: grayscale(0.55);
}

/* ── Mobile ──────────────────────────────────────────────────────────────── */

/*
 | Valeurs de `Homepage - 375` : marge 64 16 16, titre 36 px, barre en COLONNE
 | avec un rayon de 20 au lieu de la gélule, cartes empilées.
 */
@media (max-width: 900px) {
    .cw-tun {
        --cw-tun-marge: 64px 16px 16px;
    }

    .cw-tun-titre {
        margin-bottom: 32px;
        font-size: 36px;
    }

    .cw-tun-barre {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
        padding: 16px;
        border-radius: 20px;
    }

    .cw-tun-champs {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    /* Les séparateurs deviennent horizontaux : entre deux champs empilés, un
       trait vertical de 40 px ne sépare plus rien. */
    .cw-tun-trait {
        width: 100%;
        height: 1px;
    }

    .cw-tun-champ {
        flex-direction: row;
        gap: 16px;
        align-items: center;
        justify-content: space-between;
    }

    .cw-tun-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cw-tun-bouton {
        justify-content: center;
        padding: 12px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cw-tun-reserver {
        transition: none;
    }
}
