:root {
    --bw-primary: #2d5016;
    --bw-primary-light: #e8f0e2;
    --bw-accent: #8b6914;
    --bw-accent-light: #f5f0e0;
    --bw-text: #1a1a1a;
    --bw-text-light: #6b7280;
    --bw-border: #e5e7eb;
    --bw-bg: #ffffff;
    --bw-bg-light: #f9fafb;
    --bw-danger: #dc2626;
    --bw-success: #16a34a;
    --bw-radius: 8px;
    --bw-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.bw-widget { font-family: 'Inter', -apple-system, sans-serif; color: var(--bw-text); }
.bw-widget * { box-sizing: border-box; margin: 0; padding: 0; }

.bw-main { display: flex; gap: 24px; align-items: flex-start; }

.bw-calendar-section { flex: 1; min-width: 0; }
.bw-sidebar { width: 320px; flex-shrink: 0; position: sticky; top: 20px; }

.bw-calendar-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; padding: 0 4px;
}
.bw-month-title { font-size: 18px; font-weight: 600; }
.bw-nav-btn {
    background: var(--bw-bg); border: 1px solid var(--bw-border); border-radius: var(--bw-radius);
    padding: 8px 14px; cursor: pointer; font-size: 16px; transition: all 0.15s;
}
.bw-nav-btn:hover { background: var(--bw-primary); color: white; border-color: var(--bw-primary); }

.bw-calendars-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.bw-calendar { background: var(--bw-bg); border: 1px solid var(--bw-border); border-radius: var(--bw-radius); padding: 16px; }
.bw-month-name { font-weight: 600; font-size: 15px; text-align: center; margin-bottom: 12px; color: var(--bw-primary); }

.bw-day-names { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; margin-bottom: 8px; }
.bw-day-names span { font-size: 12px; font-weight: 500; color: var(--bw-text-light); padding: 4px 0; }

.bw-day-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }

.bw-day {
    aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    border-radius: 6px; cursor: default; position: relative; font-size: 14px; transition: all 0.1s;
    min-height: 44px;
}
.bw-day-num { font-weight: 500; line-height: 1; }
.bw-day-price { font-size: 10px; color: var(--bw-text-light); margin-top: 2px; }

.bw-day-empty { visibility: hidden; }
.bw-day-past { color: #d1d5db; }
.bw-day-booked { background: #fef2f2; color: #fca5a5; text-decoration: line-through; }
.bw-day-available { cursor: pointer; }
.bw-day-available:hover { background: var(--bw-primary-light); }

.bw-day-selected { background: var(--bw-primary) !important; color: white !important; }
.bw-day-selected .bw-day-price { color: rgba(255,255,255,0.8); }

.bw-day-in-selection { background: var(--bw-primary-light); }

.bw-legend { display: flex; gap: 16px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.bw-legend-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--bw-text-light); }
.bw-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.bw-dot-available { background: var(--bw-primary-light); border: 1px solid var(--bw-primary); }
.bw-dot-booked { background: #fef2f2; border: 1px solid #fca5a5; }
.bw-dot-selected { background: var(--bw-primary); }

/* Cart / Sidebar */
.bw-cart {
    background: var(--bw-bg); border: 1px solid var(--bw-border);
    border-radius: var(--bw-radius); padding: 20px; box-shadow: var(--bw-shadow);
}
.bw-cart-title { font-size: 18px; font-weight: 600; margin-bottom: 16px; }
.bw-empty-cart { color: var(--bw-text-light); font-size: 14px; text-align: center; padding: 20px 0; }

.bw-period-card {
    background: var(--bw-bg-light); border-radius: 6px; padding: 12px;
    margin-bottom: 8px; border: 1px solid var(--bw-border);
}
.bw-period-dates { display: flex; justify-content: space-between; align-items: center; font-weight: 500; font-size: 14px; }
.bw-period-detail { font-size: 13px; color: var(--bw-text-light); margin-top: 4px; }
.bw-period-price { font-weight: 600; font-size: 15px; margin-top: 4px; color: var(--bw-primary); }
.bw-period-remove {
    background: none; border: none; color: var(--bw-danger); cursor: pointer;
    font-size: 18px; padding: 0 4px; line-height: 1;
}
.bw-period-remove:hover { opacity: 0.7; }

.bw-add-period-hint { margin: 12px 0; }

.bw-cart-summary { border-top: 1px solid var(--bw-border); padding-top: 12px; margin-top: 12px; }
.bw-summary-line { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; }
.bw-summary-line.bw-discount { color: var(--bw-success); }
.bw-summary-total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 700; padding: 8px 0; margin-top: 4px; border-top: 2px solid var(--bw-text); }

/* Buttons */
.bw-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; border-radius: var(--bw-radius); font-size: 14px;
    font-weight: 500; cursor: pointer; transition: all 0.15s; border: none; width: 100%;
}
.bw-btn-primary { background: var(--bw-primary); color: white; margin-top: 12px; font-size: 16px; padding: 14px; }
.bw-btn-primary:hover { opacity: 0.9; }
.bw-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.bw-btn-outline { background: transparent; border: 1px dashed var(--bw-border); color: var(--bw-text-light); }
.bw-btn-outline:hover { border-color: var(--bw-primary); color: var(--bw-primary); }
.bw-btn-full { width: 100%; }

/* Form modal */
.bw-form-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center;
    z-index: 9999; padding: 20px;
}
.bw-form-modal {
    background: var(--bw-bg); border-radius: 12px; padding: 32px;
    max-width: 600px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative;
}
.bw-form-modal h3 { font-size: 22px; margin-bottom: 24px; }
.bw-form-close {
    position: absolute; top: 16px; right: 16px; background: none; border: none;
    font-size: 28px; cursor: pointer; color: var(--bw-text-light); line-height: 1;
}
.bw-form-close:hover { color: var(--bw-text); }

.bw-form-section { margin-bottom: 24px; }
.bw-form-section h4 { font-size: 16px; margin-bottom: 12px; color: var(--bw-primary); }
.bw-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bw-form-group { margin-bottom: 12px; }
.bw-form-group label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; color: var(--bw-text-light); }
.bw-form-group input, .bw-form-group textarea, .bw-form-group select {
    width: 100%; padding: 10px 12px; border: 1px solid var(--bw-border); border-radius: 6px;
    font-size: 14px; font-family: inherit; transition: border-color 0.15s;
}
.bw-form-group input:focus, .bw-form-group textarea:focus {
    outline: none; border-color: var(--bw-primary); box-shadow: 0 0 0 3px var(--bw-primary-light);
}

/* Toggle */
.bw-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-bottom: 16px; }
.bw-toggle input { width: 18px; height: 18px; accent-color: var(--bw-primary); }
.bw-toggle-label { font-weight: 500; font-size: 15px; }

/* Payment options */
.bw-payment-options { display: flex; flex-direction: column; gap: 8px; }
.bw-payment-option { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.bw-payment-option input { margin-top: 4px; accent-color: var(--bw-primary); }
.bw-payment-card {
    flex: 1; padding: 12px; border: 1px solid var(--bw-border); border-radius: 6px;
    transition: border-color 0.15s;
}
.bw-payment-option input:checked + .bw-payment-card { border-color: var(--bw-primary); background: var(--bw-primary-light); }
.bw-payment-card strong { display: block; font-size: 14px; }
.bw-payment-card small { color: var(--bw-text-light); font-size: 12px; }

/* Recap in form */
.bw-form-recap { background: var(--bw-bg-light); border-radius: 6px; padding: 16px; }
.bw-recap-line { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 0; }
.bw-recap-line.bw-discount { color: var(--bw-success); }
.bw-recap-total { display: flex; justify-content: space-between; font-size: 16px; font-weight: 700; padding-top: 8px; margin-top: 8px; border-top: 1px solid var(--bw-border); }

/* Confirmation */
.bw-confirmation {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.bw-confirm-content {
    background: var(--bw-bg); border-radius: 12px; padding: 40px; text-align: center;
    max-width: 500px; width: 100%;
}
.bw-confirm-icon { font-size: 48px; color: var(--bw-success); margin-bottom: 16px; }
.bw-confirm-content h3 { font-size: 24px; margin-bottom: 12px; }
.bw-confirm-content p { font-size: 15px; color: var(--bw-text-light); margin-bottom: 8px; }

.bw-virement-info {
    text-align: left; background: var(--bw-accent-light); padding: 16px; border-radius: 6px;
    margin-top: 16px; font-size: 14px;
}
.bw-virement-info h4 { margin-bottom: 8px; color: var(--bw-accent); }
.bw-virement-info p { margin-bottom: 4px; color: var(--bw-text); }

/* Responsive */
@media (max-width: 900px) {
    .bw-main { flex-direction: column; }
    .bw-sidebar { width: 100%; position: static; }
    .bw-calendars-grid { grid-template-columns: 1fr; }
    .bw-form-row { grid-template-columns: 1fr; }
    .bw-form-modal { padding: 20px; }
    /* FIX (27/07, audit visuel mobile) : inputs a 14px = auto-zoom iOS Safari
       au focus. 16px minimum sur tablette/mobile, desktop inchange. */
    .bw-form-group input, .bw-form-group textarea, .bw-form-group select { font-size: 16px; }
}

/* FIX (27/07, audit visuel mobile) : leger scroll horizontal a 375px
   (scrollWidth ~382-394px, elements .bw-calendar-*) sur le parcours de
   reservation directe. Reduction des paddings du widget en tres petit
   ecran — additif, aucune regle existante modifiee. */
@media (max-width: 480px) {
    .bw-calendar-section { max-width: 100%; }
    .bw-calendar { padding: 10px; }
    .bw-calendar-header { padding: 0; }
    .bw-nav-btn { padding: 8px 10px; }
    .bw-calendars-grid { gap: 16px; }
    .bw-main { gap: 16px; }
}

/* 18/10/2026 (revue des vitrines, lot 1, rapport § 1.2) : le calendrier tient dans son cadre.
   Le widget vit dans un cadre de ~670 px utiles (sections/reservation.php, max-width 820 px +
   overflow-x:hidden), pas dans une page pleine largeur. aspect-ratio:1 + min-height:44px
   imposaient aussi 44 px de LARGEUR minimale par jour (354 px par mois) et le panier n'allait
   sous les mois que si l'ECRAN faisait moins de 900 px : sur PC le 2e mois passait sous le
   panier (dimanches hors cadre, non cliquables), sur telephone le dimanche etait rogne de 16 px,
   sur tablette le calendrier restait cale a gauche.
   Additif, DOIT rester a la fin du fichier (il l'emporte sur les regles ci-dessus a egalite de
   specificite). Les FIX du 27/07 restent en place ; le cadre overflow-x:hidden est garde. */
.bw-day-grid, .bw-day-names { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.bw-day { aspect-ratio: auto; min-width: 0; }
.bw-calendars-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* panier SOUS les mois quel que soit l'ecran (le cadre est trop etroit pour mois + panier cote a cote) */
.bw-main { flex-direction: column; align-items: stretch; }
.bw-sidebar { width: 100%; position: static; }
@media (max-width: 900px) { .bw-calendars-grid { grid-template-columns: minmax(0, 1fr); } }
/* 18/10/2026 (lot 1, rapport § 1.3) : la fenetre « Finaliser la reservation » est desormais calee sur
   l'ecran (fin de style.css). A z-index egal (9999), le bandeau cookies, place apres dans la page,
   passait DEVANT elle : sur telephone, tant que le voyageur n'avait pas choisi, le bandeau couvrait
   le bas de la fenetre et le bouton « Confirmer la reservation » n'etait pas cliquable. La fenetre
   passe au-dessus pendant qu'elle est ouverte ; le bandeau revient a sa fermeture. */
.bw-form-overlay, .bw-confirmation { z-index: 10000; }
/* 18/10/2026 (revue des vitrines, lot 4, rapport § 1.4, 1.8 et 1.13) : nouveau geste « 1er clic :
   arrivee — 2e clic : depart ». Reperes de la selection en cours, depart possible sur un jour reserve,
   messages du panier, fleches de navigation bornees. Additif : aucune regle ci-dessus n'est modifiee
   (les proprietes du bloc du lot 1 — grilles, .bw-day, panier — ne sont pas touchees). */
.bw-consigne { text-align: center; font-size: 13px; color: var(--bw-text-light); margin: -6px 0 12px; line-height: 1.4; }
.bw-consigne-alerte { color: #b91c1c; }
.bw-day-arrivee, .bw-day-depart, .bw-day-depart-apercu { box-shadow: inset 0 0 0 2px var(--bw-primary); }
.bw-day-arrivee { font-weight: 700; }
.bw-day-booked.bw-day-depart-possible { cursor: pointer; text-decoration: none; }
.bw-day-booked.bw-day-depart-possible:hover { background: var(--bw-primary-light); }
.bw-day-trop-tot { opacity: 0.45; }
.bw-nav-btn:disabled, .bw-nav-btn:disabled:hover {
    opacity: 0.35; cursor: not-allowed; background: var(--bw-bg); color: inherit; border-color: var(--bw-border);
}
.bw-cart-msg { color: #b91c1c; font-size: 14px; text-align: center; margin: 8px 0; }
.bw-devis-erreur { color: #b91c1c; font-size: 14px; margin: 8px 0; }
.bw-devis-reessayer { margin-bottom: 4px; }
/* Relecture du lot 4 (18/10/2026) : sur telephone (mois l'un sous l'autre, 900 px et moins), la
   consigne au-dessus des mois porte plusieurs messages du nouveau geste (jour reserve tape sans
   arrivee, 2e tap sur le meme jour, arrivee refusee, minimum de nuits, « Vérification des
   disponibilités… »). Quand on tape dans le 2e mois, elle etait hors de l'ecran (tk18 en 390 x 844 :
   haut a -137 px et -210 px) : le tap semblait sans effet. Elle reste donc visible sous l'en-tete
   colle du site (.vf-header : 72 px + 1 px de bordure) tant que les mois sont a l'ecran.
   Le cadre du widget (sections/reservation.php, style en ligne overflow-x:hidden, garde) fait de lui
   un conteneur de defilement : position:sticky n'y colle jamais (mesure : -207 px). overflow-x:clip
   coupe le debordement horizontal exactement comme hidden, sans creer de conteneur de defilement ;
   un navigateur qui ne connait pas clip ou :has() ignore la regle et garde hidden (rendu d'avant).
   Additif, sous 900 px seulement : le PC est inchange. */
@media (max-width: 900px) {
    div:has(> #booking-widget) { overflow-x: clip !important; }
    .bw-consigne { position: sticky; top: 73px; z-index: 5; background: var(--bw-bg); padding: 6px 0; }
}
/* 18/10/2026 (revue des vitrines, lot 5, rapport § 1.13) : finitions. Additif, DOIT rester a la fin du
   fichier : aucune regle ci-dessus n'est modifiee (FIX du 27/07, blocs des lots 1 et 4 intacts).
   1. Police : les titres du widget (« Votre séjour », « Finaliser la réservation », « Récapitulatif »…)
      heritaient de Cormorant Garamond (style.css, h1-h6) au milieu d'un widget en Inter. */
.bw-widget h1, .bw-widget h2, .bw-widget h3, .bw-widget h4 { font-family: inherit; letter-spacing: normal; }
.bw-widget input, .bw-widget textarea, .bw-widget select, .bw-widget button { font-family: inherit; }
/* 2. Jours : « Passé » (gris lisible, contraste 1,47:1 avant), « Réservé » (rouge lisible, 1,74:1 avant),
      « Indisponible » (nuit fermee ou non cotee sans reservation, hachuree). Pendant l'apercu d'une
      selection, un jour reserve garde sa couleur et s'entoure de rouge : le conflit reste visible
      (avant, .bw-day-in-selection le peignait en vert « sélection »). */
.bw-day-past { color: #8b919b; }
.bw-day-booked { background: #fee2e2; color: #b91c1c; }
.bw-day-booked.bw-day-closed {
    background: repeating-linear-gradient(135deg, #f3f4f6 0 5px, #e5e7eb 5px 10px); color: #4b5563;
}
.bw-day-booked.bw-day-in-selection { background: #fee2e2; box-shadow: inset 0 0 0 2px #b91c1c; }
.bw-day-booked.bw-day-closed.bw-day-in-selection {
    background: repeating-linear-gradient(135deg, #f3f4f6 0 5px, #e5e7eb 5px 10px);
}
.bw-day-price { white-space: nowrap; }
/* prix a 4 chiffres (« 1500 € ») dans les cases de 29 a 33 px des ecrans de moins de 360 px */
@media (max-width: 359px) { .bw-day-price { font-size: 9px; } }
/* 3. Legende : chaque pastille a l'aspect des jours qu'elle decrit (la pastille « Disponible » etait
      verte alors que les jours libres sont blancs) ; « Indisponible » et « Passé » ajoutes. */
.bw-dot-available { background: var(--bw-bg); border: 1px solid #9ca3af; }
.bw-dot-booked { background: #fee2e2; border: 1px solid #b91c1c; }
.bw-dot-closed { background: repeating-linear-gradient(135deg, #f3f4f6 0 2px, #9ca3af 2px 3px); border: 1px solid #6b7280; }
.bw-dot-past { background: #d1d5db; border: 1px solid #8b919b; }
.bw-legend { gap: 8px 16px; }
/* 4. Disponibilites en panne : le message prend toute la largeur, la 2e case de mois (vide) est masquee
      (avant : un cadre vide a cote du message). */
.bw-calendar.bw-calendar-vide { display: none; }
.bw-calendar.bw-calendar-erreur { grid-column: 1 / -1; }
/* 5. Relecture du lot 5 (18/10/2026, revue du code C11) : sous 480 px, le titre du calendrier est abrege
      (« Oct. — Nov. 2026 », booking.js titreMoisCourt) et tient sur une ligne. Sous 360 px seulement
      (iPhone SE 1re generation), le plus long (« Janv. — Févr. 2027 », 166 px en 18 px) depassait de
      2 px les 164 px laisses par les fleches : 17 px. */
@media (max-width: 359px) { .bw-month-title { font-size: 17px; } }

/* Correcteur final des vitrines (18/10/2026, relecture finale, constat 7) : une case du calendrier atteinte au
   CLAVIER (Tab) montre un contour net. :focus-visible : jamais au clic de la souris ni au doigt. */
.bw-day[tabindex]:focus-visible { outline: 3px solid var(--bw-primary); outline-offset: 1px; position: relative; z-index: 1; }
.bw-form-close:focus-visible { outline: 3px solid var(--bw-primary); outline-offset: 2px; }
