/* ==========================================================================
   Motor de reserva — Arraial d'Ajuda Eco Resort
   Sanfona presa ao botão "Faça sua reserva". Usa só os tokens do tema
   (navy, sand, copper, Cooper Hewitt); nada do layout da agência muda.
   ========================================================================== */

/* ---------- botão do hero: só ganha a seta ---------- */
.btn-reserva .rsv-chev {
  display: inline-block;
  margin-left: 12px;
  font-size: 0.75em;
  transition: transform 0.35s cubic-bezier(.2, .8, .2, 1);
}
.btn-reserva[aria-expanded="true"] .rsv-chev { transform: rotate(180deg); }

/* ---------- painel ---------- */
.rsv {
  --rsv-w: min(920px, 92vw);
  font-family: 'Cooper Hewitt', sans-serif;
  color: var(--navy-color);
  z-index: 3;
  pointer-events: none;
}
.rsv.is-open { pointer-events: auto; }

/* sanfona: anima a altura real sem medir em JS */
.rsv-clip {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s cubic-bezier(.2, .8, .2, 1);
}
.rsv.is-open .rsv-clip { grid-template-rows: 1fr; }
.rsv-inner { min-height: 0; overflow: hidden; }

.rsv-card {
  background: var(--sand-color);
  border-radius: 7px;
  padding: 22px 24px 16px;
  box-shadow: 0 18px 50px rgba(0, 25, 45, 0.35);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(.2, .8, .2, 1);
}
.rsv.is-open .rsv-card { opacity: 1; transform: none; transition-delay: 0.08s; }

/* Abre PARA CIMA, sobre o vídeo (opção A, aprovada em 30/11/2026) */
.rsv[data-mode="up"] {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: var(--rsv-w);
  /* topo do botão = fundo do hero - (altura do botão - 30px) */
  bottom: calc(clamp(44px, 5.4vw, 60px) - 30px + 12px);
}

/* Aberto pela barra fixa (rolando a página) */
.rsv[data-mode="float"] {
  position: fixed;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  width: var(--rsv-w);
  z-index: 950;
}

/* ---------- formulário ---------- */
.rsv-form {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr auto;
  gap: 10px;
  align-items: stretch;
}
.rsv-field {
  all: unset;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-height: 58px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid rgba(0, 53, 91, 0.22);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.rsv-field:hover { border-color: var(--navy-color); }
.rsv-field:focus-visible,
.rsv-field.is-active {
  border-color: var(--navy-color);
  box-shadow: 0 0 0 2px rgba(0, 53, 91, 0.18);
}
.rsv-label {
  font-size: 11px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--copper-color);
  font-weight: 500;
}
.rsv-value { font-size: 16px; color: var(--navy-color); white-space: nowrap; }
.rsv-value.is-empty { color: #8a8f94; }

.rsv-submit {
  all: unset;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 26px;
  min-height: 58px;
  background: var(--copper-color);
  color: #fff;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
}
.rsv-submit:hover { background: #a96a39; }
.rsv-submit:focus-visible { outline: 2px solid var(--navy-color); outline-offset: 3px; }

.rsv-msg {
  margin-top: 10px;
  font-size: 14px;
  color: var(--no-color, #b0453c);
}
.rsv-msg:empty { display: none; }

.rsv-note {
  margin-top: 12px;
  font-size: 13px;
  color: #4d5b66;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: center;
}
.rsv-note i { color: var(--copper-color); margin-right: 5px; }
.rsv-note a { color: var(--navy-color); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- calendário ---------- */
.rsv-pop { margin-top: 12px; }
.rsv-pop[hidden] { display: none; }

.rsv-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.rsv-cal-hint { font-size: 14px; color: #4d5b66; }
.rsv-cal-hint b { color: var(--navy-color); font-weight: 600; }
.rsv-nav { display: flex; gap: 6px; }
.rsv-nav button {
  all: unset;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(0, 53, 91, .25);
  cursor: pointer;
}
.rsv-nav button:hover:not(:disabled) { background: #fff; }
.rsv-nav button:disabled { opacity: .3; cursor: default; }
.rsv-nav button:focus-visible { outline: 2px solid var(--navy-color); }

.rsv-months { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.rsv-month-title {
  text-align: center;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 4px 0 8px;
  font-weight: 500;
}
.rsv-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; }
.rsv-wd { text-align: center; font-size: 11px; color: #8a8f94; padding-bottom: 4px; }
.rsv-day {
  all: unset;
  box-sizing: border-box;
  height: 36px;
  display: grid;
  place-items: center;
  font-size: 14px;
  cursor: pointer;
  position: relative;
}
.rsv-day:disabled { color: #bbb; cursor: default; text-decoration: line-through; text-decoration-color: rgba(0,0,0,.15); }
.rsv-day:not(:disabled):hover span { background: #fff; }
.rsv-day span {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  position: relative; z-index: 1;
}
.rsv-day.in-range { background: rgba(192, 126, 73, 0.16); }
.rsv-day.is-start { background: linear-gradient(to right, transparent 50%, rgba(192,126,73,.16) 50%); }
.rsv-day.is-end   { background: linear-gradient(to left,  transparent 50%, rgba(192,126,73,.16) 50%); }
.rsv-day.is-start.is-end { background: none; }
.rsv-day.is-start span,
.rsv-day.is-end span { background: var(--navy-color) !important; color: var(--sand-color); }
.rsv-day.is-today span { box-shadow: inset 0 0 0 1px var(--copper-color); }
.rsv-day:focus-visible span { outline: 2px solid var(--copper-color); }

/* ---------- hóspedes ---------- */
.rsv-guests { display: grid; gap: 12px; max-width: 520px; margin-left: auto; }
.rsv-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 14px; background: #fff; border-radius: 6px;
}
.rsv-row small { display: block; color: #8a8f94; font-size: 12px; }
.rsv-step { display: flex; align-items: center; gap: 14px; }
.rsv-step button {
  all: unset;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(0,53,91,.35); cursor: pointer;
}
.rsv-step button:disabled { opacity: .3; cursor: default; }
.rsv-step button:focus-visible { outline: 2px solid var(--navy-color); }
.rsv-step output { min-width: 18px; text-align: center; font-size: 16px; }
.rsv-ages { display: flex; flex-wrap: wrap; gap: 8px; }
.rsv-ages label { font-size: 12px; color: #4d5b66; display: flex; flex-direction: column; gap: 3px; }
.rsv-ages select {
  font: inherit; font-size: 14px; color: var(--navy-color);
  padding: 6px 8px; border-radius: 6px; border: 1px solid rgba(0,53,91,.3); background: #fff;
}
.rsv-ages select.is-missing { border-color: var(--no-color, #b0453c); }
.rsv-done {
  all: unset; justify-self: end; cursor: pointer;
  font-size: 13px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--navy-color); border-bottom: 1px solid currentColor;
}

/* ---------- botão na barra fixa ---------- */
.rsv-sticky-btn {
  all: unset;
  margin-left: 18px;
  padding: 7px 16px;
  background: var(--navy-color);
  color: var(--sand-color);
  font-family: 'Cooper Hewitt', sans-serif;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.rsv-sticky-btn:hover { color: var(--copper-color); }
.rsv-sticky-btn:focus-visible { outline: 2px solid var(--copper-color); outline-offset: 2px; }

/* ---------- fundo escuro (celular / barra fixa) ---------- */
.rsv-backdrop {
  position: fixed; inset: 0;
  background: rgba(0, 20, 35, .45);
  z-index: 940;
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
}
.rsv-backdrop.is-on { opacity: 1; pointer-events: auto; }
.rsv-handle, .rsv-x { display: none; }

/* ---------- tablet ---------- */
@media (max-width: 899px) {
  .rsv-form { grid-template-columns: 1fr 1fr; }
  .rsv-field--guests { grid-column: 1 / -1; }
  .rsv-submit { grid-column: 1 / -1; }
}

/* ---------- celular: vira "gaveta" de baixo (bottom sheet) ---------- */
@media (max-width: 599px) {
  .rsv[data-mode] {
    position: fixed;
    left: 0; right: 0; bottom: 0; top: auto;
    width: auto;
    transform: none;
    margin: 0;
    z-index: 100001; /* acima do aviso de cookies (99999) e do chat */
  }
  .rsv-backdrop { z-index: 100000; }
  .rsv-clip { display: block; }
  .rsv-inner {
    max-height: 90vh;
    overflow-y: auto;
    padding-top: 0 !important;
    transform: translateY(105%);
    transition: transform .4s cubic-bezier(.2,.8,.2,1);
  }
  .rsv.is-open .rsv-inner { transform: none; }
  .rsv-card { border-radius: 16px 16px 0 0; padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); opacity: 1; transform: none; }
  .rsv-handle { display: block; width: 44px; height: 4px; border-radius: 4px; background: rgba(0,53,91,.25); margin: 0 auto 10px; }
  .rsv-x {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px; font-size: 13px; letter-spacing: 2px; text-transform: uppercase;
  }
  .rsv-x button { all: unset; font-size: 22px; line-height: 1; padding: 4px 8px; cursor: pointer; }
  .rsv-months { grid-template-columns: 1fr; }
  .rsv-month:nth-child(2) { display: none; }
  .rsv-value { font-size: 15px; }
  .rsv-sticky-btn { margin-left: 10px; padding: 6px 10px; letter-spacing: 1px; }
}

@media (prefers-reduced-motion: reduce) {
  .rsv-clip, .rsv-card, .rsv-inner, .btn-reserva .rsv-chev, .rsv-backdrop { transition: none !important; }
}