/**
 * Styles — Module Créneaux de visite Alpaquier
 *
 * Mobile first. Progressive enhancement.
 * Palette : vert #2d6a4f (principal), #95d5b2 (clair), #f9f5f0 (fond)
 *
 * Règle : pas de font-size explicite — on laisse le thème décider.
 */

/* ── Conteneur principal ──────────────────────────────────────── */
.alpaquier-visite-module {
  font-family: inherit;
  max-width: 600px;
}

/* ── Titre de section ─────────────────────────────────────────── */
.alpaquier-section-title {
  font-weight: 700;
  color: var(--orange);
  margin: 0 0 1.25rem;
}

/* ── Groupe de date ───────────────────────────────────────────── */
.alpaquier-date-groupe {
  margin-bottom: 0;
  border-bottom: 1px solid #e0ddd8;
}
.alpaquier-date-groupe:first-of-type {
  border-top: 1px solid #e0ddd8;
}

/* ── En-tête accordéon (label de date) ───────────────────────── */
.alpaquier-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  color: #333;
  padding: 0.85rem 0.25rem;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}

.alpaquier-accordion-header:hover {
  color: var(--orange, #c0612a);
}

/* Chevron via pseudo-élément */
.alpaquier-accordion-header::after {
  content: '';
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 0.75rem;
}

/* Chevron orienté vers le bas quand ouvert */
.alpaquier-accordion-header[aria-expanded="true"]::after {
  transform: rotate(-135deg);
}

/* Focus clavier */
.alpaquier-accordion-header:focus-visible {
  outline: 2px solid var(--orange, #c0612a);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── Panneau accordéon (horaires) ─────────────────────────────── */
.alpaquier-accordion-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  overflow: hidden;
  max-height: 0;
  padding: 0;
  transition: max-height 0.28s ease, padding 0.2s ease;
}

/* Panneau ouvert */
.alpaquier-accordion-panel.alpaquier-accordion-panel--open {
  max-height: 300px; /* valeur haute, jamais atteinte en pratique */
  padding: 0.5rem 0 1rem;
}

/* Sans JS : forcer tous les panneaux visibles (progressive enhancement) */
.no-js .alpaquier-accordion-panel {
  max-height: none;
  padding: 0.5rem 0 1rem;
}

/* Retrait de l'attribut hidden géré par JS — le CSS contrôle la visibilité */
.alpaquier-accordion-panel[hidden] {
  display: flex; /* override l'attribut hidden, la transition CSS prend le relais */
}

/* ── Bouton créneau ───────────────────────────────────────────── */
.alpaquier-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  min-height: 44px; /* tap target mobile */
  padding: 0.4rem 1rem;
  border: 2px solid var(--orange);
  border-radius: 6px;
  background: #fff;
  color: var(--orange);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  line-height: 1.2;
  text-align: center;
}

.alpaquier-slot:hover:not([disabled]) {
  background: var(--bg);
}

/* ── Sélectionné ──────────────────────────────────────────────── */
.alpaquier-slot--selected,
.alpaquier-slot:focus-visible:not([disabled]) {
  background: var(--orange);
  color: #fff;
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

/* ── Complet — contraste renforcé : texte foncé sur fond gris ── */
.alpaquier-slot--complet,
.alpaquier-slot[disabled] {
  border-color: #999;
  color: #555;           /* texte foncé lisible (ratio ≥ 4.5:1 sur #e8e8e8) */
  background: #e8e8e8;
  cursor: not-allowed;
  font-weight: 400;
  text-decoration: line-through;
}

/* ── Récap créneau sélectionné ────────────────────────────────── */
.alpaquier-selection-recap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 1rem 0;
  padding: 0.6rem 1rem;
  background: #d8f3dc;
  border-radius: 20px;
  color: #1b4332;
}

.alpaquier-selection-label {
  font-weight: 600;
}

/* ── Champ enfants ────────────────────────────────────────────── */
.alpaquier-enfants-field {
  margin: 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.alpaquier-enfants-label {
  color: #444;
  font-weight: 500;
}

.alpaquier-enfants-input {
  width: 80px;
  padding: 0.4rem 0.6rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* ── Alerte admin (non visible des visiteurs) ─────────────────── */
.alpaquier-admin-notice {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 0.75rem 1rem;
  color: #664d03;
}

/* ── Le select natif WC est masqué via JS (pas en CSS statique) ─ */
/* Ne pas ajouter display:none ici — le JS applique la classe ci-dessous */
.alpaquier-select-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  .alpaquier-slot {
    flex: 1 1 calc(50% - 0.25rem);
    min-width: 0;
  }
}

