/* ===========================================================
   Rest Camp — booking engine + reservations agent
   Loaded alongside site.css
   =========================================================== */

/* ---------- quick availability bar ---------- */
.bookbar {
  position: relative; z-index: 20;
  margin-top: -2.75rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: clamp(1rem, 2.5vw, 1.5rem);
}
.bookbar__grid { display: grid; gap: .9rem; grid-template-columns: 1fr; align-items: end; }
@media (min-width: 780px) { .bookbar__grid { grid-template-columns: 1fr 1fr 1fr auto; } }

/* ---------- form primitives ---------- */
.field { display: grid; gap: .4rem; min-width: 0; }
.field > label { font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-soft); }
.field input, .field select, .field textarea {
  width: 100%; padding: .78em .9em;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--forest); box-shadow: 0 0 0 3px rgba(29,58,47,.12);
}
.field textarea { resize: vertical; min-height: 130px; }
.field__hint { font-size: .76rem; color: var(--text-soft); }
.field__error { font-size: .78rem; color: #a3372f; }
.field--invalid input, .field--invalid select, .field--invalid textarea { border-color: #a3372f; }

.stepper { display: flex; align-items: center; gap: .35rem; }
.stepper button {
  width: 2.15rem; height: 2.15rem; flex: none; display: grid; place-content: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 50%;
  cursor: pointer; font-size: 1.15rem; line-height: 1;
  transition: background .2s var(--ease), border-color .2s var(--ease);
}
.stepper button:hover:not(:disabled) { background: var(--surface-alt); border-color: var(--forest); }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper output { min-width: 2.2rem; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- status ---------- */
.bk-status {
  display: flex; align-items: center; gap: .7rem;
  padding: 1rem 1.15rem; border-radius: var(--radius);
  background: var(--surface-alt); font-size: .93rem; margin-bottom: 1.5rem;
}
.bk-status--error { background: #fbeceb; color: #7d2b25; }
.bk-status--ok { background: #e9f3ec; color: #1f5133; }
.bk-status[hidden] { display: none; }

.spinner {
  width: 1.05rem; height: 1.05rem; flex: none;
  border: 2px solid rgba(29,58,47,.22); border-top-color: var(--forest);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- results ---------- */
.bk-layout { display: grid; gap: clamp(1.5rem, 4vw, 2.5rem); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 1020px) { .bk-layout { grid-template-columns: 1fr 348px; } }

.bk-results { display: grid; gap: 1.1rem; }
.bk-room {
  display: grid; gap: 1.25rem; align-items: center; grid-template-columns: 1fr;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(1rem, 2.5vw, 1.5rem);
}
@media (min-width: 840px) { .bk-room { grid-template-columns: 190px 1fr auto; } }
.bk-room__media { aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; position: relative; background: linear-gradient(140deg, var(--moss), var(--forest-deep)); }
.bk-room__media img { width: 100%; height: 100%; object-fit: cover; }
.bk-room h3 { margin-bottom: .3rem; }
.bk-room__price { display: grid; gap: .6rem; justify-items: end; text-align: right; }
@media (max-width: 839px) { .bk-room__price { justify-items: start; text-align: left; } }
.bk-room--out { opacity: .55; }

.bk-badge {
  display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  padding: .3em .7em; border-radius: 100px; background: var(--surface-alt); color: var(--text-soft);
}
.bk-badge--low { background: #fdf0dd; color: #8a5f24; }
.bk-badge--out { background: #f1eeea; color: #7a746b; }

/* ---------- summary rail ---------- */
.bk-summary {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 1.75rem); position: sticky; top: 98px;
}
.bk-summary h3 { font-size: 1.15rem; }
.bk-line { display: flex; justify-content: space-between; gap: 1rem; padding-block: .5rem; font-size: .93rem; }
.bk-line span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.bk-line--total {
  border-top: 1px solid var(--line); margin-top: .5rem; padding-top: .9rem;
  font-family: var(--font-head); font-size: 1.3rem; color: var(--forest);
}
.bk-line--muted { color: var(--text-soft); font-size: .85rem; }
.bk-empty { color: var(--text-soft); font-size: .92rem; }

/* ---------- steps ---------- */
.bk-steps { counter-reset: bkstep; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 0 0 2rem; padding: 0; list-style: none; }
.bk-steps li { display: flex; align-items: center; gap: .55rem; font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--text-soft); }
.bk-steps li::before {
  content: counter(bkstep); counter-increment: bkstep;
  width: 1.7rem; height: 1.7rem; flex: none; display: grid; place-content: center;
  border: 1px solid var(--line); border-radius: 50%; font-size: .75rem; font-weight: 700;
}
.bk-steps li[aria-current="step"] { color: var(--forest); font-weight: 700; }
.bk-steps li[aria-current="step"]::before { background: var(--forest); color: var(--text-invert); border-color: var(--forest); }
.bk-steps li[data-done="true"]::before { content: "\2713"; background: var(--ochre); color: #241804; border-color: var(--ochre); }

.bk-panel[hidden] { display: none; }
.bk-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.bk-fields { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.bk-fields .field--wide { grid-column: 1 / -1; }

.policy-note { font-size: .84rem; color: var(--text-soft); line-height: 1.6; }
.policy-note strong { color: var(--text); }

/* ---------- reservations agent ---------- */
.agent-launch {
  position: fixed; right: clamp(1rem, 3vw, 1.75rem); bottom: clamp(1rem, 3vw, 1.75rem); z-index: 70;
  display: flex; align-items: center; gap: .6rem;
  padding: .85em 1.35em; border: 0; border-radius: 100px;
  background: var(--forest); color: var(--text-invert);
  font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  box-shadow: var(--shadow-lg); cursor: pointer; transition: transform .25s var(--ease);
}
.agent-launch:hover { transform: translateY(-3px); }
.agent-launch[hidden] { display: none; }
.agent-launch__dot {
  width: .55rem; height: .55rem; border-radius: 50%; background: #6ddba1;
  box-shadow: 0 0 0 0 rgba(109,219,161,.7); animation: pulse 2.4s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 .55rem rgba(109,219,161,0); } 100% { box-shadow: 0 0 0 0 rgba(109,219,161,0); } }

.agent {
  position: fixed; right: clamp(1rem, 3vw, 1.75rem); bottom: clamp(1rem, 3vw, 1.75rem); z-index: 80;
  width: min(390px, calc(100vw - 2rem)); height: min(580px, calc(100dvh - 2rem));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.agent[hidden] { display: none; }
.agent__head { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.15rem; background: var(--forest); color: var(--text-invert); }
.agent__head strong { font-family: var(--font-head); font-weight: 600; font-size: 1rem; display: block; }
.agent__head small { display: block; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; opacity: .72; }
.agent__close { margin-left: auto; background: none; border: 0; color: inherit; font-size: 1.6rem; line-height: 1; cursor: pointer; padding: .1rem .35rem; }
.agent__log { flex: 1; overflow-y: auto; padding: 1.15rem; display: grid; gap: .85rem; align-content: start; }
.msg { max-width: 86%; padding: .7em 1em; border-radius: 14px; font-size: .92rem; line-height: 1.55; }
.msg--bot { background: var(--surface-alt); border-bottom-left-radius: 4px; justify-self: start; }
.msg--user { background: var(--forest); color: var(--text-invert); border-bottom-right-radius: 4px; justify-self: end; }
.msg strong { font-weight: 700; }
.msg--typing { display: flex; gap: .25rem; align-items: center; }
.msg--typing i { width: .4rem; height: .4rem; border-radius: 50%; background: var(--text-soft); animation: blink 1.3s infinite; }
.msg--typing i:nth-child(2) { animation-delay: .18s; }
.msg--typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }
.agent__chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: 0 1.15rem .75rem; }
.chip { padding: .45em .9em; font-size: .78rem; border: 1px solid var(--line); border-radius: 100px; background: var(--surface); cursor: pointer; transition: background .2s var(--ease); }
.chip:hover { background: var(--surface-alt); }
.agent__form { display: flex; gap: .5rem; padding: .85rem 1.15rem 1.15rem; border-top: 1px solid var(--line); }
.agent__form input { flex: 1; padding: .7em .9em; border: 1px solid var(--line); border-radius: 100px; }
.agent__form input:focus { outline: none; border-color: var(--forest); }
.agent__form button { width: 2.6rem; height: 2.6rem; flex: none; border: 0; border-radius: 50%; background: var(--forest); color: var(--text-invert); cursor: pointer; display: grid; place-content: center; }
