/*
 * Booking calendar styles - shared, identical on both property sites.
 * Colors come from config/site.php (set as CSS variables by
 * booking-calendar.js); the values below are only fallbacks.
 * Everything is namespaced "bc-" so the site's older stylesheets can't
 * reach in and change it.
 */
.bc-page {
    --bc-booked: #d39a45;
    --bc-booked-text: #ffffff;
    --bc-stay: #5b5bd6;
    --bc-stay-border: #4d4db6;
    --bc-stay-text: #ffffff;
    --bc-past: #e8e4dc;
    --bc-past-text: #807d79;
    --bc-own: #a9d9b6;
    --bc-own-border: #769880;
    --bc-own-text: #1f4d2b;
    --bc-sister: #b3cff0;
    --bc-sister-border: #7d91a8;
    --bc-sister-text: #1d3f6e;
    --bc-owner: #f4b6c2;
    --bc-owner-border: #ab7f88;
    --bc-owner-text: #6b2232;
    --bc-gold: #8e7037;
    --bc-gold-dark: #6b5427;
    --bc-heading: #7a5c24;
    --bc-line: #cfc6b3;
    --bc-ink: #2b2b2b;
    --bc-muted: #5c5a55;
    font-family: "Poppins", system-ui, sans-serif;
    color: var(--bc-ink);
    display: flex;
    gap: 32px;
    align-items: flex-start;
    max-width: 1400px;
    margin: 28px auto 40px;
    padding: 0 24px;
    box-sizing: border-box;
}
.bc-page *, .bc-page *::before, .bc-page *::after { box-sizing: border-box; }

/* ---------- left: calendar ---------- */
.bc-cal-panel {
    flex: 1 1 auto;
    min-width: 0;
    background: #f2f1ee;
}
.bc-cal-heading {
    margin: 0;
    padding: 16px 0;
    border-bottom: 1px solid #e2ded5;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--bc-ink);
}
.bc-frame {
    /* Kept tight so the calendar itself gets the width. */
    margin: 14px 12px;
    padding: 14px 12px 12px;
    border: 1px solid var(--bc-gold);
    background: #f7f6f3;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.bc-sister-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 14px;
    background: #f4f8fd;
    border: 1px solid #c9ddf5;
    border-radius: 10px;
    cursor: pointer;
    position: relative;
}
.bc-sister-wrap[hidden] { display: none; }
.bc-sister-title { display: block; font-size: 15px; font-weight: 600; color: #274b7a; }
.bc-sister-sub { display: block; font-size: 13px; color: #3d5a80; }
.bc-sister-input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.bc-switch {
    flex-shrink: 0;
    width: 46px;
    height: 26px;
    border-radius: 13px;
    background: #b9c6d8;
    position: relative;
    transition: background 0.15s;
}
.bc-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ffffff;
    transition: left 0.15s;
}
.bc-sister-input:checked + .bc-switch { background: #3d6aa8; }
.bc-sister-input:checked + .bc-switch::after { left: 23px; }
.bc-sister-input:focus-visible + .bc-switch { outline: 2px solid var(--bc-stay); outline-offset: 2px; }

.bc-cal-body { display: block; }
/* The wrapper (not the months grid itself) is the box that measures its
   own width for the @container rules below. Safari mis-sizes a grid that
   both measures itself and auto-fits its columns - on the Mac it
   collapsed the months to almost no width, drawing them on top of each
   other. The wrapper is a plain full-width block, so measuring it is safe
   in every browser. */
.bc-months-wrap {
    width: 100%;
    container-type: inline-size;
    container-name: bcmonths;
}
.bc-nav {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--bc-gold);
    background: #ffffff;
    color: var(--bc-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}
.bc-nav:disabled { border-color: #ddd6c8; color: #c9c1b1; cursor: default; }
.bc-nav svg { width: 20px; height: 20px; }
.bc-months {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    /* Two months side by side, each at least 340px wide (day boxes ~46px).
       When the calendar is narrower than two of those plus the gap
       (705px), the @container rule below switches to one month per row,
       so the second month sits below the first instead of both getting
       squeezed tall and skinny. Stated directly rather than with
       auto-fit, which Safari mishandles here. */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
}
@container bcmonths (max-width: 705px) {
    .bc-months { grid-template-columns: minmax(0, 1fr); }
}
/* Browsers too old for @container (Safari before 16, 2022): fall back to
   the window width, which lands at about the same switch point. */
@supports not (container-type: inline-size) {
    @media (max-width: 780px) {
        .bc-months { grid-template-columns: minmax(0, 1fr); }
    }
}
/* Both views use the same 340px month minimum, so they switch between
   side-by-side and stacked at exactly the same width. The two-house view
   fits its two bar lanes into that by using slimmer bars and text. */
.bc-month { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.bc-month-head { display: flex; align-items: center; gap: 8px; height: 40px; }
.bc-month-title {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}
/* Arrow placement. Side by side: "<" on the first month, ">" on the
   second. Stacked (not enough width for two): both on the top month.
   Hidden arrows keep their space so the month name stays centered. */
.bc-m0 .bc-nav-next, .bc-m1 .bc-nav-prev { visibility: hidden; }
@container bcmonths (max-width: 705px) {
    .bc-m0 .bc-nav-next { visibility: visible; }
    .bc-m1 .bc-nav { visibility: hidden; }
}
.bc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.bc-weekdays div {
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #4a463f;
}

/* ---------- single-house view: style A day cells ---------- */
.bc-day {
    /* Square at every width (fixed heights made them tall and skinny when
       the calendar narrowed). */
    aspect-ratio: 1 / 1;
    /* No fixed min-height: with one, Safari works the square backwards
       (at least 44px tall = at least 44px wide) and on very narrow phones
       the row would push past the month's edge. The box still grows to
       fit its number and price on its own. */
    height: auto;
    width: 100%;
    margin: 0;
    padding: 0;
    border-radius: 8px;
    border: 1px solid var(--bc-line);
    background: #ffffff;
    font-family: inherit;
    color: var(--bc-ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    cursor: pointer;
    position: relative;
}
.bc-day:disabled { cursor: default; }
.bc-num { font-size: 15px; font-weight: 600; line-height: 18px; }
.bc-price { font-size: 11px; font-weight: 600; line-height: 14px; color: #5a554c; }
.bc-tag { font-size: 9px; font-weight: 700; letter-spacing: 1px; line-height: 11px; color: var(--bc-stay-text); }

.bc-past { background: var(--bc-past); border-color: var(--bc-past); color: var(--bc-past-text); }
.bc-booked, .bc-unpriced { background: var(--bc-booked); border-color: var(--bc-booked); color: var(--bc-booked-text); }
.bc-unpriced { opacity: 0.55; }
.bc-arriveOnly { background: linear-gradient(135deg, var(--bc-booked) 0 50%, #ffffff 50% 100%); }
.bc-departOnly { background: linear-gradient(135deg, #ffffff 0 50%, var(--bc-booked) 50% 100%); }
/* Back-to-back: one guest checks out and the next checks in the same day -
   two booked triangles with a thin white diagonal between them. */
.bc-turnover {
    background: linear-gradient(135deg, var(--bc-booked) 0 calc(50% - 2px), #ffffff calc(50% - 2px) calc(50% + 2px), var(--bc-booked) calc(50% + 2px) 100%);
    border-color: var(--bc-booked);
    color: var(--bc-booked-text);
}
.bc-in-range { background: #e1e4fc; border-color: #c8cdf6; color: #23236b; }
.bc-in-range .bc-price { color: #3f3f86; }
.bc-preview { background: #eff1fe; border: 1px dashed #b9bff3; }
.bc-preview-end { border: 2px dashed var(--bc-stay); }
.bc-sel-in, .bc-sel-out { background: var(--bc-stay); border-color: var(--bc-stay-border); color: var(--bc-stay-text); }
.bc-sel-in .bc-price, .bc-sel-out .bc-price { color: var(--bc-stay-text); opacity: 0.85; }
.bc-arriveOnly.bc-sel-in { background: linear-gradient(135deg, var(--bc-booked) 0 50%, var(--bc-stay) 50% 100%); }
.bc-departOnly.bc-sel-out { background: linear-gradient(135deg, var(--bc-stay) 0 50%, var(--bc-booked) 50% 100%); }
.bc-day:not(:disabled):hover { box-shadow: 0 0 0 2px rgba(91, 91, 214, 0.35); }
.bc-day:focus-visible, .bc-tile:focus-visible, .bc-nav:focus-visible { outline: 2px solid var(--bc-stay); outline-offset: 2px; }

/* ---------- two-house view: tiles + stay bars ---------- */
.bc-view-both .bc-month { background: #e9e5dc; padding: 10px 10px 8px; border-radius: 12px; }
.bc-view-both .bc-grid { gap: 3px; }
/* Each week row is as tall as a day tile is wide (7 tiles across), never
   shorter than the two bar lanes need (62px). Done with a spacer whose
   padding is a percentage of the row's width, not aspect-ratio: Safari
   turns "aspect-ratio 7/1 + min-height 62px" into "at least 434px wide",
   which pushed the week rows past the right edge of the month on
   iPhones. The tiles and bars are positioned over the spacer. */
.bc-week { position: relative; min-height: 62px; margin-bottom: 3px; }
.bc-week::before { content: ""; display: block; padding-top: calc(100% / 7); }
.bc-tiles { position: absolute; inset: 0; }
.bc-tile {
    height: 100%;
    width: 100%;
    margin: 0;
    padding: 3px 4px;
    border-radius: 6px;
    border: 1px solid var(--bc-line);
    background: #ffffff;
    font-family: inherit;
    color: var(--bc-ink);
    /* Day number on top, price underneath - side by side they collided
       once the tiles narrowed. The bar lanes sit below both. */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    cursor: pointer;
}
.bc-tile .bc-num { font-size: 12.5px; line-height: 13px; }
.bc-tile .bc-price { font-size: 9.5px; line-height: 11px; }
.bc-tile.bc-unavail { background: #f4f0e7; border-color: #d8d0bf; cursor: default; }
.bc-tile.bc-past { background: var(--bc-past); border-color: var(--bc-past); color: var(--bc-past-text); cursor: default; }
.bc-tile.bc-tile-end { background: #eceefe; }
.bc-tile:disabled { cursor: default; }
.bc-bar {
    position: absolute;
    height: 15px;
    display: flex;
    align-items: center;
    padding: 0 6px;
    overflow: hidden;
    pointer-events: none;
    border: 1px solid transparent;
    font-size: 9.5px;
    font-weight: 600;
    white-space: nowrap;
}
.bc-bar span { overflow: hidden; text-overflow: ellipsis; }
/* Tile: 3px padding + day number (13px) + price (11px) = 27px, then
   lane 0 (15px) and lane 1 (15px) with 2px between = bottom at 60px,
   inside the 62px minimum row height. */
.bc-lane-0 { top: 28px; }
.bc-lane-1 { top: 45px; }
.bc-bar-start { border-top-left-radius: 8px; border-bottom-left-radius: 8px; }
.bc-bar-end { border-top-right-radius: 8px; border-bottom-right-radius: 8px; }
.bc-bar-own { background: var(--bc-own); border-color: var(--bc-own-border); color: var(--bc-own-text); }
.bc-bar-sister { background: var(--bc-sister); border-color: var(--bc-sister-border); color: var(--bc-sister-text); }
.bc-bar-owner { background: var(--bc-owner); border-color: var(--bc-owner-border); color: var(--bc-owner-text); }
.bc-bar-mine { background: var(--bc-stay); border-color: var(--bc-stay-border); color: var(--bc-stay-text); }
.bc-bar-preview { background: rgba(91, 91, 214, 0.1); border: 2px dashed var(--bc-stay); color: #3f3f86; }

/* ---------- status, legend, notes ---------- */
.bc-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1px solid #e4ddcf;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}
.bc-link-btn {
    background: none;
    border: none;
    padding: 2px 0;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--bc-gold);
    text-decoration: underline;
    cursor: pointer;
}
.bc-link-btn[hidden] { display: none; }
.bc-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; font-size: 13px; }
.bc-legend-item { display: inline-flex; align-items: center; gap: 8px; }
.bc-sw { width: 20px; height: 20px; border-radius: 5px; border: 1px solid transparent; display: inline-block; }
.bc-sw-open { background: #ffffff; border-color: var(--bc-line); }
.bc-sw-booked { background: var(--bc-booked); }
.bc-sw-turn { background: linear-gradient(135deg, var(--bc-booked) 0 50%, #ffffff 50% 100%); border-color: var(--bc-line); }
.bc-sw-b2b { background: linear-gradient(135deg, var(--bc-booked) 0 calc(50% - 1.5px), #ffffff calc(50% - 1.5px) calc(50% + 1.5px), var(--bc-booked) calc(50% + 1.5px) 100%); }
.bc-sw-mine { background: var(--bc-stay); }
.bc-sw-past { background: var(--bc-past); }
.bc-sw-bar { width: 32px; height: 14px; border-radius: 7px; }
.bc-sw-own { background: var(--bc-own); border-color: var(--bc-own-border); }
.bc-sw-sister { background: var(--bc-sister); border-color: var(--bc-sister-border); }
.bc-sw-owner { background: var(--bc-owner); border-color: var(--bc-owner-border); }

/* Admin mode (owner only): reminder that guest names are on screen. */
.bc-admin-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 6px 16px;
    margin: 0 0 12px;
    padding: 8px 12px;
    border: 1px solid var(--bc-owner-border);
    border-radius: 6px;
    background: #fbeef1;
    color: var(--bc-owner-text);
    font-size: 13px;
}
.bc-admin-bar a { color: var(--bc-owner-text); font-weight: 600; text-decoration: underline; }
.bc-sister-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    background: #f6f5f2;
    border: 1px solid #e2ded5;
    color: var(--bc-muted);
}
.bc-sister-note[hidden] { display: none; }
.bc-sister-note.bc-sister-free { background: #f4f8fd; border-color: #c9ddf5; color: #274b7a; }
.bc-sister-note a { font-weight: 600; color: #274b7a; text-decoration: underline; white-space: nowrap; }

/* ---------- right: dates, pool heat, summary ---------- */
.bc-side { flex: 0 0 330px; display: flex; flex-direction: column; gap: 14px; }
/* Rating line at the top of the side panel: no extra space above it, and
   a tighter gap down to "Choose the Dates". */
.bc-side .testimonial-stats-bar--compact { margin: 0 0 -6px; }
.bc-side h2 { margin: 0; font-size: 20px; font-weight: 600; color: var(--bc-heading); font-family: inherit; }
/* Arrival and departure side by side, each half the panel width. */
.bc-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bc-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bc-field label { font-size: 12px; font-weight: 600; letter-spacing: 0.5px; color: var(--bc-muted); text-transform: uppercase; margin: 0; }
.bc-field input {
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--bc-line);
    border-radius: 6px;
    font-family: inherit;
    font-size: 15px;
    color: var(--bc-ink);
    background: #ffffff;
    width: 100%;
}
.bc-field input:focus { outline: 2px solid var(--bc-stay); outline-offset: 1px; }
.bc-hint { font-size: 12px; color: var(--bc-muted); margin-top: -6px; }

/* The pool heat checkbox: always clearly visible, even before dates are
   picked (the browser default was a faint gray box). */
.bc-heat { display: flex; align-items: center; gap: 12px; cursor: pointer; position: relative; margin: 0; font-weight: 400; }
.bc-heat-input { position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; left: 0; top: 50%; transform: translateY(-50%); cursor: pointer; }
.bc-heat-box {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 5px;
    border: 2px solid var(--bc-gold-dark);
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.bc-heat-box svg { width: 16px; height: 16px; opacity: 0; }
.bc-heat-input:checked + .bc-heat-box { background: var(--bc-gold); border-color: var(--bc-gold); }
.bc-heat-input:checked + .bc-heat-box svg { opacity: 1; }
.bc-heat-input:disabled + .bc-heat-box { background: #f4f1ea; border-color: #8c7d5f; }
.bc-heat-input:focus-visible + .bc-heat-box { outline: 2px solid var(--bc-stay); outline-offset: 2px; }
.bc-heat-input:disabled ~ .bc-heat-text { cursor: default; }
.bc-heat-label { display: block; font-size: 15px; font-weight: 500; color: var(--bc-ink); }
.bc-heat-hint { display: block; font-size: 12px; font-style: italic; color: var(--bc-heading); }
.bc-heat-hint[hidden] { display: none; }

.bc-message {
    padding: 10px 12px;
    background: #fdf3e2;
    border: 1px solid #e6c48a;
    border-radius: 6px;
    font-size: 13px;
    color: #6b4a12;
}
.bc-message[hidden] { display: none; }
.bc-stay-line { font-size: 13px; color: var(--bc-muted); }
.bc-summary { border-top: 1px solid var(--bc-gold); transition: opacity 0.15s; }
.bc-summary.bc-sum-loading { opacity: 0.45; }
.bc-sum-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 14px; border-bottom: 1px solid #ece7dc; }
.bc-sum-row.bc-sum-rule { border-bottom-color: var(--bc-gold); }
.bc-sum-row.bc-sum-total { border-bottom: none; padding-top: 10px; font-size: 16px; font-weight: 700; }
.bc-sum-row.bc-sum-taxline { font-size: 13px; color: var(--bc-muted); padding-left: 10px; }
.bc-taxdetail {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin: 0;
    padding: 5px 0 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--bc-muted);
    border-bottom: 1px solid #ece7dc;
    cursor: pointer;
}
.bc-taxdetail input { margin: 0; width: 14px; height: 14px; accent-color: var(--bc-gold); cursor: pointer; }
.bc-proceed {
    height: 52px;
    border: none;
    border-radius: 6px;
    background: var(--bc-gold);
    color: #ffffff;
    font-family: inherit;
    font-size: 17px;
    font-weight: 500;
    cursor: pointer;
}
.bc-proceed:hover:not(:disabled) { background: var(--bc-gold-dark); }
.bc-proceed:disabled { background: #c9bfa9; cursor: not-allowed; }
.bc-ask { font-size: 14px; font-weight: 500; color: var(--bc-gold); text-decoration: underline; }

/* ---------- narrower screens ---------- */
@media (max-width: 1100px) {
    .bc-page { flex-direction: column; align-items: stretch; }
    .bc-side { flex-basis: auto; max-width: 560px; width: 100%; margin: 0 auto; }
}
@media (max-width: 767px) {
    .bc-page { padding: 0 10px; margin-top: 16px; }
    .bc-frame { margin: 8px 6px; padding: 10px 8px; }
    .bc-nav { width: 32px; height: 32px; }
    .bc-num { font-size: 14px; }
    .bc-price { font-size: 10px; }
    .bc-status-bar, .bc-sister-note { flex-direction: column; align-items: flex-start; }
}

/* Promo code box (reservation page) */
.bc-promo { margin: 16px 0 4px; }
.bc-promo-label { display: block; font-size: 14px; font-weight: 500; color: var(--bc-ink); margin: 0 0 6px; }
.bc-promo-row { display: flex; gap: 8px; }
.bc-promo-row input {
    flex: 1 1 auto;
    min-width: 0;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--bc-line);
    border-radius: 6px;
    font-family: inherit;
    font-size: 15px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--bc-ink);
    background: #ffffff;
}
.bc-promo-row input:focus { outline: 2px solid var(--bc-stay); outline-offset: 1px; }
.bc-promo-apply {
    flex: 0 0 auto;
    height: 40px;
    padding: 0 18px;
    border: 1.5px solid var(--bc-gold);
    border-radius: 6px;
    background: #ffffff;
    color: var(--bc-gold-dark);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.bc-promo-apply:hover { background: #f8f3e8; }
.bc-promo-note { margin-top: 6px; font-size: 13px; line-height: 1.4; }
.bc-promo-note[hidden] { display: none; }
.bc-promo-ok { color: #1e6b34; }
.bc-promo-info { color: var(--bc-muted); }
.bc-promo-error { color: #a12a2a; }
.bc-sum-promo span:last-child { color: #1e6b34; font-weight: 600; }

/* No prices loaded (reservation.php) - guests get a plain notice, admin
   mode names the price file. */
.bc-noprices {
    margin: 0 0 12px;
    padding: 10px 14px;
    border: 1px solid #c94a4a;
    border-radius: 6px;
    background: #fdecec;
    color: #8f1f1f;
    font-size: 15px;
    font-weight: 600;
}
