/* =====================================================================
   COAST 67 — Booking bar (/book/ hero)  →  hands off to letsbook.me
   Scoped under body.coast67-tide. Brand palette + type per the Tide
   system (assets/coast67-tide.css). Namespaced .c67-bkg*.
   The flatpickr calendar is themed separately (it mounts on <body>).
   ===================================================================== */

/* ---- local fallbacks so the bar is self-sufficient ------------------ */
.coast67-tide .c67-bkg {
  --bkg-orange: var(--c67-orange, #D6894E);
  --bkg-orange-deep: var(--c67-orange-deep, #C2773B);
  --bkg-ink: var(--c67-ink, #4E4F47);
  --bkg-ink-soft: var(--c67-ink-soft, #6B6C62);
  --bkg-cream: var(--c67-cream, #FBF3E8);
  --bkg-cream-deep: var(--c67-cream-deep, #F3E7D5);
  --bkg-gold: var(--c67-gold, #F5C888);
  --bkg-opal: var(--c67-opal, #ADD2CB);
  --bkg-ease: var(--c67-ease, cubic-bezier(.16, 1, .3, 1));
  --bkg-ui: var(--c67-ui, "Bantayog", "Jost", system-ui, sans-serif);
  --bkg-display: var(--c67-display, "Minimalust", "Jost", system-ui, sans-serif);
  --bkg-serif: var(--c67-serif, "Gowa", Georgia, serif);
}

/* ---- wrapper the Elementor shortcode widget sits in ----------------- */
.coast67-tide .c67-bookbar-wrap { width: 100%; }
.coast67-tide .c67-bookbar-wrap .elementor-widget-container { display: flex; flex-direction: column; align-items: center; }

/* ---- the reservation bar ------------------------------------------- */
.coast67-tide .c67-bkg {
  position: relative;
  width: min(940px, 92vw);
  margin: 34px auto 0;
  background: rgba(251, 243, 232, .93);
  -webkit-backdrop-filter: blur(9px) saturate(1.05);
  backdrop-filter: blur(9px) saturate(1.05);
  border: 1px solid rgba(251, 243, 232, .55);
  border-radius: 2px;
  box-shadow: 0 26px 70px -28px rgba(22, 23, 19, .62), 0 2px 0 rgba(255, 255, 255, .25) inset;
  font-family: var(--bkg-ui);
  color: var(--bkg-ink);
}

.coast67-tide .c67-bkg__row {
  display: grid;
  grid-template-columns: 1.35fr 1fr auto;
  align-items: stretch;
}

/* a single field (Dates / Guests) — a click target that opens a popover */
.coast67-tide .c67-bkg__field {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 20px 26px;
  text-align: left;
  background: transparent;
  border: 0;
  border-right: 1px solid rgba(78, 79, 71, .14);
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: background-color .4s var(--bkg-ease);
  min-width: 0;
}
.coast67-tide .c67-bkg__field:hover,
.coast67-tide .c67-bkg__field.is-open { background: rgba(255, 255, 255, .5); }
.coast67-tide .c67-bkg__field:focus-visible { outline: 2px solid var(--bkg-orange); outline-offset: -2px; }

.coast67-tide .c67-bkg__label {
  font-family: var(--bkg-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--bkg-orange);
  line-height: 1;
}
.coast67-tide .c67-bkg__value {
  font-family: var(--bkg-display);
  font-weight: 100;
  font-size: clamp(1.05rem, 1.5vw, 1.3rem);
  line-height: 1.15;
  color: var(--bkg-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.coast67-tide .c67-bkg__value.is-placeholder { color: var(--bkg-ink-soft); font-style: normal; }
.coast67-tide .c67-bkg__value small {
  font-family: var(--bkg-ui);
  font-weight: 400;
  font-size: .62em;
  color: var(--bkg-ink-soft);
  margin: 0 .45em;
  letter-spacing: .04em;
}

/* the submit button cell */
.coast67-tide .c67-bkg__go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 clamp(24px, 3vw, 44px);
  min-height: 100%;
  background: var(--bkg-orange);
  color: var(--bkg-cream);
  border: 0;
  cursor: pointer;
  font-family: var(--bkg-ui);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color .4s var(--bkg-ease);
}
.coast67-tide .c67-bkg__go:hover { background: var(--bkg-orange-deep); }
.coast67-tide .c67-bkg__go:focus-visible { outline: 2px solid var(--bkg-ink); outline-offset: 3px; }
.coast67-tide .c67-bkg__go .c67-bkg__arrow {
  width: 22px; height: 8px;
  transition: transform .45s var(--bkg-ease);
}
.coast67-tide .c67-bkg__go:hover .c67-bkg__arrow { transform: translateX(5px); }

/* flatpickr anchor input lives inside the dates field but is not shown */
.coast67-tide .c67-bkg__fp { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; left: 0; bottom: 0; padding: 0; border: 0; }

/* raw native inputs = engine-facing source of truth (a11y + no-JS GET fallback).
   Visually hidden by default; the <noscript> block reveals them as a simple form. */
.coast67-tide .c67-bkg__raw { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; clip: rect(0 0 0 0); padding: 0; margin: -1px; }
.coast67-tide .c67-bkg__rawf { display: flex; flex-direction: column; gap: 6px; padding: 16px 22px 0; }
.coast67-tide .c67-bkg__rawf span { font-family: var(--bkg-ui); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--bkg-orange); }
.coast67-tide .c67-bkg__rawf input { font-family: var(--bkg-display); font-size: 1.1rem; padding: 10px 12px; border: 1px solid rgba(78, 79, 71, .25); background: #fff; color: var(--bkg-ink); border-radius: 2px; }
.coast67-tide .c67-bkg__go--raw { width: calc(100% - 44px); margin: 16px 22px 20px; min-height: 56px; }

/* ---- caption + error ------------------------------------------------ */
/* caption sits below the panel, over the hero image — use page-level tokens
   (the .c67-bkg-scoped vars don't reach here) + a strong shadow for legibility */
.coast67-tide .c67-bkg__note {
  margin: 18px auto 0;
  text-align: center;
  font-family: var(--c67-serif, "Gowa", Georgia, serif);
  font-style: italic;
  font-size: .95rem;
  color: var(--c67-cream, #FBF3E8);
  text-shadow: 0 1px 3px rgba(22, 23, 19, .7), 0 2px 22px rgba(22, 23, 19, .55);
  letter-spacing: .01em;
}
.coast67-tide .c67-bkg__note b { font-style: normal; font-weight: 400; color: var(--c67-gold, #F5C888); }
.coast67-tide .c67-bkg__error {
  display: none;
  margin: 12px auto 0;
  text-align: center;
  font-family: var(--bkg-ui);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(178, 74, 44, .96);
  padding: 9px 16px;
  border-radius: 2px;
  width: fit-content;
}
.coast67-tide .c67-bkg.has-error .c67-bkg__error { display: block; }
.coast67-tide .c67-bkg.has-error .c67-bkg__field--dates { box-shadow: inset 0 -2px 0 rgba(178, 74, 44, .9); }

/* ---- Guests popover ------------------------------------------------- */
.coast67-tide .c67-bkg__pop {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 40;
  width: 320px;
  max-width: calc(100vw - 32px);
  background: var(--bkg-cream);
  border: 1px solid rgba(78, 79, 71, .16);
  border-radius: 2px;
  box-shadow: 0 24px 60px -22px rgba(22, 23, 19, .55);
  padding: 8px 22px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .3s var(--bkg-ease), transform .3s var(--bkg-ease), visibility .3s;
}
.coast67-tide .c67-bkg__field--guests { position: relative; }
.coast67-tide .c67-bkg__field--guests.is-open .c67-bkg__pop { opacity: 1; visibility: visible; transform: translateY(0); }

.coast67-tide .c67-bkg__guestrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
}
.coast67-tide .c67-bkg__guestrow + .c67-bkg__guestrow { border-top: 1px solid rgba(78, 79, 71, .12); }
.coast67-tide .c67-bkg__guestname { font-family: var(--bkg-display); font-weight: 100; font-size: 1.25rem; color: var(--bkg-ink); line-height: 1; }
.coast67-tide .c67-bkg__guesthint { font-family: var(--bkg-ui); font-size: 11px; letter-spacing: .06em; color: var(--bkg-ink-soft); margin-top: 5px; }

.coast67-tide .c67-bkg__step { display: inline-flex; align-items: center; gap: 14px; }
.coast67-tide .c67-bkg__stepbtn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid rgba(78, 79, 71, .4);
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--bkg-ink);
  font-size: 20px; line-height: 1;
  transition: border-color .3s var(--bkg-ease), background-color .3s var(--bkg-ease), color .3s var(--bkg-ease), opacity .3s;
}
.coast67-tide .c67-bkg__stepbtn:hover { border-color: var(--bkg-orange); background: var(--bkg-orange); color: var(--bkg-cream); }
.coast67-tide .c67-bkg__stepbtn:focus-visible { outline: 2px solid var(--bkg-orange); outline-offset: 2px; }
.coast67-tide .c67-bkg__stepbtn[disabled] { opacity: .3; cursor: not-allowed; }
.coast67-tide .c67-bkg__stepbtn[disabled]:hover { border-color: rgba(78, 79, 71, .4); background: transparent; color: var(--bkg-ink); }
.coast67-tide .c67-bkg__stepval { font-family: var(--bkg-display); font-weight: 100; font-size: 1.4rem; min-width: 26px; text-align: center; color: var(--bkg-ink); }

.coast67-tide .c67-bkg__popdone {
  display: block; width: 100%;
  margin: 4px 0 18px;
  padding: 12px;
  background: transparent;
  border: 1px solid var(--bkg-ink);
  color: var(--bkg-ink);
  font-family: var(--bkg-ui); font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  cursor: pointer;
  transition: background-color .3s var(--bkg-ease), color .3s var(--bkg-ease);
}
.coast67-tide .c67-bkg__popdone:hover { background: var(--bkg-ink); color: var(--bkg-cream); }

/* ---- responsive: stack into a vertical card on small screens -------- */
@media (max-width: 860px) {
  .coast67-tide .c67-bkg { width: min(460px, 92vw); margin-top: 26px; }
  .coast67-tide .c67-bkg__row { grid-template-columns: 1fr; }
  .coast67-tide .c67-bkg__field { border-right: 0; border-bottom: 1px solid rgba(78, 79, 71, .14); padding: 18px 22px; }
  .coast67-tide .c67-bkg__go { min-height: 62px; padding: 0 24px; }
  .coast67-tide .c67-bkg__pop { width: 100%; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .coast67-tide .c67-bkg *,
  .flatpickr-calendar.c67-cal * { transition: none !important; animation: none !important; }
}

/* =====================================================================
   flatpickr — Coast 67 theme (calendar mounts on <body>, so use literal
   brand hex here; class .c67-cal is added to the container in JS).
   ===================================================================== */
.flatpickr-calendar.c67-cal {
  background: #FBF3E8;
  border: 1px solid rgba(78, 79, 71, .16);
  border-radius: 2px;
  box-shadow: 0 26px 66px -24px rgba(22, 23, 19, .55);
  font-family: "Bantayog", "Jost", system-ui, sans-serif;
}
.flatpickr-calendar.c67-cal.arrowTop:before,
.flatpickr-calendar.c67-cal.arrowTop:after { border-bottom-color: #FBF3E8; }
.flatpickr-calendar.c67-cal.arrowBottom:before,
.flatpickr-calendar.c67-cal.arrowBottom:after { border-top-color: #FBF3E8; }
.c67-cal .flatpickr-months { padding: 6px 4px 2px; }
.c67-cal .flatpickr-month, .c67-cal .flatpickr-current-month { color: #4E4F47; fill: #4E4F47; }
.c67-cal .flatpickr-current-month .flatpickr-monthDropdown-months,
.c67-cal .flatpickr-current-month input.cur-year {
  font-family: "Minimalust", "Jost", sans-serif; font-weight: 100; color: #4E4F47;
}
.c67-cal .flatpickr-monthDropdown-months { font-weight: 100; }
.c67-cal span.flatpickr-weekday { color: #6B6C62; font-weight: 500; letter-spacing: .1em; font-size: 10px; text-transform: uppercase; }
.c67-cal .flatpickr-prev-month svg, .c67-cal .flatpickr-next-month svg { fill: #4E4F47; }
.c67-cal .flatpickr-prev-month:hover svg, .c67-cal .flatpickr-next-month:hover svg { fill: #D6894E; }

.c67-cal .flatpickr-day {
  color: #4E4F47;
  border-radius: 2px;
  border-color: transparent;
  transition: background-color .18s ease, color .18s ease;
}
.c67-cal .flatpickr-day:hover { background: #F3E7D5; border-color: transparent; }
.c67-cal .flatpickr-day.today { border-color: #ADD2CB; }
.c67-cal .flatpickr-day.flatpickr-disabled,
.c67-cal .flatpickr-day.prevMonthDay,
.c67-cal .flatpickr-day.nextMonthDay { color: rgba(78, 79, 71, .32); }
.c67-cal .flatpickr-day.inRange,
.c67-cal .flatpickr-day.inRange:hover { background: #F0E1CC; border-color: #F0E1CC; box-shadow: -5px 0 0 #F0E1CC, 5px 0 0 #F0E1CC; }
.c67-cal .flatpickr-day.selected,
.c67-cal .flatpickr-day.startRange,
.c67-cal .flatpickr-day.endRange,
.c67-cal .flatpickr-day.selected:hover,
.c67-cal .flatpickr-day.startRange:hover,
.c67-cal .flatpickr-day.endRange:hover {
  background: #D6894E; border-color: #D6894E; color: #FBF3E8;
}
.c67-cal .flatpickr-day.startRange { border-radius: 2px 0 0 2px; }
.c67-cal .flatpickr-day.endRange { border-radius: 0 2px 2px 0; }
.c67-cal .flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)),
.c67-cal .flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)) { box-shadow: -10px 0 0 #D6894E; }
