/* ==========================================================================
   ALFATOUR — liste de résultats hôtels
   Porté du projet Votre Voyage (hotel-results.css) : en-tête de page, filtres
   (hf-), carte hôtel (hc-, générée par hotel-results.js), carte Leaflet (hm-)
   et écran de chargement (af-loader-). Palette AlfaTour.
   ========================================================================== */

/* Tokens sémantiques partagés (vert = annulation/disponibilité, ambre = sur demande) */
:root {
  --af-teal-ink: #1e7a44;
  --af-teal-soft: #e6f4ec;
  --af-gold-ink: #9a6b10;
  --af-gold-soft: #fdf4e2;
}

/* ---------- Page ---------- */
.hs-page { background: var(--af-canvas); color: var(--af-ink); }
.hs-top { background: #fff; border-bottom: 1px solid var(--af-line); padding: 12px 0 16px; }
.hs-top .breadcrumb { margin-bottom: 10px; font-size: 13px; }
.hs-top .breadcrumb a { color: var(--af-muted); text-decoration: none; }
.hs-top .breadcrumb a:hover { color: var(--af-red-hover); }
.hs-top .breadcrumb-item.active { color: var(--af-ink); }
.hs-title { margin: 0 0 14px; font-family: var(--af-font); font-size: 22px; font-weight: 700; letter-spacing: -.01em; color: var(--af-ink); }
.hs-title small { font-size: 14px; font-weight: 500; color: var(--af-muted); }
.hs-empty { padding: 24px; background: #fff; color: var(--af-ink); }
.hs-empty strong { display: block; margin-bottom: 4px; }
.hs-empty a { color: var(--af-red); font-weight: 500; }
.hs-more {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 24px; margin-top: 4px; border: 1px solid var(--af-red-hover); border-radius: 9px;
  background: #fff; color: var(--af-red-hover); font-size: 15px; font-weight: 500; cursor: pointer; transition: background-color .15s, color .15s;
}
.hs-more:hover { background: var(--af-red-hover); color: #fff; }

/* ---------- Surfaces communes de la page ---------- */
.hf,
.hs-empty,
.hs-map-tile,
.hc {
  border: 1px solid var(--af-line);
  border-radius: var(--af-radius);
  box-shadow: var(--af-shadow-sm);
  transition: box-shadow .2s ease;
}
.hs-map-tile:hover,
.hc:hover { box-shadow: var(--af-shadow); }

/* ---------- Vignette « Voir la carte » ---------- */
.hs-map-tile {
  position: relative; display: flex; align-items: flex-end; justify-content: flex-end; width: 100%; height: 120px; margin-bottom: 16px; padding: 10px;
  background: url(/images/search/mapscarte.jpg) center / cover; cursor: pointer;
}
.hs-map-tile span { padding: 7px 12px; border-radius: 8px; background: #fff; color: var(--af-ink); font-size: 13px; font-weight: 500; box-shadow: 0 2px 6px rgba(16, 24, 40, .2); }
.hs-map-tile:hover span { background: var(--af-red-hover); color: #fff; }

/* ---------- Filtres : colonne sur grand écran, panneau latéral en dessous de 992 px ---------- */
@media (min-width: 992px) {
  #offcanvasFilters { position: static; z-index: auto; width: auto; max-width: none; visibility: visible !important; transform: none; background: none; border: 0; }
  #offcanvasFilters .offcanvas-header { display: none; }
  #offcanvasFilters .offcanvas-body { padding: 0; overflow: visible; }
}
.hf { background: #fff; }
.hf-head { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--af-line); }
.hf-title { font-size: 16px; font-weight: 600; color: var(--af-ink); }
.hf-reset, .hf-clear { padding: 0; border: 0; background: none; color: var(--af-red-hover); font-size: 13px; font-weight: 500; cursor: pointer; }
.hf-reset:hover, .hf-clear:hover { text-decoration: underline; }
.hf-section { padding: 14px 16px; border-bottom: 1px solid var(--af-line); }
.hf-section:last-child { border-bottom: 0; }
.hf-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.hf-label { margin: 0; font-size: 14px; font-weight: 600; color: var(--af-ink); }
.hf-search { display: flex; gap: 6px; }
.hf-search .form-control { min-height: 40px; border-color: var(--af-line); border-radius: 8px; font-size: 14px; }
.hf-search .form-control:focus { border-color: var(--af-red); box-shadow: 0 0 0 3px rgba(var(--af-red-rgb), .15); }
.hf-search button { flex: none; padding: 0 14px; border: 0; border-radius: 8px; background: var(--af-red-hover); color: #fff; font-size: 13px; font-weight: 500; cursor: pointer; }
.hf-search button:hover { background-color: var(--af-red-dark); }
.hf-budget { display: block; margin-bottom: 6px; font-size: 15px; font-weight: 600; color: var(--af-ink); }
.hf-range { width: 100%; accent-color: var(--af-red); }
.hf-bounds { display: flex; justify-content: space-between; margin-top: 2px; font-size: 12px; color: var(--af-muted); }
.hf-stars { display: flex; flex-wrap: wrap; gap: 6px; }
.hf-star {
  display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 12px; margin: 0; border: 1px solid var(--af-line); border-radius: 8px;
  background: #fff; color: var(--af-ink-soft); font-size: 14px; font-weight: 400; cursor: pointer;
}
.hf-star .bi { color: var(--af-star); font-size: 12px; }
.hf-star:hover { border-color: var(--af-red); }
.btn-check:checked + .hf-star { background: var(--af-red-soft); border-color: var(--af-red); color: var(--af-red-hover); }
.btn-check:focus-visible + .hf-star { outline: 2px solid var(--af-red); outline-offset: 2px; }
.hf-check { display: flex; align-items: flex-start; gap: 8px; min-height: 30px; padding: 3px 0; margin: 0; font-size: 14px; font-weight: 400; color: var(--af-ink-soft); cursor: pointer; transition: color .15s; }
.hf-check:hover { color: var(--af-ink); }
.hf-check .form-check-input { flex: none; margin: 3px 0 0; }
.hf-check .form-check-input:checked { background-color: var(--af-red); border-color: var(--af-red); }
.hf-apply { display: none; padding: 12px 16px 16px; }
.hf-apply button { width: 100%; min-height: 44px; border: 0; border-radius: 9px; background: var(--af-red); color: #fff; font-size: 15px; font-weight: 500; cursor: pointer; }
.hf-apply button:hover { background-color: var(--af-red-hover); }
@media (max-width: 991.98px) { .hf-apply { display: block; } }

/* ---------- Carte hôtel ---------- */
.hc {
  --hc-chip: var(--af-canvas);
  margin-bottom: 16px;
  overflow: hidden;
  color: var(--af-ink);
}

.hc-main { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) {
  .hc-main { grid-template-columns: 240px minmax(0, 1fr) 190px; min-height: 220px; }
}
@media (min-width: 1200px) {
  .hc-main { grid-template-columns: 290px minmax(0, 1fr) 205px; }
}

/* Photo */
.hc-photo { position: relative; background: var(--hc-chip); min-height: 200px; }
.hc-photo-link { position: absolute; inset: 0; display: block; }
.hc-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hc .marketing-badge-af__icon { color: var(--af-red); }
.hc .marketing-badge-af { color: #fff; max-width: calc(100% - 20px); }

/* Infos */
.hc-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hc-title { margin: 0; font-family: var(--af-font); font-size: 18px; font-weight: 700; line-height: 1.3; letter-spacing: -.005em; }
.hc-title a { color: var(--af-ink); text-decoration: none; }
.hc-title a:hover { color: var(--af-red-hover); }
.hc-address {
  display: inline-flex; align-items: flex-start; gap: 6px; align-self: flex-start; max-width: 100%;
  padding: 0; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--af-muted); text-align: left; cursor: pointer;
}
.hc-address svg { flex: none; margin-top: 3px; color: var(--af-red); }
.hc-address:hover span { text-decoration: underline; color: var(--af-red-hover); }
.hc-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; padding: 0; list-style: none; }
.hc-tags li { font-size: 12px; font-weight: 500; color: var(--af-ink); background: var(--hc-chip); padding: 4px 10px; border-radius: 999px; }
.hc-tags .hc-tag-more { color: var(--af-muted); background: transparent; border: 1px solid var(--af-line); cursor: help; }
.hc-perk { margin: auto 0 0; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--af-teal-ink); }
.hc-perk svg { flex: none; }

/* Prix */
.hc-price {
  padding: 16px; display: flex; flex-direction: column; align-items: flex-end; text-align: right; gap: 2px;
  border-top: 1px solid var(--af-line);
}
@media (min-width: 768px) { .hc-price { border-top: 0; border-left: 1px solid var(--af-line); } }
.hc-board { font-size: 13px; color: var(--af-muted); }
.hc-from { margin-top: auto; font-size: 13px; color: var(--af-muted); }
.hc-amount { font-size: 25px; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; white-space: nowrap; }
.hc-amount small { font-size: 13px; font-weight: 500; }
.hc-total { font-size: 13px; color: var(--af-muted); margin-bottom: 10px; }
.hc-cta {
  align-self: stretch; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 10px;
  border-radius: 9px; background: var(--af-red); color: #fff !important; font-weight: 500; font-size: 14px; white-space: nowrap; text-decoration: none; transition: background-color .15s;
}
.hc-cta:hover { background: var(--af-red-hover); color: #fff !important; }
.hc-cta::after { content: ""; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-2px, -2px); transition: transform .15s; }
.hc-cta[aria-expanded="true"] { background: var(--af-red-soft); color: var(--af-red-hover) !important; }
.hc-cta[aria-expanded="true"]::after { transform: rotate(-135deg) translate(-2px, -2px); }

/* ---------- Mobile : photo en haut, prix et bouton sur une ligne ---------- */
@media (max-width: 767.98px) {
  .hc-photo { min-height: 170px; }
  .hc-body { padding: 12px 14px; gap: 6px; }
  .hc-title { font-size: 17px; }
  .hc-price { padding: 12px 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; text-align: left; column-gap: 12px; }
  .hc-price > * { grid-column: 1; }
  .hc-board { grid-row: 1; }
  .hc-from { grid-row: 2; margin-top: 0; }
  .hc-amount { grid-row: 3; font-size: 22px; }
  .hc-total { grid-row: 4; margin-bottom: 0; }
  .hc-cta { grid-column: 2; grid-row: 1 / span 4; align-self: end; padding: 0 14px; font-size: 14px; }
  .hs-title { font-size: 18px; margin-bottom: 10px; }
  .hs-title small { display: block; margin-top: 2px; font-size: 13px; }
  .hs-top .breadcrumb { display: none; }
  /* Le dernier résultat ne passe pas sous la barre Carte / Filtrer */
  #hotel_result_status { padding-bottom: 72px; }
}

/* ---------- Carte / Filtrer : barre fixée en bas, centrée par rapport à l'écran ---------- */
.bloc-sorts { position: fixed; left: 0; right: 0; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 1030; width: max-content; margin: 0 auto; pointer-events: none; }
.hs-fab {
  pointer-events: auto; display: inline-flex; align-items: stretch; border-radius: 999px; overflow: hidden;
  background: var(--af-red-hover); box-shadow: 0 6px 20px rgba(16, 24, 40, .28);
}
.hs-fab button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 18px; border: 0; background: none; color: #fff; font-size: 15px; font-weight: 500; }
.hs-fab button + button { border-left: 1px solid rgba(255, 255, 255, .25); }

/* ---------- Mobile : aucun élément de la liste ne doit élargir la page ---------- */
@media (max-width: 991.98px) {
  html, body { overflow-x: clip; }
  #products, .hc { min-width: 0; max-width: 100%; }
  .hc-title, .hc-address span, .marketing-badge-af__text { overflow-wrap: anywhere; }
}

/* ---------- Carte Leaflet dans un modal (hotel-map.js) ---------- */
.hm-modal .modal-header { align-items: flex-start; }
.hm-modal .modal-title { font-size: 20px; font-weight: 500; color: var(--af-ink); }
.hm-count { margin-top: 2px; font-size: 13px; color: var(--af-muted); }
.hm-modal .modal-body { position: relative; padding: 0; min-height: min(70vh, 640px); }
#map.hm-map { position: absolute; inset: 0; width: auto; height: auto; }
@media (max-width: 767.98px) { .hm-modal .modal-body { min-height: 0; } }
.hm-pin span {
  position: absolute; left: 0; top: 0; transform: translate(-50%, calc(-100% - 7px)); white-space: nowrap;
  padding: 6px 9px; border-radius: 999px; background: #fff; color: var(--af-ink); border: 1px solid var(--af-line);
  font-size: 12px; font-weight: 500; line-height: 1; box-shadow: 0 2px 6px rgba(16, 24, 40, .25); cursor: pointer;
}
.hm-pin span::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: #fff; }
.hm-pin:hover span, .hm-pin.is-active span { background: var(--af-red-hover); color: #fff; border-color: var(--af-red-hover); }
.hm-pin:hover span::after, .hm-pin.is-active span::after { border-top-color: var(--af-red-hover); }
.hm-pin:hover { z-index: 2000 !important; }
.hm-popup-wrap .leaflet-popup-content { margin: 8px; }
.hm-popup { display: flex; gap: 10px; width: 240px; color: var(--af-ink); text-decoration: none; }
.hm-popup img { width: 84px; height: 64px; object-fit: cover; border-radius: 6px; flex: none; }
.hm-popup strong { display: block; font-size: 13px; line-height: 1.3; }
.hm-popup em { display: flex; font-style: normal; }
.hm-popup em .bi { color: var(--af-star); }
.hm-popup small { display: block; margin-top: 2px; font-weight: 500; color: var(--af-red-hover); }

/* ---------- Accroche marketing sur la photo : une seule ligne, tronquée avec « … » ---------- */
.marketing-badge-af {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--af-red);
  color: #fff;
  border-radius: 25px;
  padding: 5px 12px 5px 6px;
  font-size: 12px;
  font-weight: 500;
  max-width: calc(100% - 20px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
  z-index: 5;
  line-height: 1.2;
}
.marketing-badge-af__icon {
  background: #fff;
  color: var(--af-red);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}
.marketing-badge-af__text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
@media (max-width: 767.98px) {
  .marketing-badge-af {
    border-radius: 14px;
    padding: 5px 10px 5px 6px;
    font-size: 10.5px;
    max-width: calc(100% - 16px);
    gap: 5px;
  }
  .marketing-badge-af__icon {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }
}

/* ---------- Écran de chargement de la recherche ---------- */
.af-loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at top, rgba(var(--af-red-rgb), .18) 0%, rgba(15, 23, 42, .55) 70%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: afLoaderFadeIn .35s ease both;
}
.af-loader-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s ease;
}
.af-loader-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: var(--af-radius);
  padding: 36px 32px 28px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(15, 23, 42, .35), 0 2px 6px rgba(15, 23, 42, .08);
  overflow: hidden;
  animation: afLoaderPop .45s cubic-bezier(.2, .9, .35, 1.25) both;
}
.af-loader-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(var(--af-red-rgb), .08), rgba(35, 43, 56, .06));
  pointer-events: none;
}
.af-loader-logo-wrap {
  position: relative;
  width: 150px;
  height: 150px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.af-loader-logo {
  max-width: 92px;
  max-height: 92px;
  width: auto;
  height: auto;
  object-fit: contain;
  animation: afLoaderPulse 2.2s ease-in-out infinite;
  z-index: 2;
}
.af-loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--af-red);
  border-right-color: var(--af-red);
  animation: afLoaderSpin 1.4s linear infinite;
}
.af-loader-ring--inner {
  inset: 14px;
  border: 3px solid transparent;
  border-bottom-color: var(--af-ink);
  border-left-color: var(--af-ink);
  animation: afLoaderSpin 1.8s linear reverse infinite;
}
.af-loader-title {
  position: relative;
  font-size: 18px;
  font-weight: 500;
  color: var(--af-ink);
  margin: 0 0 6px;
  line-height: 1.35;
}
.af-loader-city {
  color: var(--af-red);
  font-weight: 500;
}
.af-loader-sub {
  position: relative;
  color: var(--af-muted);
  font-size: 13px;
  margin: 0 0 18px;
}
.af-loader-meta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
}
.af-loader-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--af-canvas);
  border: 1px solid var(--af-line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--af-ink-soft);
  white-space: nowrap;
}
.af-loader-chip i {
  color: var(--af-red);
  font-size: 12px;
}
.af-loader-chip strong {
  font-weight: 500;
  color: var(--af-ink);
}
.af-loader-bar {
  position: relative;
  width: 100%;
  height: 4px;
  background: var(--af-line);
  border-radius: 999px;
  overflow: hidden;
}
.af-loader-bar > span {
  position: absolute;
  top: 0;
  left: -40%;
  height: 100%;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--af-red), var(--af-ink));
  animation: afLoaderBar 1.6s cubic-bezier(.4, 0, .2, 1) infinite;
}

@keyframes afLoaderSpin {
  to { transform: rotate(360deg); }
}
@keyframes afLoaderPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
@keyframes afLoaderBar {
  0%   { left: -40%; }
  100% { left: 100%; }
}
@keyframes afLoaderFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes afLoaderPop {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 576px) {
  .af-loader-card { padding: 28px 20px 22px; }
  .af-loader-logo-wrap { width: 120px; height: 120px; }
  .af-loader-logo { max-width: 72px; max-height: 72px; }
  .af-loader-title { font-size: 16px; }
  .af-loader-chip { font-size: 11.5px; padding: 5px 10px; }
}

/* ==========================================================================
   Pages encore sur l'ancien markup (sélection, favoris) — à retirer lors de
   leur refonte. Cartes hôtels verticales et salles de base.
   ========================================================================== */

.hotels-list-item {
  border: 1px solid var(--af-line) !important;
  border-radius: var(--af-radius-lg);
  background-color: #fff;
  box-shadow: var(--af-shadow-sm);
  overflow: hidden;
  transition: box-shadow .25s ease, transform .25s ease;
}

.hotels-list-item:hover {
  box-shadow: var(--af-shadow);
  transform: translateY(-3px);
}

.hotels-list-item figure {
  margin: 0;
  overflow: hidden;
}

.hotels-list-item .h-250 {
  width: 100%;
  height: 210px;
  object-fit: cover;
  transition: transform .45s ease;
}

.hotels-list-item:hover .h-250 {
  transform: scale(1.04);
}

.hotels-list-item .card-body {
  padding: 16px 16px 10px;
}

.hotels-list-item h4 {
  font-family: var(--af-font);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
}

.hotels-list-item .card-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--af-line);
  background-color: transparent;
}

.room-card {
  border: 1px solid var(--af-line) !important;
  border-radius: var(--af-radius-sm);
  background-color: #fff;
}

.room-card + .room-card {
  margin-top: 10px;
}

.room-card .badge {
  border-radius: 999px;
  font-weight: 500;
}

/* Cœur favoris des anciennes pages (favoris, inc/item) */
.pos-fav {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
}

.pos-fav .btn-favoris {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: rgba(20, 24, 32, .5);
  color: #fff;
  transition: background-color var(--af-ease);
}

.pos-fav .btn-favoris:hover {
  background-color: var(--af-red);
}
