/* ═══════════════════════════════════════════════════════════════════════════
   widget-reservation.css — Widget de réservation produit (pages locations)
   Toutes les classes sont préfixées .wresa- pour éviter les conflits CSS
   ═══════════════════════════════════════════════════════════════════════════ */

.wresa {
    --orange:     #E8802A;
    --teal:       #0097b2;
    --teal-dark:  #007a90;
    --text-dark:  #2C2C2C;
    --text-mid:   #555555;
    --text-light: #888888;
    --border:     #E0E0E0;
    --red:        #C0392B;

    max-width: 1280px;
    margin: 30px auto;
    font-family: "open_sanslight", -apple-system, sans-serif;
    color: var(--text-dark);
    box-sizing: border-box;
    scroll-margin-top: 140px; /* menu fixe */
}

.wresa *, .wresa *::before, .wresa *::after { box-sizing: border-box; }

.wresa-error,
.wresa-empty {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px 22px;
    font-size: 14px;
    color: var(--text-mid);
    margin: 12px 0;
}

.wresa-error { border-color: #F5C6C2; color: var(--red); background: #FEF2F1; }

/* ── Formulaire ─────────────────────────────────────────────────────────── */
.wresa-form {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 20px 26px;
    margin-bottom: 0;
}

.wresa-radio {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    margin: 4px 0;
}

.wresa-radio input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 26px;
    height: 26px;
    min-width: 26px;
    border: 2px solid #bbb;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    cursor: pointer;
    background: #fff;
    margin: 0;
}

.wresa-radio input[type="radio"]:checked { border-color: var(--teal); }

.wresa-radio input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 4px; right: 4px; bottom: 4px; left: 4px;
    border-radius: 50%;
    background: var(--teal);
}

.wresa-mode__title {
    font-size: 15px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--teal);
    font-weight: 600;
}

.wresa-mode__title--orange { color: var(--orange); }

.wresa-separator {
    height: 1px;
    background: var(--teal);
    opacity: .4;
    margin: 14px 0;
}

.wresa-fields {
    display: flex;
    gap: 22px;
    flex-wrap: wrap;
    padding: 14px 0 6px 40px;
}

.wresa-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 180px;
}

.wresa-field label {
    font-size: 14px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--teal);
    font-weight: 600;
}

.wresa-field select,
.wresa-field input[type="date"] {
    padding: 10px 12px;
    border: 1px solid #bbb;
    border-radius: 3px;
    font-size: 15px;
    color: var(--text-dark);
    background: #fff;
    width: 100%;
    cursor: pointer;
}

.wresa-field--submit { justify-content: flex-end; flex: 0 0 auto; min-width: 140px; }

.wresa-btn-search {
    padding: 11px 26px;
    background: var(--orange);
    color: #fff;
    border: 0;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    cursor: pointer;
}

.wresa-btn-search:hover { filter: brightness(.94); }

/* ── État de chargement (mise à jour AJAX sans rechargement) ────────────── */
.wresa-results { position: relative; min-height: 40px; }

.wresa-results.wresa-loading { pointer-events: none; }
.wresa-results.wresa-loading > * { opacity: .45; }

.wresa-results.wresa-loading::after {
    content: 'Chargement des disponibilités…';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 14px;
    color: var(--text-mid);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .10);
    white-space: nowrap;
    z-index: 2;
}

/* ── Onglets mois ───────────────────────────────────────────────────────── */
.wresa-tabs {
    display: flex;
    gap: 4px;
    margin-top: 26px;
}

.wresa-tab {
    flex: 1;
    text-align: center;
    padding: 16px 10px;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: .04em;
    text-decoration: none;
    border-radius: 6px 6px 0 0;
}

.wresa-tab--active {
    background: #fff;
    color: var(--text-dark);
    border: 1px solid var(--border);
    border-bottom: none;
}

a.wresa-tab,
a.wresa-tab:visited,
a.wresa-tab:hover {
    background: var(--orange);
    color: #fff;
    text-decoration: none;
}

a.wresa-tab:hover { filter: brightness(.94); }

/* ── Grille des semaines (entête de dates + une ligne par produit) ──────── */
.wresa-scroll { overflow-x: auto; }

.wresa-grid {
    display: grid;
    /* grid-template-columns et min-width sont posés en inline (dépendent du
       nombre de colonnes) ; --wresa-prod-col est réduite en mobile ci-dessous. */
    background: #fff;
    border: 1px solid var(--border);
    border-top: none;
}

.wresa-corner { background: #fff; }

.wresa-head {
    padding: 14px 8px;
    text-align: center;
    font-size: 14px;
    color: var(--text-dark);
    background: #fff;
    border-left: 1px solid var(--border);
}

.wresa-product {
    position: relative;
    min-height: 190px;
    background: #e8e8e8;
    overflow: hidden;
    border-top: 1px solid var(--border);
}

.wresa-product img {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wresa-product__name {
    position: relative;
    display: block;
    padding: 14px 12px;
    font-size: 16px;
    font-weight: 700;
    color: var(--orange);
    text-align: center;
    background: rgba(255, 255, 255, .72); /* bandeau translucide : lisible sur toute photo */
    text-shadow: 0 1px 2px rgba(255,255,255,.8);
    z-index: 1;
}

.wresa-cell {
    position: relative;
    background: #f5f5f5;
    padding: 34px 10px 18px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
}

/* Dates dupliquées dans chaque cellule : réservées à l'affichage mobile */
.wresa-cell__dates { display: none; }

.wresa-cell__main,
.wresa-cell__action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.wresa-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--orange);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    padding: 7px 12px;
}

.wresa-badge--inline { position: static; display: inline-block; border-radius: 3px; }

.wresa-col__from {
    font-size: 14px;
    color: var(--text-dark);
    margin: 0;
}

.wresa-col__original {
    font-size: 14px;
    color: var(--text-light);
    text-decoration: line-through;
}

.wresa-col__price {
    font-size: 21px;
    font-weight: 700;
    color: var(--teal);
}

.wresa-btn-reserve {
    display: inline-block;
    margin-top: 8px;
    padding: 9px 18px;
    background: var(--orange);
    color: #fff;
    border-radius: 3px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.wresa-btn-reserve:visited,
.wresa-btn-reserve:hover {
    color: #fff;
    text-decoration: none;
}

.wresa-btn-reserve:hover { filter: brightness(.94); }

.wresa-full {
    font-size: 15px;
    color: var(--text-dark);
    margin: 6px 0 0;
}

/* ── Résultat dates exactes (une carte par produit) ─────────────────────── */
.wresa-single {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 22px 26px;
    margin-top: 14px;
}

.wresa-single__prod {
    font-size: 15px;
    font-weight: 700;
    color: var(--orange);
    flex: 1 1 200px;
}

.wresa-single__dates { font-size: 15px; color: var(--text-dark); }

.wresa-single__price-block { text-align: center; }

.wresa-single__action { text-align: center; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
    .wresa-fields { padding-left: 0; }
    .wresa-mode__title { font-size: 13px; }
    .wresa-tab { font-size: 14px; padding: 12px 8px; }

    /* ── Grille → empilement en colonne ─────────────────────────────────
       Photo du produit en pleine largeur, puis une carte par semaine :
       dates à gauche, prix au centre, action à droite, badge en haut.  */
    .wresa-grid {
        display: block;
        min-width: 0 !important; /* neutralise le min-width inline calculé pour la grille */
    }

    .wresa-corner,
    .wresa-head { display: none; }

    .wresa-product {
        min-height: 240px;
        border-top: none;
    }

    .wresa-product__name { font-size: 15px; }

    .wresa-cell {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        text-align: left;
        border-left: none;
        padding: 48px 14px 20px; /* espace pour le badge promo en haut à droite */
    }

    .wresa-cell__dates {
        display: block;
        font-size: 15px;
        color: var(--text-dark);
        min-width: 92px;
    }

    .wresa-cell__main { flex: 1; }

    .wresa-btn-reserve { margin-top: 0; padding: 11px 16px; }
}
