/* Traventura · calendario desplegable de ida y vuelta del asistente «Crear mi Traventura» (assets/js/create.js, bloque «Fechas»).
   Ordenador: se despliega bajo los campos con dos meses. Móvil (< 720 px): hoja desde abajo con los meses en columna. */

.dp { position: relative; display: block; margin-bottom: 14px; }
.dp[hidden] { display: none; }
.dp-native { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }

/* ---------- Los dos campos (Ida → Vuelta) ---------- */
.dp-fields { display: flex; align-items: stretch; gap: 10px; }
.dp-field {
  flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 12px; min-height: 62px; padding: 9px 14px;
  border: 2px solid var(--line-2); border-radius: var(--r-sm); background: var(--white); color: var(--ink);
  font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: border-color .15s, box-shadow .15s;
}
.dp-field:hover { border-color: rgba(29, 43, 58, .35); }
.dp-field:focus-visible { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(14, 124, 134, .18); }
.dp-field.is-active { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(14, 124, 134, .18); }
.dp-ico { width: 24px; height: 24px; flex: none; fill: none; stroke: var(--teal); stroke-width: 2; stroke-linecap: round; }
.dp-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.dp-lab { font-size: .8rem; font-weight: 800; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
.dp-val { font-weight: 800; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-val.is-empty { color: #8A929A; font-weight: 700; }
.dp-sep { align-self: center; font-weight: 900; color: var(--ink-3); }
.dp-native.is-invalid ~ .dp-fields .dp-field { border-color: var(--coral-ink); box-shadow: 0 0 0 4px rgba(184, 77, 53, .12); }

/* ---------- Desplegable (ordenador) ---------- */
.dp-pop {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 8px);
  padding: 14px 16px 12px; background: var(--white); border-radius: var(--r);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: dpIn .16s var(--ease);
}
.dp-pop[hidden] { display: none; }
@keyframes dpIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.dp-sheet-head, .dp-sheet-sel { display: none; }
.dp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.dp-hint { flex: 1; margin: 0; text-align: center; font-weight: 800; color: var(--ink-2); font-size: .92rem; }
.dp-nav {
  width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; background: var(--teal-xl); color: var(--teal-d);
  font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.dp-nav:hover:not(:disabled) { background: var(--teal-l); }
.dp-nav:disabled { opacity: .35; cursor: default; }
.dp-nav:focus-visible, .dp-x:focus-visible, .dp-clear:focus-visible { outline: 3px solid var(--sun); outline-offset: 1px; }
.dp-months { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 28px; }
.dp-m { min-width: 0; }
.dp-t { margin: 6px 0 6px; text-align: center; font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; }
.dp-wd { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: .75rem; font-weight: 800; color: var(--ink-3); text-transform: uppercase; padding-bottom: 4px; }
.dp-wdrow[hidden] { display: none; }
.dp-g { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; }

/* Cada día: la celda pinta la franja del rango y el botón, el círculo */
.dp-c { position: relative; display: flex; justify-content: center; }
.dp-c::before { content: ""; position: absolute; top: 2px; bottom: 2px; left: 0; right: 0; background: transparent; }
.dp-c.is-in::before, .dp-c.is-hin::before { background: var(--teal-l); }
.dp-c.is-s::before, .dp-c.is-hs::before { background: var(--teal-l); left: 50%; }
.dp-c.is-e::before, .dp-c.is-he::before { background: var(--teal-l); right: 50%; }
.dp-c.is-in.is-row0::before, .dp-c.is-hin.is-row0::before { border-radius: 99px 0 0 99px; }
.dp-c.is-in.is-row1::before, .dp-c.is-hin.is-row1::before { border-radius: 0 99px 99px 0; }
.dp-c.is-in.is-row0.is-row1::before, .dp-c.is-hin.is-row0.is-row1::before { border-radius: 99px; }
.dp-d {
  position: relative; width: 40px; height: 40px; max-width: 100%; border: 0; border-radius: 50%; background: none; padding: 0;
  font: inherit; font-weight: 700; font-size: .98rem; color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.dp-d:hover:not(:disabled):not(.is-sel) { box-shadow: inset 0 0 0 2px var(--teal); }
.dp-d:disabled { color: var(--ink-3); opacity: .38; cursor: default; text-decoration: none; }
.dp-d.is-today { box-shadow: inset 0 0 0 2px var(--sun); }
.dp-d.is-sel { background: var(--teal); color: #fff; font-weight: 900; }
.dp-c.is-he .dp-d { background: var(--teal-d); color: #fff; }
.dp-d:focus-visible { outline: 3px solid var(--sun); outline-offset: 1px; }

.dp-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.dp-sum { flex: 1; text-align: center; font-weight: 800; color: var(--teal-d); font-size: .95rem; }
.dp-clear { border: 0; background: none; padding: 6px 2px; font: inherit; font-weight: 800; font-size: .92rem; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.dp-clear:disabled { opacity: .4; cursor: default; text-decoration: none; }
.dp-done { min-width: 110px; }

/* ---------- Móvil: hoja desde abajo ---------- */
.dp-lock, .dp-lock body { overflow: hidden; }
.dp-back { position: fixed; inset: 0; z-index: 290; background: rgba(13, 22, 31, .45); animation: dpFade .2s ease; }
@keyframes dpFade { from { opacity: 0; } to { opacity: 1; } }
.dp-pop.is-sheet {
  position: fixed; z-index: 300; left: 0; right: 0; top: auto; bottom: 0;
  display: flex; flex-direction: column; height: 88vh; height: 88dvh; max-height: 720px;
  padding: 0; border: 0; border-radius: 22px 22px 0 0; box-shadow: 0 -12px 40px rgba(13, 22, 31, .25);
  animation: dpUp .24s var(--ease);
}
.dp-pop.is-sheet[hidden] { display: none; }
@keyframes dpUp { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.dp-pop.is-sheet .dp-sheet-head { display: flex; align-items: center; justify-content: center; position: relative; padding: 14px 56px 6px; }
.dp-pop.is-sheet .dp-sheet-head::before { content: ""; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line-2); }
.dp-sheet-t { margin: 0; font-family: var(--font-head); font-weight: 600; font-size: 1.15rem; }
.dp-x { position: absolute; right: 10px; top: 8px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--cream); color: var(--ink); font-size: 1.1rem; cursor: pointer; }
.dp-pop.is-sheet .dp-sheet-sel { display: flex; align-items: center; gap: 10px; margin: 6px 16px 4px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--teal-xl); }
.dp-sheet-sel > span:not(.dp-sep) { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.dp-sheet-sel small { font-size: .75rem; font-weight: 800; color: var(--ink-2); text-transform: uppercase; letter-spacing: .03em; }
.dp-sheet-sel b { font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-sheet-sel b.is-empty { color: #8A929A; font-weight: 700; }
.dp-pop.is-sheet .dp-head { padding: 4px 16px 0; margin: 0; }
.dp-pop.is-sheet .dp-nav { display: none; }
.dp-pop.is-sheet .dp-wdrow { padding: 6px 12px 6px; border-bottom: 1px solid var(--line); }
.dp-pop.is-sheet .dp-months { display: block; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 0 12px 12px; }
.dp-pop.is-sheet .dp-m { padding-top: 8px; }
.dp-pop.is-sheet .dp-t { text-align: left; padding-left: 6px; margin: 8px 0 6px; }
.dp-pop.is-sheet .dp-d { width: 44px; height: 44px; font-size: 1.02rem; }
.dp-pop.is-sheet .dp-foot { margin: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--white); box-shadow: 0 -6px 16px -10px rgba(13, 22, 31, .3); }
.dp-pop.is-sheet .dp-done { min-width: 120px; }

@media (max-width: 719px) {
  .dp-field { padding: 8px 10px; gap: 8px; min-height: 58px; }
  .dp-ico { width: 20px; height: 20px; }
  .dp-val { font-size: .95rem; }
  .dp-fields { gap: 6px; }
}
@media (max-width: 360px) { .dp-ico { display: none; } }
@media (prefers-reduced-motion: reduce) { .dp-pop, .dp-pop.is-sheet, .dp-back { animation: none; } }
.dp-sheet-sel > span.is-active b { text-decoration: underline 3px var(--teal); text-underline-offset: 6px; }
.dp-pop.is-sheet .dp-sum { font-size: .88rem; line-height: 1.25; }
/* la franja no asoma fuera de su fila ni de su mes */
.dp-c.is-e.is-row0::before, .dp-c.is-he.is-row0::before, .dp-c.is-s.is-row1::before, .dp-c.is-hs.is-row1::before { display: none; }
