/**
 * ==========================================================
 *  DATEPICKER AUBERGE DE CRISSAY – v1.5
 * ----------------------------------------------------------
 *  ✅ Fond blanc opaque (pas transparent)
 *  ✅ 2 mois côte à côte sur PC / empilés sur mobile
 *  ✅ Bouton “Valider” centré + croix fermeture
 *  ✅ Fenêtre centrée en mobile
 * ==========================================================
 */

#auberge-calendar-overlay {
  position: absolute;
  z-index: 9999;
  background: transparent;
  display: none;
}

.auberge-calendar-popup {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
  color: #52340F;
  padding: 1rem 1.2rem;
  width: min(700px, 90vw);
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: 'Poppins', 'Inter', sans-serif;
  transition: all 0.2s ease;
  position: relative;
  margin-left: 15rem;
}

/* --- Titre supérieur --- */
.auberge-calendar-popup > div:first-child {
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.5rem;

}

/* ---Titre Calndrier----- */
.auberge-cal-header {
  display: flex;
  justify-content: center;
}
/* --------- */ 

/* --- Croix fermeture --- */
#auberge-close-cal {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 20px;
  color: #52340F;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.15s;
}
#auberge-close-cal:hover {
  transform: scale(1.2);
}

/* --- Container des 2 mois --- */
#auberge-cal-container {
  display: flex;
  justify-content: space-between;
  gap: 26px;
  flex-wrap: nowrap;
  margin-bottom: 0.4rem;
}

/* --- Mois --- */
.auberge-cal-month {
  flex: 1;
  min-width: 250px;
  padding: 0 6px;
}
.auberge-cal-month div:first-child {
  text-align: center;
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 14px;
  text-transform: capitalize;
}

/* --- Grille des jours --- */
.auberge-cal-month .auberge-day {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #52340F;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  margin: 1px auto;
}
.auberge-cal-month .auberge-day:hover {
  background: rgba(82, 52, 15, 0.1);
}
.auberge-cal-month .auberge-day.disabled {
  cursor: not-allowed;
  color: #ccc;
  background: #f4f4f4;
}

/* --- Jours sélectionnés --- */
.auberge-cal-month .auberge-day.selected {
  background: #52340F;
  color: #fff !important;
}

/* --- Ligne des jours de la semaine --- */
.auberge-cal-month .auberge-day-header {
  font-weight: 500;
  font-size: 11px;
  text-align: center;
}

/* --- Bouton Valider --- */
.validate-btn,
#auberge-calendar-validate {
  display: inline-block;
  background: #52340F;
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 6px 18px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.validate-btn:hover,
#auberge-calendar-validate:hover {
  background: #694c25;
}

/* --- États (en cohérence avec le JS) --- */
.auberge-day.open { background:#fff; color:#52340F; }
.auberge-day.open-monday { background:#F5F0EA; color:#B38E5D; }
.auberge-day.closed { background:#C44E40; color:#fff; cursor:not-allowed; }
.auberge-day.closed-first { background:#E38CA0; color:#fff; cursor:pointer; }
.auberge-day.in-range { background:#ECE7E3; color:#52340F; }
.auberge-day.selected { background:#52330F; color:#fff !important; }

/* --- Barre de navigation mois (facultatif) --- */
.nav-btn {
  width: 28px; height: 28px;
  border: 0; border-radius: 8px;
  background: #ECE7E3; color: #2c3e50;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
}
.nav-btn.disabled { opacity: .5; cursor: not-allowed; }

/* --- Tooltip (créé en JS) --- */
#auberge-tooltip {
  pointer-events: none;
}

/* --- Grille correcte des jours (7 colonnes fixes) --- */
.auberge-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  text-align: center;
  font-size: 13px;
  align-items: center;
  justify-items: center;
}

.auberge-grid .dow {
  font-weight: 600;
  color: #52340F;
  margin-bottom: 4px;
  font-size: 12px;
}


/* --- Responsive (mobile) --- */
@media (max-width: 768px) {
  /* Overlay : centré plein écran avec léger fond pour la lisibilité */
  #auberge-calendar-overlay {
    position: fixed;
    inset: 0;
    display: none;              /* devient flex en JS lors de l’ouverture */
    justify-content: center;
    align-items: center;
    z-index: 99999;
    background: rgba(255,255,255,0.95);
  }

  .auberge-calendar-popup {
    width: 92vw;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1rem;
    border-radius: 16px;
    margin: 0;                  /* supprime tout décalage vertical/horizontal */
    margin-top:22rem;
  }

  #auberge-cal-container {
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }

  .auberge-cal-month {
    min-width: 100%;
  }

  .auberge-cal-month .auberge-day {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .auberge-calendar-popup > div:first-child {
    font-size: 13px;
    margin-bottom: 0.6rem;
  }
}

/* --- Petite ombre intérieure douce --- */
.auberge-calendar-popup::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.08);
  pointer-events: none;
}

/* --- Corrige l'affichage des cases vides --- */
.auberge-day.empty {
  background: #fff !important; /* ou transparent si tu préfères */
  color: transparent;
  cursor: default;
  pointer-events: none;
  box-shadow: none;
}