/* ==========================================================================
   Delta Atlas — Sélecteur de dates (calendrier double mois, style VCalendar)
   Adapté du composant Jadoo
   ========================================================================== */

/* --- Champ déclencheur --- */
input.js-date-range {
  cursor: pointer;
  caret-color: transparent;
}

.js-date-range {
  width: 100%;
  min-width: 150px;
  height: 48px;
  padding: 0 14px 0 40px;
  border: 1.5px solid #e8e0d8;
  border-radius: 0.75rem;
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  color: #422214;
  background: #faf7f4;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.js-date-range:focus {
  border-color: #c2785c;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(194, 120, 92, 0.15);
}

.js-date-range::placeholder {
  color: #9a8579;
  font-weight: 400;
}

/* --- Popup du calendrier --- */
.dp {
  position: fixed;
  z-index: 999;
  width: min(700px, calc(100vw - 24px));
  background: #fff;
  border: 1px solid #e8e0d8;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(66, 34, 20, 0.20);
  overflow: hidden;
}

.dp.is-hidden {
  display: none;
}

.dp__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 0;
}

.dp__nav {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: 1px solid #e8e0d8;
  border-radius: 50%;
  background: #fff;
  color: #422214;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dp__nav svg {
  width: 16px;
  height: 16px;
}

.dp__nav:hover:not(:disabled) {
  background: #fdf2ee;
  border-color: #c2785c;
}

.dp__nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.dp__spacer {
  flex: 1;
}

.dp__today {
  border: none;
  background: #fdf2ee;
  color: #c2785c;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.dp__today:hover:not(:disabled) {
  background: #fbe8df;
}

.dp__today:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dp__body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 16px 14px;
}

.dp__month-title {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 700;
  color: #422214;
  text-align: center;
  margin: 2px 0 8px;
}

.dp__weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}

.dp__weekdays span {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: lowercase;
  color: #9a8579;
}

.dp__days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 1px;
}

.dp__day {
  position: relative;
  height: 42px;
  border: none;
  background: transparent;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #422214;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.dp__day > span {
  position: relative;
  z-index: 2;
}

.dp__day--blank {
  visibility: hidden;
}

.dp__day:hover:not(:disabled) {
  background: #fdf2ee;
}

.dp__day:disabled {
  color: #c9bfba;
  cursor: not-allowed;
}

/* Aujourd'hui : accent terracotta + point */
.dp__day.is-today > span {
  color: #c2785c;
  font-weight: 800;
}

.dp__day.is-today::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #c2785c;
}

/* Bande de sélection (plage) */
.dp__day.is-in-range::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fdf2ee;
}

.dp__day.is-start.is-in-range::before {
  left: 50%;
  right: 0;
}

.dp__day.is-end.is-in-range::before {
  left: 0;
  right: 50%;
}

.dp__day.is-in-range:hover:not(:disabled)::before {
  background: #fbe8df;
}

/* Début / fin : pastille pleine terracotta */
.dp__day.is-start::after,
.dp__day.is-end::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #c2785c;
  z-index: 1;
}

.dp__day.is-start > span,
.dp__day.is-end > span {
  color: #fff;
  font-weight: 800;
  z-index: 2;
}

/* Pied du popup */
.dp__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid #e8e0d8;
  background: #faf7f4;
}

.dp__summary {
  font-size: 13.5px;
  font-weight: 600;
  color: #7a6558;
}

.dp__summary em {
  font-style: normal;
  font-weight: 800;
  color: #422214;
}

.dp__clear {
  border: 1px solid #e8e0d8;
  background: #fff;
  color: #7a6558;
  font-family: 'Inter', sans-serif;
  font-size: 12.5px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.dp__clear:hover {
  color: #dc2626;
  border-color: #fecaca;
  background: #fef2f2;
}

@media (max-width: 767.98px) {
  .dp__body {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .dp {
    width: calc(100vw - 16px);
  }
}
