/* ================================================================
   Sophrologie Booking v2.4 — Frontend CSS
   ================================================================ */
.sb-booking {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 100%;
  margin: 0 auto;
  color: #2c3e50;
  --sb-primary: #5b8f7d;
  --sb-primary-dark: #46715f;
  --sb-amber: #b8860b;
  --sb-amber-bg: #fff7e6;
  --sb-amber-bd: #f0d49a;
  --sb-free-bg: #eef7f2;
  --sb-free-bd: #bfe0d0;
  --sb-busy-bg: #f7eceb;
  --sb-busy-bd: #e3c2bf;
}

/* Grand écran : on déborde du conteneur étroit du thème. */
@media (min-width: 1025px) {
  .sb-booking {
    width: min(94vw, 1600px);
    max-width: none;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ----------------------------------------------------------------
   Navigation semaine — libellé AU-DESSUS, boutons réduits [B5][B6]
   ---------------------------------------------------------------- */
.sb-week-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.sb-week-label {
  font-size: 17px;
  font-weight: 700;
  color: var(--sb-primary-dark);
  text-align: center;
}
.sb-week-btns { display: flex; gap: 10px; }
.sb-nav-btn {
  background: #fff;
  border: 1.5px solid var(--sb-primary);
  color: var(--sb-primary-dark);
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 20px;
  cursor: pointer;
  transition: all .15s;
}
.sb-nav-btn:hover:not(:disabled) { background: var(--sb-primary); color: #fff; }
.sb-nav-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ----------------------------------------------------------------
   Grille + flèches latérales [B4]
   ---------------------------------------------------------------- */
.sb-grid-shell { position: relative; }

.sb-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.sb-arrow {
  display: none; /* visibles uniquement sur mobile */
  position: absolute;
  top: 44px;
  z-index: 5;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--sb-primary);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  align-items: center;
  justify-content: center;
}
.sb-arrow-left  { left: -6px; }
.sb-arrow-right { right: -6px; }

.sb-loading, .sb-no-slot {
  grid-column: 1 / -1;
  text-align: center;
  padding: 28px;
  color: #8a9aa5;
  font-size: 14px;
}
.sb-no-slot {
  grid-column: auto;
  padding: 14px 6px;
  font-size: 12px;
  color: #b0bcc4;
  font-style: italic;
}

/* ----------------------------------------------------------------
   Colonne jour
   ---------------------------------------------------------------- */
.sb-day-col {
  background: #fafcfb;
  border: 1px solid #e6ece9;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.sb-day-header {
  background: var(--sb-primary);
  color: #fff;
  text-align: center;
  padding: 8px 4px;
}
.sb-day-name { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; opacity: .9; }
.sb-day-num  { font-size: 22px; font-weight: 700; line-height: 1.1; }

.sb-slots-list { padding: 8px; display: flex; flex-direction: column; gap: 7px; }

/* ----------------------------------------------------------------
   Créneau 1h
   ---------------------------------------------------------------- */
.sb-slot {
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .12s;
}
.sb-slot-info { display: flex; flex-direction: column; gap: 1px; }
.sb-slot-time { font-weight: 700; }

.sb-slot-free { background: var(--sb-free-bg); border-color: var(--sb-free-bd); color: var(--sb-primary-dark); }
.sb-slot-free:hover { background: #ffffff; border-color: var(--sb-primary); box-shadow: 0 2px 8px rgba(91,143,125,.18); transform: translateY(-1px); }
.sb-slot-cta { font-size: 11px; font-weight: 600; color: var(--sb-primary); }

.sb-slot-selected { background: var(--sb-primary); border-color: var(--sb-primary-dark); color: #fff; }
.sb-slot-selected .sb-slot-cta { color: #fff; }

.sb-slot-booked {
  background: var(--sb-busy-bg);
  border-color: var(--sb-busy-bd);
  cursor: not-allowed;
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: .85;
}
.sb-slot-lock { font-size: 13px; }
.sb-slot-unavailable { font-size: 11px; font-weight: 700; color: #b1564f; text-transform: uppercase; letter-spacing: .3px; }

/* ----------------------------------------------------------------
   Carte sortie de groupe
   ---------------------------------------------------------------- */
.sb-event-card {
  background: var(--sb-amber-bg);
  border: 1.5px solid var(--sb-amber-bd);
  border-radius: 10px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: all .12s;
}
.sb-event-open:hover { box-shadow: 0 3px 10px rgba(184,134,11,.25); transform: translateY(-1px); border-color: var(--sb-amber); }
.sb-event-tag {
  align-self: flex-start;
  background: var(--sb-amber);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  padding: 1px 7px;
  border-radius: 4px;
}
.sb-event-theme { font-weight: 700; font-size: 13px; color: #6b5210; line-height: 1.25; }
.sb-event-time  { font-size: 11px; color: #8a7434; }
.sb-event-places { font-size: 12px; font-weight: 700; color: var(--sb-primary-dark); }
.sb-event-places.is-full { color: #b1564f; }
.sb-event-full { opacity: .7; cursor: not-allowed; background: #f3f0ea; border-color: #ddd6c8; }
.sb-event-full .sb-event-tag { background: #a99; }
.sb-event-card.sb-selected { outline: 3px solid var(--sb-amber); outline-offset: 1px; }

/* ----------------------------------------------------------------
   Panneau de réservation
   ---------------------------------------------------------------- */
.sb-panel {
  margin-top: 22px;
  background: #fff;
  border: 1px solid #e6ece9;
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.sb-panel-selected {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  background: var(--sb-free-bg);
  border-radius: 10px;
  margin-bottom: 16px;
}
.sb-panel-activity { font-weight: 700; color: var(--sb-primary-dark); font-size: 15px; }
.sb-panel-when { font-size: 13px; color: #5a6b73; }
.sb-panel-title { font-size: 14px; margin: 18px 0 8px; color: #2c3e50; }

.sb-field { margin-bottom: 12px; }
.sb-field label, .sb-field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: #46565e; }
.sb-field input, .sb-select {
  width: 100%;
  padding: 9px 11px;
  border: 1.5px solid #d6e0db;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
  background: #fff;
}
.sb-field input:focus, .sb-select:focus { outline: none; border-color: var(--sb-primary); box-shadow: 0 0 0 3px rgba(91,143,125,.15); }
.sb-activity-choice { margin-bottom: 12px; }
.sb-help { font-size: 12px; color: #8a9aa5; margin: 2px 0 8px; }

/* Compteur de places */
.sb-event-counter {
  background: var(--sb-amber-bg);
  border: 1px solid var(--sb-amber-bd);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  color: #6b5210;
  margin-bottom: 14px;
}

/* Lignes participants */
.sb-participant-line { display: flex; gap: 8px; margin-bottom: 8px; }
.sb-participant-line input {
  flex: 1;
  padding: 9px 11px;
  border: 1.5px solid #d6e0db;
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}
.sb-participant-line input:focus { outline: none; border-color: var(--sb-primary); box-shadow: 0 0 0 3px rgba(91,143,125,.15); }
.sb-remove-participant {
  flex: 0 0 auto;
  width: 38px;
  border: 1.5px solid #e3c2bf;
  background: #fbf2f1;
  color: #b1564f;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
.sb-remove-participant:disabled { opacity: .35; cursor: not-allowed; }
.sb-add-participant {
  background: #fff;
  border: 1.5px dashed var(--sb-primary);
  color: var(--sb-primary-dark);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 2px;
}
.sb-add-participant:disabled { opacity: .4; cursor: not-allowed; border-style: solid; }

.sb-quota-note {
  background: #fdf6e3;
  border-left: 3px solid var(--sb-amber);
  padding: 9px 12px;
  font-size: 12.5px;
  color: #7a5e12;
  border-radius: 0 6px 6px 0;
  margin: 14px 0 4px;
}
.sb-legal { font-size: 11px; color: #9aa7ae; margin: 14px 0; line-height: 1.5; }

/* Actions : Annuler [B1] + Confirmer */
.sb-panel-actions { display: flex; gap: 10px; margin-top: 6px; }
.sb-cancel-btn {
  flex: 0 0 auto;
  background: #fff;
  border: 1.5px solid #cdd6d1;
  color: #6a7a82;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.sb-cancel-btn:hover { background: #f4f6f5; border-color: #b1564f; color: #b1564f; }
.sb-confirm-btn {
  flex: 1;
  background: var(--sb-primary);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.sb-confirm-btn:hover:not(:disabled) { background: var(--sb-primary-dark); }
.sb-confirm-btn:disabled { opacity: .6; cursor: wait; }

.sb-error {
  margin-top: 12px;
  padding: 10px 12px;
  background: #fbecea;
  border: 1px solid #e3c2bf;
  color: #b1564f;
  border-radius: 8px;
  font-size: 13px;
}

/* ----------------------------------------------------------------
   Confirmation
   ---------------------------------------------------------------- */
.sb-success {
  margin-top: 22px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--sb-free-bd);
  border-radius: 14px;
  padding: 32px 22px;
  max-width: 460px;
  margin-left: auto; margin-right: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
.sb-success-icon {
  width: 56px; height: 56px;
  margin: 0 auto 14px;
  background: var(--sb-primary);
  color: #fff;
  border-radius: 50%;
  font-size: 30px;
  line-height: 56px;
}
.sb-success h3 { margin: 0 0 8px; color: var(--sb-primary-dark); }
.sb-success p { margin: 4px 0; color: #5a6b73; font-size: 14px; }
.sb-newbooking-btn {
  margin-top: 16px;
  background: var(--sb-primary);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.sb-newbooking-btn:hover { background: var(--sb-primary-dark); }

/* ----------------------------------------------------------------
   RESPONSIVE
   ---------------------------------------------------------------- */
/* Tablette : 4 colonnes (2 lignes) */
@media (max-width: 1024px) and (min-width: 769px) {
  .sb-days-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Mobile : 2 jours visibles + défilement horizontal [B4] */
@media (max-width: 768px) {
  .sb-days-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 2px;
  }
  .sb-days-grid::-webkit-scrollbar { display: none; }
  .sb-day-col {
    flex: 0 0 calc(50% - 5px);
    min-width: calc(50% - 5px);
    scroll-snap-align: start;
  }
  .sb-arrow { display: flex; }
  .sb-days-grid { padding-left: 30px; padding-right: 30px; }
  .sb-arrow-left  { left: 0; }
  .sb-arrow-right { right: 0; }

  .sb-panel, .sb-success { max-width: 100%; }
  .sb-panel-actions { flex-direction: column-reverse; }
  .sb-cancel-btn { width: 100%; }
}

/* ===============================================================
   v2.5 — Menu déroulant lieu × séance
   =============================================================== */
.sb-select optgroup {
  font-weight: 700;
  color: #2c5f9b;
  font-style: normal;
}
.sb-select option {
  font-weight: 400;
  color: #2c3e50;
}

/* v2.5.2 — Lieu de rendez-vous des sorties de groupe */
.sb-event-place {
  display: block;
  font-size: 11px;
  color: #7a6a3a;
  margin-top: 2px;
  line-height: 1.3;
}
.sb-panel-where {
  display: block;
  font-size: 0.9rem;
  color: #4a7ab5;
  margin-top: 2px;
}

/* ===============================================================
   v2.5.3 — Case de consentement (CGV + politique de confidentialité)
   =============================================================== */
.sb-consent {
  margin: 16px 0 14px;
  padding: 12px 14px;
  background: #f7f9fc;
  border: 1px solid #dde3ec;
  border-radius: 8px;
  transition: border-color .18s, background .18s;
}
.sb-consent-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  margin: 0;
}
.sb-consent-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  cursor: pointer;
  accent-color: #4a7ab5;
}
.sb-consent-text {
  font-size: 0.82rem;
  line-height: 1.5;
  color: #4a5568;
}
.sb-consent-text a {
  color: #2c5f9b;
  text-decoration: underline;
}
.sb-consent-text a:hover { color: #1a4a80; }
.sb-consent .sb-req { color: #c0392b; font-weight: 700; }

/* Mise en évidence si la case n'est pas cochée à la validation */
.sb-consent.sb-consent-error {
  border-color: #e57373;
  background: #fdecea;
  animation: sb-consent-shake .3s;
}
@keyframes sb-consent-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-4px); }
  75%      { transform: translateX(4px); }
}
