/* Windhorse Booking (template-booking.php, assets/js/booking.js) — scoped to .whb so it never clashes with the theme.
   Fonts as on the itinerary pages (new-itinerary.css): Miller Display for headings, Merriweather Sans
   for text (enqueued by inc/trip-booking.php). */
@font-face { font-family: "Miller Display"; src: url('../fonts/MillerDisplay-Roman.woff') format('woff'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Miller Display"; src: url('../fonts/MillerDisplay-Semibold.woff') format('woff'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Miller Display"; src: url('../fonts/MillerDisplay-Bold.woff') format('woff'); font-weight: 700; font-style: normal; font-display: swap; }

:root { --whb-body: "Merriweather Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
.whb-page { background: var(--wh-page-bg, #fff); padding: 24px 0 8px; }
.whb-intro { max-width: 1080px; margin: 0 auto; padding: 0 16px; font-family: var(--whb-body); font-size: 16px; line-height: 1.55; color: #1f2328; }

.whb {
    --maroon: #7a1f2b;
    --maroon-dark: #5e1621;
    --ink: #1f2328;
    --slate: #59616b;
    --line: #d9dde1;
    --mist: #f1f3f4;
    --paper: #ffffff;
    --saffron: #e0a526;
    --ok: #26734d;
    --warn: #8a5a00;
    --warn-bg: #fff6e0;
    --err: #b42318;
    --err-bg: #fdf0ef;
    --flag-blue: #2f6db5;
    --flag-white: #ffffff;
    --flag-red: #c8372d;
    --flag-green: #2e8b57;
    --flag-yellow: #e8b828;
    --r: 10px;
    --whb-display: "Miller Display", "Miller Display Bold", Georgia, "Times New Roman", serif;

    font-family: var(--whb-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    max-width: 1080px;
    width: 100%;
    margin: 0 auto;
    container-type: inline-size;
    container-name: whb;
    padding: 8px 16px 64px;
    box-sizing: border-box;
    text-align: left;
}
.whb *, .whb *::before, .whb *::after { box-sizing: border-box; }
.whb [hidden] { display: none !important; }
.whb h1, .whb h2, .whb h3, .whb h4, .whb .whb-section-head, .whb .whb-pay-amount strong, .whb .whb-summary .whb-total dd, .whb .whb-ref { font-family: var(--whb-display); font-weight: 700; text-transform: none; letter-spacing: normal; color: var(--ink); }
.whb .whb-summary .whb-total dd { color: var(--maroon); }
.whb p { margin-top: 0; }

/* Block themes cap content width; give the booking form the wide width instead. */
.is-layout-constrained > .whb.whb, .entry-content > .whb.whb { max-width: min(1080px, 100%); margin-left: auto !important; margin-right: auto !important; }

/* ---------- Heading & prayer-flag progress ---------- */
.whb-head { margin: 8px 0 28px; }
.whb .whb-title { font-size: 34px; line-height: 1.15; font-weight: 700; margin: 0 0 6px; color: var(--ink); letter-spacing: -0.01em; }
.whb-sub { margin: 0; color: var(--slate); max-width: 62ch; }

.whb-flags { position: relative; margin: 28px 0 8px; padding-top: 6px; }
.whb-flags::before { /* the string */
    content: ''; position: absolute; left: 2%; right: 2%; top: 6px; height: 14px;
    border-top: 2px solid #8b8f94; border-radius: 50% 50% 0 0 / 14px 14px 0 0;
    transform: scaleY(-1); transform-origin: top;
}
.whb-flags ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; position: relative; }
.whb-flags li { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--slate); font-size: 15px; text-align: center; margin: 0; }
.whb-flag {
    width: 44px; height: 34px; margin-top: 8px;
    border: 2px solid #b8bdc3; border-top-width: 3px; background: var(--paper);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
    transform-origin: top center; transition: background-color .35s ease, border-color .35s ease, transform .35s ease;
}
.whb-flags li:nth-child(1) .whb-flag { --c: var(--flag-blue); margin-top: 12px; }
.whb-flags li:nth-child(2) .whb-flag { --c: var(--flag-red); margin-top: 18px; }
.whb-flags li:nth-child(3) .whb-flag { --c: var(--flag-green); margin-top: 18px; }
.whb-flags li:nth-child(4) .whb-flag { --c: var(--flag-yellow); margin-top: 12px; }
.whb-flags li.is-done .whb-flag { background: var(--c); border-color: var(--c); }
.whb-flags li.is-current .whb-flag { border-color: var(--c); background: color-mix(in srgb, var(--c) 18%, white); animation: whb-flutter 2.8s ease-in-out infinite; }
.whb-flags li.is-current, .whb-flags li.is-done { color: var(--ink); }
.whb-flags li.is-current span { font-weight: 700; }
@keyframes whb-flutter { 0%,100% { transform: skewX(0) } 50% { transform: skewX(-6deg) } }

/* ---------- Layout ---------- */
.whb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; margin-top: 24px; }
.whb-main { min-width: 0; }
.whb-step:focus { outline: none; }
.whb .whb-step-title { font-size: 26px; font-weight: 700; margin: 0 0 4px; line-height: 1.2; }
.whb-step-intro { color: var(--slate); margin: 0 0 24px; }

/* ---------- Fields ---------- */
.whb-section { border: 1px solid var(--line); border-radius: var(--r); padding: 22px 22px 6px; margin: 0 0 20px; background: var(--paper); }
.whb-section > legend, .whb-section-head { font-size: 19px; font-weight: 700; padding: 0 6px; margin-left: -6px; }
.whb-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0 16px; }
.whb-f { grid-column: span 6; margin-bottom: 18px; min-width: 0; }
.whb-f.w2 { grid-column: span 2; } .whb-f.w3 { grid-column: span 3; } .whb-f.w4 { grid-column: span 4; }
.whb label, .whb .whb-label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; color: var(--ink); }
.whb .whb-req { color: var(--err); font-weight: 700; }
.whb .whb-opt { font-weight: 400; color: var(--slate); }
.whb input[type=text], .whb input[type=email], .whb input[type=tel], .whb input[type=date], .whb select, .whb textarea {
    width: 100%; font: inherit; font-size: 16px; color: var(--ink);
    background: var(--paper); border: 1.5px solid #b9bfc6; border-radius: 8px;
    padding: 11px 12px; min-height: 48px; margin: 0; box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.whb textarea { min-height: 88px; resize: vertical; line-height: 1.45; }
.whb select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: linear-gradient(45deg, transparent 50%, var(--slate) 50%), linear-gradient(135deg, var(--slate) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px; background-size: 6px 6px; background-repeat: no-repeat; }
.whb input:focus, .whb select:focus, .whb textarea:focus { outline: none; border-color: var(--maroon); box-shadow: 0 0 0 3px color-mix(in srgb, var(--maroon) 22%, transparent); }
.whb .whb-hint { color: var(--slate); font-size: 14px; margin: 6px 0 0; }
.whb .whb-error { color: var(--err); font-size: 14.5px; margin: 6px 0 0; font-weight: 700; display: flex; gap: 6px; align-items: flex-start; }
.whb .whb-error::before { content: '!'; flex: 0 0 18px; height: 18px; border-radius: 50%; background: var(--err); color: #fff; font-size: 12px; display: grid; place-items: center; margin-top: 2px; }
.whb .whb-warning { color: var(--warn); background: var(--warn-bg); border-radius: 6px; padding: 8px 10px; font-size: 14.5px; margin: 8px 0 0; }
.whb .has-error input, .whb .has-error select, .whb .has-error textarea { border-color: var(--err); background: var(--err-bg); }

/* Choice pills (gender, fitness, room) */
.whb-pills { display: flex; flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin: 0; }
.whb-choice { border: 0; padding: 0; margin: 0; min-width: 0; }
.whb-choice legend { padding: 0; }
.whb-pills label { margin: 0; font-weight: 400; font-size: 16px; position: relative; }
.whb-pills input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.whb-pills label > span { display: block; padding: 10px 16px; border: 1.5px solid #b9bfc6; border-radius: 999px; background: var(--paper); cursor: pointer; transition: all .15s ease; min-height: 44px; }
.whb-pills label > input:checked + span { background: var(--maroon); border-color: var(--maroon); color: #fff; font-weight: 700; }
.whb-pills label > input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--maroon) 30%, transparent); }
.whb-pills.has-error label > span { border-color: var(--err); }

/* Traveller cards */
.whb-traveller { border: 1px solid var(--line); border-radius: var(--r); margin: 0 0 18px; background: var(--paper); }
.whb-traveller-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.whb .whb-traveller-head h3 { font-size: 19px; margin: 0; flex: 1; line-height: 1.3; }
.whb-age { font-size: 14px; padding: 4px 10px; border-radius: 999px; background: var(--mist); color: var(--slate); white-space: nowrap; }
.whb-age.is-adult { background: #f6e9eb; color: var(--maroon); font-weight: 700; }
.whb-traveller-body { padding: 20px 20px 2px; }
.whb-remove { background: none; border: 0; color: var(--slate); font: inherit; font-size: 15px; text-decoration: underline; cursor: pointer; padding: 6px; }
.whb-remove:hover { color: var(--err); }
.whb-card-part { border-top: 1px solid var(--line); padding: 18px 20px 2px; margin: 0 -20px; }
.whb-card-part details.whb-more { margin: 0 0 18px; }
.whb .whb-part-head { font-size: 17px; font-weight: 700; margin: 0 0 14px; }
.whb-sub-head { font-size: 16px; font-weight: 700; margin: 4px 0 12px; color: var(--slate); grid-column: span 6; }

.whb-add {
    width: 100%; font: inherit; font-weight: 700; color: var(--maroon);
    background: var(--paper); border: 2px dashed color-mix(in srgb, var(--maroon) 45%, white); border-radius: var(--r);
    padding: 16px; cursor: pointer; margin-bottom: 20px; min-height: 56px;
}
.whb-add:hover { background: #fbf5f6; }
.whb-add:disabled { color: var(--slate); border-color: var(--line); cursor: not-allowed; background: var(--mist); }

details.whb-more { border: 1px solid var(--line); border-radius: var(--r); margin: 0 0 20px; background: var(--paper); }
details.whb-more summary { cursor: pointer; padding: 16px 20px; font-weight: 700; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.whb-more summary::-webkit-details-marker { display: none; }
details.whb-more summary::after { content: '+'; font-size: 22px; line-height: 1; color: var(--maroon); }
details.whb-more[open] summary::after { content: '–'; }
details.whb-more .whb-more-body { padding: 0 20px 4px; }
details.whb-more summary small { display: block; font-weight: 400; color: var(--slate); font-size: 14.5px; }

/* Review */
.whb-review dl { display: grid; grid-template-columns: 170px 1fr; gap: 6px 16px; margin: 0 0 8px; }
.whb-review dt { color: var(--slate); font-weight: 400; }
.whb-review dd { margin: 0; overflow-wrap: anywhere; white-space: pre-line; }
.whb .whb-edit { font: inherit; font-size: 15px; background: none; border: 0; color: var(--maroon); text-decoration: underline; cursor: pointer; padding: 0; float: right; }
.whb-terms-list { margin: 0 0 12px; padding-left: 20px; }
.whb-terms-list li { margin-bottom: 6px; list-style: disc; }
.whb .whb-check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; font-size: 16px; cursor: pointer; }
.whb-check input { width: 24px; height: 24px; margin: 1px 0 0; flex: 0 0 24px; accent-color: var(--maroon); }

/* Payment */
.whb-pay-amount { font-size: 18px; margin: 0 0 18px; }
.whb-pay-amount strong { font-size: 30px; display: block; line-height: 1.2; }
.whb-card-field { height: 50px; border: 1.5px solid #b9bfc6; border-radius: 8px; padding: 0 4px; background: #fff; }
/* With PayPal's card fields loaded, each frame is the input (styled in booking.js): no box of our own, no gap. */
#whb-card-wrap.is-live .whb-card-field { height: auto; min-height: 50px; border: 0; padding: 0; background: none; }
#whb-card-wrap.is-live .whb-card-field iframe { display: block; width: 100% !important; margin: 0 !important; }
#whb-card-wrap.is-live .whb-card-field > div { margin: 0 !important; }
.whb-or { display: flex; align-items: center; gap: 12px; color: var(--slate); margin: 20px 0; font-size: 15px; }
.whb-or::before, .whb-or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.whb-secure { display: flex; gap: 8px; align-items: center; color: var(--slate); font-size: 14.5px; margin: 14px 0 0; }
.whb-secure svg { flex: 0 0 18px; }
.whb-demo-note { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 10px 14px; font-size: 15px; margin-bottom: 16px; }

/* Buttons & nav */
.whb-nav { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 8px; flex-wrap: wrap; }
.whb .whb-btn {
    font: inherit; font-weight: 700; font-size: 16px; border-radius: 8px; padding: 13px 26px; min-height: 52px; line-height: 1.4;
    cursor: pointer; border: 2px solid var(--maroon); background: var(--maroon); color: #fff; transition: background .15s ease; text-transform: none;
}
.whb .whb-btn:hover { background: var(--maroon-dark); border-color: var(--maroon-dark); color: #fff; }
.whb-btn:focus-visible, .whb-add:focus-visible, .whb-edit:focus-visible, .whb-remove:focus-visible, details.whb-more summary:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; }
.whb .whb-btn.ghost { background: transparent; color: var(--maroon); }
.whb .whb-btn.ghost:hover { background: #fbf5f6; color: var(--maroon); }
.whb-btn[disabled] { opacity: .6; cursor: progress; }
.whb-btn.is-loading::after { content: ''; display: inline-block; width: 14px; height: 14px; margin-left: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: whb-spin .7s linear infinite; vertical-align: -1px; }
@keyframes whb-spin { to { transform: rotate(360deg) } }

.whb-alert { border-radius: 8px; padding: 12px 16px; margin: 0 0 20px; font-weight: 700; }
.whb-alert.err { background: var(--err-bg); color: var(--err); border: 1px solid #f2c6c2; }
.whb-alert.ok { background: #eaf5ee; color: var(--ok); border: 1px solid #bfe0cb; }

/* Summary sidebar */
.whb-summary { position: sticky; top: 24px; background: #fff; border-radius: var(--r); padding: 22px; }
.whb .whb-summary h2 { font-size: 18px; margin: 0 0 14px; }
.whb-summary dl { margin: 0; }
.whb-summary dt { font-size: 14px; color: var(--slate); font-weight: 400; }
.whb-summary dd { margin: 0 0 12px; font-weight: 700; overflow-wrap: anywhere; }
.whb-summary .whb-total { border-top: 1px solid #cdd2d7; padding-top: 14px; margin-top: 4px; }
.whb-summary .whb-total dd { font-size: 28px; color: var(--maroon); margin-bottom: 4px; line-height: 1.2; }
.whb-summary .whb-total p { margin: 0; font-size: 14px; color: var(--slate); }
.whb-help { margin-top: 18px; font-size: 14.5px; color: var(--slate); }
.whb-help a { color: var(--maroon); font-weight: 700; }

/* Confirmation */
.whb-done { text-align: center; padding: 36px 16px; max-width: 620px; margin: 0 auto; }
.whb-done .whb-flags-row { display: flex; justify-content: center; gap: 6px; margin-bottom: 20px; }
.whb-done .whb-flags-row i { width: 30px; height: 24px; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%); }
.whb .whb-done h2 { font-size: 30px; margin: 0 0 10px; }
.whb-ref { display: inline-block; font-size: 22px; font-weight: 700; letter-spacing: .03em; background: var(--mist); border-radius: 8px; padding: 8px 16px; margin: 10px 0 16px; }

/* Trap field — off-screen, not display:none (some bots skip hidden fields) */
.whb-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Mobile ---------- */
@container whb (max-width: 860px) {
    .whb-layout { grid-template-columns: 1fr; gap: 0; }
    .whb-summary { position: sticky; bottom: 0; top: auto; z-index: 50; margin: 8px -16px 0; border-radius: 14px 14px 0 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 16px rgba(31,35,40,.12); background: #fff; }
    .whb .whb-summary h2, .whb-summary dl > div:not(.whb-total), .whb-help { display: none; }
    .whb-summary .whb-total { border: 0; padding: 0; margin: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
    .whb-summary .whb-total dd { font-size: 22px; margin: 0; }
    .whb-summary .whb-total p { display: none; }
}
@container whb (max-width: 600px) {
    .whb-head, .whb-main { font-size: 16px; }
    .whb .whb-title { font-size: 28px; }
    .whb .whb-step-title { font-size: 23px; }
    .whb-f.w2, .whb-f.w3, .whb-f.w4 { grid-column: span 6; }
    .whb-section, .whb-traveller-body, .whb-card-part { padding-left: 16px; padding-right: 16px; }
    .whb-card-part { margin: 0 -16px; }
    .whb-traveller-head { padding: 14px 16px; flex-wrap: wrap; }
    .whb-flags li span { font-size: 13px; }
    .whb-flag { width: 34px; height: 28px; }
    .whb-review dl { grid-template-columns: 1fr; gap: 0; }
    .whb-review dd { margin-bottom: 8px; }
    .whb-nav .whb-btn { flex: 1 1 auto; }
}
/* The shortlist bar sits along the bottom on phones; keep the sticky summary above it. */
@media (max-width: 768px) {
    body:has(.shortlist-btn) .whb-summary { bottom: calc(44px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
    .whb *, .whb *::before, .whb *::after { animation: none !important; transition: none !important; }
}

/* PayPal's own buttons (PayPal account, and debit or credit card with PayPal's card form). */
.whb-paypal { min-height: 50px; max-width: 520px; position: relative; z-index: 0; }

/* "Pay with PayPal": opens PayPal's own checkout page */
.whb .whb-pp-btn { width: 100%; min-height: 50px; background: #ffc439; border-color: #ffc439; color: #111; font-size: 1.05rem; }
.whb .whb-pp-btn:hover, .whb .whb-pp-btn:focus-visible { background: #f2b600; border-color: #f2b600; color: #111; }

/* Date of birth: Day / Month / Year lists (booking.js dobField) */
.whb-dob { display: grid; grid-template-columns: 1fr 1.15fr 1.35fr; gap: 8px; }
.whb-dob select { min-width: 0; padding-left: 12px; padding-right: 30px; background-position: calc(100% - 16px) 21px, calc(100% - 10px) 21px; }
