/* ============================================================
   Wildhart Booking — the booking widget
   Calendar · live dynamic-price breakdown · add-ons · reserve.
   Inherits the theme's design tokens (--forest, --ember, etc.)
   with safe fallbacks so the plugin works on any theme.
   ============================================================ */

.whb-widget {
  --whb-forest: var(--forest, #2F3E34);
  --whb-ember:  var(--ember, #C8703A);
  --whb-sage:   var(--sage, #8A9B82);
  --whb-linen:  var(--linen, #F8F4EC);
  --whb-canvas: var(--canvas, #EFE9DD);
  --whb-bark:   var(--bark, #3B362F);
  --whb-stone:  var(--stone, #94897A);
  --whb-line:   rgba(47, 62, 52, 0.16);

  background: #fff;
  border: 1px solid var(--whb-line);
  border-radius: 14px;
  padding: 1.6rem;
  box-shadow:
    0 1px 2px rgba(47,62,52,.05),
    0 14px 40px -18px rgba(47,62,52,.34),
    0 40px 80px -50px rgba(47,62,52,.4);
  font-family: var(--body-font, "Inter", system-ui, sans-serif);
  color: var(--whb-bark);
}

.whb-widget__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--whb-line);
}
.whb-widget__eyebrow {
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--whb-ember);
}
.whb-widget__from { font-size: 0.95rem; color: var(--whb-stone); }
.whb-widget__from strong {
  font-family: var(--display-font, "Fraunces", Georgia, serif);
  font-size: 1.25rem; color: var(--whb-forest);
}

/* ---- calendar ---- */
.whb-widget__cal { margin-top: 1.1rem; }
.whb-cal__nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.7rem;
}
.whb-cal__title {
  font-family: var(--display-font, "Fraunces", Georgia, serif);
  font-size: 1.1rem; font-weight: 500; color: var(--whb-forest);
}
.whb-cal__prev, .whb-cal__next {
  width: 34px; height: 34px;
  border: 1px solid var(--whb-line); background: var(--whb-linen);
  border-radius: 8px; cursor: pointer;
  font-size: 1.1rem; color: var(--whb-forest);
  transition: background .15s ease, border-color .15s ease;
}
.whb-cal__prev:hover, .whb-cal__next:hover {
  background: var(--whb-canvas); border-color: var(--whb-sage);
}
.whb-cal__prev[disabled] { opacity: .35; cursor: not-allowed; }

.whb-cal__grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.whb-cal__dow {
  text-align: center; font-size: 0.66rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--whb-stone); padding: 4px 0;
}
.whb-cal__day {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.85rem;
  background: var(--whb-linen);
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.whb-cal__day.is-empty { background: transparent; cursor: default; }
.whb-cal__day.is-out {
  color: #c5c0b6; background: #faf8f3;
  cursor: not-allowed; text-decoration: line-through;
}
.whb-cal__day:not(.is-out):not(.is-empty):hover {
  border-color: var(--whb-ember);
}
.whb-cal__day .whb-tier {
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%;
}
.whb-tier--weekday { background: var(--whb-sage); }
.whb-tier--weekend { background: #C9A24A; }
.whb-tier--holiday { background: var(--whb-ember); }

.whb-cal__day.is-selected {
  background: var(--whb-forest); color: #fff; border-color: var(--whb-forest);
}
.whb-cal__day.is-range {
  background: linear-gradient(180deg, rgba(200,112,58,.20), rgba(200,112,58,.10));
  color: var(--whb-bark);
}
.whb-cal__day.is-endpoint {
  background: var(--whb-ember); color: #fff; border-color: var(--whb-ember);
}
.whb-cal__day.is-selected .whb-tier,
.whb-cal__day.is-endpoint .whb-tier { display: none; }

.whb-cal__legend {
  display: flex; gap: 1rem; flex-wrap: wrap;
  margin-top: 0.8rem;
  font-size: 0.72rem; color: var(--whb-stone);
}
.whb-cal__legend span { display: inline-flex; align-items: center; gap: 0.35rem; }
.whb-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.whb-dot--wd { background: var(--whb-sage); }
.whb-dot--we { background: #C9A24A; }
.whb-dot--hd { background: var(--whb-ember); }
.whb-dot--x  { background: #d8d2c6; }

/* ---- selected dates ---- */
.whb-widget__dates {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem;
  margin-top: 1rem;
}
.whb-date {
  background: var(--whb-linen); border: 1px solid var(--whb-line);
  border-radius: 9px; padding: 0.7rem 0.85rem;
}
.whb-date__l {
  display: block; font-size: 0.68rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--whb-stone);
}
.whb-date__v {
  display: block; margin-top: 0.2rem;
  font-family: var(--display-font, "Fraunces", Georgia, serif);
  font-size: 1.02rem; color: var(--whb-forest);
}

/* ---- add-ons ---- */
.whb-widget__addons { margin-top: 1.3rem; }
.whb-widget__addons .whb-widget__eyebrow { display: block; margin-bottom: 0.6rem; }
.whb-addon {
  display: flex; align-items: flex-start; gap: 0.7rem;
  padding: 0.7rem; margin-bottom: 0.4rem;
  border: 1px solid var(--whb-line); border-radius: 9px;
  cursor: pointer;
  transition: border-color .14s ease, background .14s ease;
}
.whb-addon:hover { border-color: var(--whb-sage); background: var(--whb-linen); }
.whb-addon input { margin-top: 3px; accent-color: var(--whb-ember); }
.whb-addon__body { flex: 1; }
.whb-addon__name { display: block; font-weight: 600; font-size: 0.92rem; color: var(--whb-bark); }
.whb-addon__note { display: block; font-size: 0.78rem; color: var(--whb-stone); margin-top: 1px; }
.whb-addon__price {
  font-weight: 600; font-size: 0.85rem; color: var(--whb-forest);
  white-space: nowrap;
}
.whb-addon:has(input:checked) {
  border-color: var(--whb-ember);
  background: rgba(200,112,58,.06);
}

/* ---- price summary ---- */
.whb-widget__summary {
  margin-top: 1.2rem; padding: 1rem;
  background:
    linear-gradient(170deg, #fff 0%, var(--whb-canvas) 70%);
  border: 1px solid var(--whb-line);
  border-radius: 10px;
}
.whb-summary__empty { margin: 0; font-size: 0.88rem; color: var(--whb-stone); }
.whb-line {
  display: flex; justify-content: space-between; gap: 1rem;
  font-size: 0.86rem; padding: 0.22rem 0;
}
.whb-line span:first-child { color: var(--whb-bark); }
.whb-line__tier { color: var(--whb-stone) !important; font-size: 0.8rem; }
.whb-line__sub {
  border-top: 1px solid var(--whb-line);
  margin-top: 0.35rem; padding-top: 0.45rem; font-weight: 600;
}
.whb-line__total {
  border-top: 2px solid var(--whb-forest);
  margin-top: 0.5rem; padding-top: 0.55rem;
}
.whb-line__total span {
  font-family: var(--display-font, "Fraunces", Georgia, serif);
  font-size: 1.15rem; color: var(--whb-forest); font-weight: 600;
}
.whb-summary__warn {
  margin: 0.6rem 0 0; font-size: 0.8rem;
  color: #a8453a; font-weight: 500;
}

/* ---- CTA ---- */
.whb-widget__cta {
  width: 100%; margin-top: 1.1rem;
  padding: 0.95rem 1rem;
  background: linear-gradient(180deg, #d27c45 0%, var(--whb-ember) 100%);
  color: #fff;
  border: none; border-radius: 10px;
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 8px 18px -8px rgba(200,112,58,.6);
  font-family: var(--body-font, "Inter", sans-serif);
  font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: filter .16s ease, transform .1s ease;
}
.whb-widget__cta:hover:not([disabled]) { filter: brightness(.94); transform: translateY(-1px); }
.whb-widget__cta[disabled] { background: #cbc4b6; cursor: not-allowed; }
.whb-widget__note {
  margin: 0.6rem 0 0; text-align: center;
  font-size: 0.76rem; color: var(--whb-stone);
}

/* ---- units grid (shortcode) ---- */
.whb-units {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.6rem;
}
.whb-unit-card {
  background: #fff; border: 1px solid var(--line, rgba(47,62,52,.14));
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(47,62,52,.05), 0 12px 30px -18px rgba(47,62,52,.3);
  transition: transform .2s ease, box-shadow .2s ease;
}
.whb-unit-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 2px 4px rgba(47,62,52,.07), 0 24px 48px -22px rgba(47,62,52,.42);
}
.whb-unit-card__media {
  display: block; position: relative;
  aspect-ratio: 4 / 3; overflow: hidden;
}
.whb-unit-card__media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s cubic-bezier(.2,.7,.2,1);
}
/* scrim — gives the corner badge contrast over any photo, and seats
   the image into the card instead of letting it float flat */
.whb-unit-card__media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(
    180deg,
    rgba(34,43,37,.32) 0%,
    rgba(34,43,37,0) 34%,
    rgba(34,43,37,0) 66%,
    rgba(34,43,37,.30) 100%);
  pointer-events: none;
}
.whb-unit-card:hover .whb-unit-card__media img { transform: scale(1.05); }
.whb-unit-card__type {
  position: absolute; top: 12px; left: 12px;
  background: rgba(34,43,37,.86); color: #F8F4EC;
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px;
}
.whb-unit-card__body { padding: 1.3rem; }
.whb-unit-card__name {
  margin: 0; font-family: var(--display-font, "Fraunces", Georgia, serif);
  font-size: 1.3rem; line-height: 1.2;
}
.whb-unit-card__name a { text-decoration: none; color: var(--forest, #2F3E34); }
.whb-unit-card__name a:hover { color: var(--ember, #C8703A); }
.whb-unit-card__meta {
  margin: 0.3rem 0 0; font-size: 0.82rem; color: var(--stone, #94897A);
}
.whb-unit-card__excerpt {
  margin: 0.6rem 0 0; font-size: 0.9rem;
  color: var(--bark, #3B362F); line-height: 1.55;
}
.whb-unit-card__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.8rem; margin-top: 1rem; padding-top: 0.9rem;
  border-top: 1px solid var(--line, rgba(47,62,52,.14));
}
.whb-unit-card__price { font-size: 0.85rem; color: var(--stone, #94897A); }
.whb-unit-card__price strong {
  font-family: var(--display-font, "Fraunces", Georgia, serif);
  font-size: 1.12rem; color: var(--forest, #2F3E34);
}
.whb-unit-card__link {
  font-size: 0.86rem; font-weight: 600;
  color: var(--ember, #C8703A); text-decoration: none;
  white-space: nowrap;
  border-bottom: 1.5px solid currentColor; padding-bottom: 1px;
}

/* ---- responsive ---- */
@media (max-width: 560px) {
  .whb-widget { padding: 1.2rem; }
  .whb-widget__dates { grid-template-columns: 1fr; }
  .whb-cal__day { font-size: 0.78rem; }
}

@media (prefers-reduced-motion: reduce) {
  .whb-unit-card, .whb-unit-card__media img, .whb-widget__cta { transition: none; }
}
