/* ==========================================================
   booking.css — diálogos, reserva en 3 pasos, calendario
   ========================================================== */
.dialog { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100dvh; width: 100%; color: var(--forest); overflow: visible; }
.dialog:not([open]) { display: none; }
.dialog::backdrop { background: #001d17c4; backdrop-filter: blur(4px); animation: fade .3s both; }
.dialog[open] .dialog-box { animation: dialogIn .45s var(--ease) both; }
@keyframes fade { from { opacity: 0; } }
@keyframes dialogIn { from { opacity: 0; transform: translateY(26px) scale(.97); } }
.dialog-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 18px; }
.dialog-box { position: relative; background: var(--paper); border-radius: 26px; width: min(960px, 100%); max-height: calc(100dvh - 36px); overflow: hidden; display: grid; box-shadow: 0 40px 100px #00000055; }
.dialog-box > .close { position: absolute; right: 16px; top: 16px; z-index: 5; }

/* ----- Booking layout ----- */
.booking { grid-template-columns: 300px 1fr; }
.bk-summary { background: linear-gradient(160deg, #07382c, #0d5942); color: #fff; padding: 0; display: flex; flex-direction: column; overflow: auto; }
.bk-photo { height: 170px; position: relative; flex: none; }
.bk-photo img { width: 100%; height: 100%; object-fit: cover; }
.bk-photo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 40%, #07382c); }
.bk-sum-body { padding: 4px 24px 24px; display: flex; flex-direction: column; gap: 16px; flex: 1; }
.bk-sum-body h3 { font: 800 1.2rem / 1.2 var(--font-head); letter-spacing: -.03em; }
.bk-meta { font-size: .7rem; color: #b9d8c9; font-weight: 700; display: flex; gap: 10px; flex-wrap: wrap; }
.bk-rows { display: grid; gap: 10px; border-top: 1px solid #ffffff22; padding-top: 16px; font-size: .8rem; }
.bk-rows div { display: flex; justify-content: space-between; gap: 10px; }
.bk-rows dt { color: #b9d8c9; } .bk-rows dd { margin: 0; font-weight: 800; text-align: right; }
.bk-total { margin-top: auto; border-top: 1px solid #ffffff22; padding-top: 16px; }
.bk-total small { display: block; font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: #b9d8c9; font-weight: 800; }
.bk-total strong { font: 800 2rem var(--font-head); letter-spacing: -.06em; color: var(--sun2); }
.bk-total strong.bump { animation: bump .35s var(--ease); }
@keyframes bump { 40% { transform: scale(1.12); } }
.bk-trust { font-size: .68rem; line-height: 1.55; color: #b9d8c9; margin: 0; }

.bk-main { padding: 28px 32px 26px; overflow: auto; max-height: calc(100dvh - 36px); position: relative; }
.bk-steps { list-style: none; display: flex; gap: 8px; padding: 0 44px 0 0; margin: 0 0 22px; counter-reset: s; }
.bk-steps li { flex: 1; font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #8a9a90; padding-top: 12px; position: relative; }
.bk-steps li::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: 4px; background: #e2e9e1; }
.bk-steps li::after { content: ''; position: absolute; top: 0; left: 0; height: 4px; border-radius: 4px; background: var(--sun); width: 0; transition: width .5s var(--ease); }
.bk-steps li.done::after, .bk-steps li.active::after { width: 100%; }
.bk-steps li.active, .bk-steps li.done { color: var(--forest); }

.bk-step { display: none; }
.bk-step.active { display: block; animation: stepIn .45s var(--ease) both; }
@keyframes stepIn { from { opacity: 0; transform: translateX(18px); } }
.bk-step h3 { font: 800 1.7rem var(--font-head); letter-spacing: -.055em; margin: 0 0 6px; }
.bk-step h3:focus { outline: none; }
.bk-lead { color: var(--muted); font-size: .82rem; line-height: 1.6; margin: 0 0 18px; }
.bk-label { display: block; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin: 18px 0 9px; color: var(--forest); }

/* selector de excursión */
.bk-tours { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bk-tour { position: relative; cursor: pointer; }
.bk-tour input { position: absolute; opacity: 0; inset: 0; }
.bk-tour span { display: block; border: 1.5px solid #dce5db; border-radius: 14px; padding: 11px 12px; background: #fff; transition: .25s; height: 100%; }
.bk-tour b { display: block; font-size: .76rem; line-height: 1.25; }
.bk-tour small { color: var(--muted); font-size: .68rem; font-weight: 700; }
.bk-tour input:checked + span { border-color: var(--leaf); background: #eef7f1; box-shadow: 0 0 0 3px #08765a22; }
.bk-tour input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 2px; }

/* calendario */
.cal { border: 1px solid #e3eadf; border-radius: 18px; padding: 14px; background: #fff; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-title { font: 800 1rem var(--font-head); letter-spacing: -.03em; text-transform: capitalize; }
.cal-nav { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #dce5db; background: #fff; color: var(--forest); font-size: 1rem; transition: .2s; }
.cal-nav:hover:not(:disabled) { background: var(--sun); border-color: var(--sun); }
.cal-nav:disabled { opacity: .3; cursor: not-allowed; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-week span { text-align: center; font-size: .6rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #8a9a90; padding: 4px 0; }
.cal-grid.swap { animation: calSwap .35s var(--ease); }
@keyframes calSwap { from { opacity: 0; transform: translateX(10px); } }
.cal-day { aspect-ratio: 1 / .92; border: 1.5px solid transparent; border-radius: 12px; background: #f1f8f3; color: var(--forest); font-weight: 800; font-size: .82rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; transition: transform .2s var(--ease), background .2s, border-color .2s; padding: 0; position: relative; }
.cal-day small { font-size: .52rem; font-weight: 800; letter-spacing: .02em; line-height: 1; }
.cal-day.open:hover, .cal-day.low:hover { transform: translateY(-2px) scale(1.05); border-color: var(--leaf); background: #e1f3e8; }
.cal-day.low { background: #fff4df; color: #8a4b08; }
.cal-day.low:hover { background: #ffe9bd; border-color: var(--sun); }
.cal-day.past, .cal-day.out, .cal-day.closed, .cal-day.full { background: transparent; color: #b4bfb7; cursor: not-allowed; font-weight: 600; }
.cal-day.full { text-decoration: line-through; }
.cal-day.today::after { content: ''; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--teal); }
.cal-day.selected { background: var(--forest) !important; color: #fff !important; border-color: var(--forest) !important; transform: scale(1.06); box-shadow: 0 8px 20px #07382c44; animation: pop .35s var(--ease); }
@keyframes pop { 50% { transform: scale(1.16); } }
.cal-pad { visibility: hidden; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: .64rem; font-weight: 700; color: var(--muted); }
.cal-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.lg-open { background: #cfe9d8; } .lg-low { background: #ffd98f; } .lg-full { background: #d6dcd8; }

.bk-avail { min-height: 46px; margin-top: 12px; padding: 11px 14px; border-radius: 12px; font-size: .78rem; font-weight: 700; background: #f4f6f2; color: var(--muted); transition: background .3s, color .3s; }
.bk-avail.ok { background: #e6f6ec; color: #17583f; }
.bk-avail.low { background: #fff1d6; color: #8a4b08; }

/* viajeros */
.stepper { display: inline-flex; align-items: center; gap: 4px; border: 1.5px solid #dce5db; border-radius: 99px; padding: 4px; background: #fff; }
.stepper button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: #eef7f1; color: var(--forest); font-size: 1.2rem; font-weight: 800; transition: .2s; }
.stepper button:hover:not(:disabled) { background: var(--sun); }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper output { min-width: 44px; text-align: center; font: 800 1.1rem var(--font-head); }
.bk-guestline { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.bk-guestline small { color: var(--muted); font-size: .72rem; font-weight: 700; }

.bk-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.bk-actions .btn:last-child:not(:only-child) { margin-left: auto; }
.bk-hint { font-size: .68rem; color: var(--muted); margin: 10px 0 0; }

/* formulario */
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin: 6px 0; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; font-size: .68rem; font-weight: 800; margin-bottom: 7px; }
.field input, .field textarea { width: 100%; border: 1.5px solid #dce5db; border-radius: 12px; background: #fff; padding: 13px; color: var(--forest); outline: none; transition: border-color .2s, box-shadow .2s; }
.field input:focus, .field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 4px #00a69c1f; }
.field input:user-invalid { border-color: #d9534f; }
.field textarea { min-height: 86px; resize: vertical; }

/* revisión */
.bk-review { border: 1px solid #e3eadf; border-radius: 16px; background: #fff; padding: 6px 18px; margin: 8px 0 16px; }
.bk-review div { display: flex; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px dashed #e3eadf; font-size: .8rem; }
.bk-review div:last-child { border: 0; }
.bk-review dt { color: var(--muted); font-weight: 700; } .bk-review dd { margin: 0; font-weight: 800; text-align: right; word-break: break-word; }
.bk-send { display: grid; gap: 10px; }
.bk-note { background: #fff4df; border-radius: 12px; padding: 12px 14px; font-size: .72rem; line-height: 1.55; color: #6b4a12; margin: 0 0 14px; }

/* éxito */
.bk-done { text-align: center; padding: 18px 6px; }
.bk-check { width: 76px; height: 76px; margin: 0 auto 16px; }
.bk-check circle { stroke: var(--leaf); stroke-width: 4; fill: #e6f6ec; stroke-dasharray: 210; stroke-dashoffset: 210; animation: draw .7s .1s var(--ease) forwards; }
.bk-check path { stroke: var(--leaf); stroke-width: 5; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 50; stroke-dashoffset: 50; animation: draw .5s .6s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.bk-ref { display: inline-block; margin: 8px 0 14px; padding: 8px 16px; border-radius: 99px; background: var(--cream); font: 800 .9rem var(--font-head); letter-spacing: .08em; }
.bk-next { text-align: left; max-width: 420px; margin: 0 auto 20px; padding: 0; list-style: none; display: grid; gap: 10px; font-size: .8rem; line-height: 1.5; color: var(--muted); }
.bk-next li { display: flex; gap: 10px; } .bk-next li::before { content: '✓'; color: var(--leaf); font-weight: 900; }
#confetti { position: fixed; inset: 0; z-index: 500; pointer-events: none; width: 100%; height: 100%; }

/* ----- Diálogo de detalles ----- */
.detail { grid-template-columns: 1fr 1fr; width: min(860px, 100%); }
.detail-img { position: relative; min-height: 360px; }
.detail-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.detail-body { padding: 30px; overflow: auto; max-height: calc(100dvh - 36px); }
.detail-body h3 { font: 800 1.7rem / 1.1 var(--font-head); letter-spacing: -.055em; margin: 12px 0; }
.detail-body p { color: var(--muted); line-height: 1.7; font-size: .86rem; }
.detail-list { list-style: none; padding: 0; margin: 16px 0 22px; display: grid; gap: 8px; }
.detail-list li { font-size: .78rem; font-weight: 800; display: flex; gap: 9px; } .detail-list li::before { content: '✓'; color: var(--leaf); }

@media (max-width: 820px) {
  .dialog-wrap { padding: 0; align-items: end; }
  .dialog-box { border-radius: 24px 24px 0 0; max-height: 96dvh; width: 100%; }
  .booking { grid-template-columns: 1fr; overflow: auto; }
  .bk-summary { flex-direction: row; align-items: center; overflow: visible; }
  .bk-photo { display: none; }
  .bk-sum-body { padding: 14px 64px 14px 18px; flex-direction: row; align-items: center; gap: 12px; }
  .bk-sum-body h3 { font-size: .85rem; flex: 1; } .bk-meta, .bk-rows, .bk-trust { display: none; }
  .bk-total { margin: 0; border: 0; padding: 0; text-align: right; } .bk-total small { display: none; } .bk-total strong { font-size: 1.3rem; }
  .bk-main { padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); max-height: none; overflow: visible; }
  .bk-steps { padding: 0; }
  .bk-tours { grid-template-columns: 1fr; } .bk-tour span { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
  .formgrid { grid-template-columns: 1fr; } .field.full { grid-column: auto; }
  .detail { grid-template-columns: 1fr; overflow: auto; } .detail-img { min-height: 210px; } .detail-body { max-height: none; padding: 22px 20px 26px; }
}
