/* ==========================================================================
   Widget de réservation maison (données Salonized / Treatwell)
   ========================================================================== */

.resa {
  width: 520px;
  max-width: calc(100vw - 24px);
  height: min(760px, calc(100vh - 24px));
  height: min(760px, calc(100dvh - 24px));
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: #fff;
  color: #151515;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
  overflow: hidden;
}
.resa::backdrop { background: rgba(0, 0, 0, .7); }
.resa[open] { animation: resa-entree .25s ease-out; }
@keyframes resa-entree { from { opacity: 0; transform: translateY(16px); } }

.resa__boite {
  display: flex;
  flex-direction: column;
  height: 100%;
  font-family: var(--f-texte);
  font-size: 15px;
}

/* --- En-tête du widget --- */
.resa__tete {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  min-height: 60px;
  padding: 0 8px;
  border-bottom: 1px solid #eee;
}
.resa__tete h2 {
  font-family: var(--f-titre);
  font-weight: 700;
  font-size: 18px;
  text-align: center;
}
.resa__icone {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 0; border-radius: 50%;
  font-size: 22px; line-height: 1; color: #151515;
  cursor: pointer;
}
.resa__icone:hover { background: #f2f2f2; }
.resa__icone[hidden] { visibility: hidden; display: flex; }

.resa__etapes { display: flex; gap: 4px; padding: 0 16px; }
.resa__etapes span { flex: 1; height: 3px; margin-top: -1px; background: #eee; border-radius: 2px; }
.resa__etapes span.fait { background: #151515; }

/* --- Corps --- */
.resa__corps { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.resa__pied {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid #eee;
  background: #fff;
}
.resa__pied[hidden] { display: none; }
.resa__total small { display: block; font-size: 12px; color: #777; }
.resa__total strong { font-family: var(--f-titre); font-size: 22px; }

.resa__btn {
  padding: 13px 22px;
  background: #151515; color: #fff;
  border: 0; border-radius: 8px;
  font: 600 15px var(--f-texte);
  cursor: pointer;
  transition: background-color .2s;
}
.resa__btn:hover { background: #333; }
.resa__btn:disabled { background: #bbb; cursor: not-allowed; }
.resa__btn--large { width: 100%; }

.resa__btn-ligne {
  padding: 8px 14px;
  background: #fff; color: #151515;
  border: 1.5px solid #151515; border-radius: 8px;
  font: 600 13px var(--f-texte);
  cursor: pointer;
  white-space: nowrap;
}
.resa__btn-ligne:hover { background: #151515; color: #fff; }

/* --- États --- */
.resa__chargement { display: flex; justify-content: center; padding: 60px 0; }
.resa__chargement::after {
  content: ''; width: 32px; height: 32px;
  border: 3px solid #eee; border-top-color: #151515; border-radius: 50%;
  animation: resa-tourne .8s linear infinite;
}
@keyframes resa-tourne { to { transform: rotate(360deg); } }

.resa__vide { padding: 30px 20px; text-align: center; color: #777; }
.resa__alerte {
  margin: 16px; padding: 12px 14px;
  background: #fff1f1; border: 1px solid #f3c2c2; border-radius: 8px;
  color: #a12424; font-size: 14px;
}
.resa__alerte button { margin-top: 8px; }

/* --- Étape 1 : barbers --- */
.resa__liste { list-style: none; margin: 0; padding: 0; }
.resa__barber { border-bottom: 1px solid #f0f0f0; }
.resa__barber-ligne { display: flex; align-items: center; gap: 14px; padding: 16px; }
.resa__avatar {
  flex: none;
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #eee;
  display: flex; align-items: center; justify-content: center;
  color: #999;
}
.resa__avatar svg { width: 22px; height: 22px; fill: currentColor; }
.resa__barber-info { flex: 1; min-width: 0; }
.resa__barber-info strong { display: block; font-family: var(--f-titre); font-size: 17px; }
.resa__lien {
  padding: 0; background: none; border: 0;
  font: 12px var(--f-texte); color: #555; text-decoration: underline;
  cursor: pointer;
}
.resa__profil { padding: 0 16px 16px 78px; font-size: 13px; color: #555; white-space: pre-line; }
.resa__profil[hidden] { display: none; }
.resa__portfolio { display: flex; gap: 6px; margin-top: 10px; }
.resa__portfolio img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; }

/* --- Étape 2 : prestations --- */
.resa__filtres {
  position: sticky; top: 0; z-index: 1;
  background: #fff;
  border-bottom: 1px solid #eee;
}
.resa__chips {
  display: flex; gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.resa__chips::-webkit-scrollbar { display: none; }
.resa__chip {
  flex: none;
  padding: 8px 14px;
  background: #fff;
  border: 1.5px solid #e2e2e2; border-radius: 999px;
  font: 600 13px var(--f-texte); color: #151515;
  cursor: pointer;
}
.resa__chip.actif { background: #151515; border-color: #151515; color: #fff; }
.resa__recherche { padding: 0 16px 12px; }
.resa__recherche input {
  width: 100%;
  padding: 10px 12px;
  background: #f5f5f5; border: 1px solid transparent; border-radius: 8px;
  font: 14px var(--f-texte);
}
.resa__recherche input:focus { outline: none; border-color: #151515; background: #fff; }

.resa__cat {
  padding: 18px 16px 6px;
  font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: #888;
}
.resa__service {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: none; border: 0; border-bottom: 1px solid #f0f0f0;
  font: inherit; color: inherit; text-align: left;
  cursor: pointer;
}
.resa__service:hover { background: #fafafa; }
.resa__coche {
  flex: none;
  width: 22px; height: 22px;
  border: 1.5px solid #151515; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.resa__service[aria-pressed="true"] .resa__coche { background: #151515; }
.resa__service[aria-pressed="true"] .resa__coche::after {
  content: ''; width: 6px; height: 11px; margin-top: -2px;
  border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.resa__service-nom { flex: 1; }
.resa__service-nom strong { display: block; font-weight: 600; font-size: 15px; }
.resa__service-nom small { font-size: 12px; color: #888; }
.resa__service-prix { white-space: nowrap; font-size: 15px; }

/* --- Étape 3 : date et heure --- */
.resa__choix-barber {
  display: flex; align-items: center; gap: 12px;
  margin: 16px; padding: 12px 14px;
  border: 1px solid #e6e6e6; border-radius: 10px;
}
.resa__choix-barber label { flex: 1; font-size: 12px; color: #777; }
.resa__choix-barber select {
  display: block; width: 100%; margin-top: 2px;
  padding: 2px 0;
  background: none; border: 0;
  font: 600 16px var(--f-titre); color: #151515;
  cursor: pointer;
}

.resa__jours-nav { display: flex; align-items: center; gap: 4px; padding: 0 8px; }
.resa__jours {
  flex: 1;
  display: flex; gap: 6px;
  padding: 4px 2px 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.resa__jour {
  flex: none;
  width: 62px;
  padding: 8px 0;
  background: #fff;
  border: 1px solid #e2e2e2; border-radius: 8px;
  font: inherit; color: #151515; text-align: center;
  cursor: pointer;
  scroll-snap-align: start;
}
.resa__jour small { display: block; font-size: 11px; color: #777; text-transform: capitalize; }
.resa__jour strong { display: block; font-family: var(--f-titre); font-size: 22px; line-height: 1.2; }
.resa__jour:disabled {
  cursor: default; color: #aaa;
  background: repeating-linear-gradient(135deg, #f4f4f4 0 4px, #fafafa 4px 8px);
}
.resa__jour.actif { background: #151515; border-color: #151515; color: #fff; }
.resa__jour.actif small { color: #ddd; }

.resa__sous-titre { padding: 12px 16px 6px; text-align: center; color: #888; font-size: 14px; }
.resa__heures {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  padding: 8px 16px 24px;
}
.resa__heure {
  padding: 12px 0;
  background: #fff;
  border: 1px solid #e2e2e2; border-radius: 8px;
  font: 500 16px var(--f-texte); color: #151515;
  cursor: pointer;
}
.resa__heure:hover { border-color: #151515; }

/* --- Étape 4 : coordonnées --- */
.resa__form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
.resa__form .large { grid-column: 1 / -1; }
.resa__champ label { display: block; margin-bottom: 4px; font-size: 12px; color: #666; }
.resa__champ input,
.resa__champ select,
.resa__champ textarea {
  width: 100%;
  padding: 11px 12px;
  background: #fff;
  border: 1px solid #d9d9d9; border-radius: 8px;
  font: 15px var(--f-texte); color: #151515;
}
.resa__champ input:focus,
.resa__champ select:focus,
.resa__champ textarea:focus { outline: none; border-color: #151515; }
.resa__tel { display: flex; gap: 8px; }
.resa__tel select { width: 96px; flex: none; }
.resa__champ textarea { height: 70px; resize: vertical; }
.resa__champ.erreur input { border-color: #c62828; }

.resa__recap {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px solid #e6e6e6; border-radius: 10px;
}
.resa__recap h3 { font-family: var(--f-titre); font-size: 17px; text-transform: none; }
.resa__recap p { margin-top: 2px; font-size: 13px; color: #777; }
.resa__recap ul { margin: 10px 0 0; padding: 0; list-style: none; }
.resa__recap li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 8px 0;
  border-top: 1px solid #f0f0f0;
  font-size: 14px;
}
.resa__recap li.total { font-weight: 700; }

.resa__case { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #444; }
.resa__case input { width: 16px; height: 16px; margin: 2px 0 0; accent-color: #151515; }
.resa__note { grid-column: 1 / -1; font-size: 12px; color: #888; }

/* --- Étape 5 : confirmation --- */
.resa__ok { padding: 40px 24px; text-align: center; }
.resa__ok-icone {
  width: 64px; height: 64px; margin: 0 auto 18px;
  border-radius: 50%; background: #151515;
  display: flex; align-items: center; justify-content: center;
}
.resa__ok-icone::after {
  content: ''; width: 14px; height: 26px; margin-top: -4px;
  border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.resa__ok h3 { font-family: var(--f-titre); font-size: 24px; }
.resa__ok p { margin-top: 10px; color: #555; }
.resa__ok .resa__recap { margin: 22px 0; text-align: left; }
.resa__ok .resa__btn-ligne { margin-top: 10px; }

/* --- Secours : module officiel --- */
.resa__secours { padding: 0 16px 14px; text-align: center; }
.resa__secours .resa__lien { font-size: 12px; color: #999; }
.resa__iframe { width: 100%; height: 100%; border: 0; }
.resa__corps--module { position: relative; overflow: hidden; }
.resa__corps--module .resa__chargement { position: absolute; inset: 0; }

@media (max-width: 560px) {
  .resa { max-width: 100vw; width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .resa__form { grid-template-columns: 1fr; }
  .resa__profil { padding-left: 16px; }
}
