/*
 * Booking flow: tour and transfer booking panels, the phone booking bar, checkout and "Request sent".
 * Ported from the Next front end (search.css, tour.css, transfer.css, checkout.css). Scoped under .amwaj so Divi's
 * content styles (paragraph padding, list bullets, heading sizes) do not leak in.
 */

/* ---- Resets inside plugin markup (Next's globals: no margins, sentence-case headings) ---- */
.amwaj-booking p, .amwaj-bookbar p, .amwaj-checkout p { margin: 0; padding: 0; max-width: 62ch; text-wrap: pretty; }
.amwaj-booking ul, .amwaj-booking ol, .amwaj-checkout ul, .amwaj-checkout ol { margin: 0; padding: 0; }
.amwaj-booking li, .amwaj-checkout li { padding: 0; }
.amwaj-checkout h1, .amwaj-checkout h2, .amwaj-checkout h3 { margin: 0; padding: 0; color: var(--head); font-weight: 600; text-wrap: balance; letter-spacing: -.02em; }
.amwaj-booking, .amwaj-checkout, .amwaj-bookbar { font: 400 16px/1.65 var(--font-sans); color: var(--text); }
.amwaj-booking *, .amwaj-booking *::before, .amwaj-booking *::after, .amwaj-checkout *, .amwaj-checkout *::before, .amwaj-checkout *::after, .amwaj-bookbar * { box-sizing: border-box; }
.amwaj-booking [hidden], .amwaj-checkout [hidden] { display: none !important; }
.amwaj-booking svg.amwaj-i, .amwaj-checkout svg.amwaj-i { display: inline-block; vertical-align: middle; }

/* ---- Quiet-luxury fields (search.css): no boxes, a hairline under each field, small labels ---- */
.amwaj .search { position: relative; color: var(--head); }
.amwaj .search-stack { display: grid; gap: 4px; }
.amwaj .sfield { position: relative; display: grid; grid-template-columns: 1fr; padding: 12px 0 10px; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: border-color .25s var(--ease-out); }
.amwaj .sfield::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--gold-700); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease-out); }
.amwaj .sfield:focus-within::after, .amwaj .sfield:has([aria-expanded="true"])::after { transform: scaleX(1); }
.amwaj .sfield:hover { border-bottom-color: var(--head); }
.amwaj .sfield > svg { display: none; }
.amwaj .sbody { display: grid; gap: 4px; min-width: 0; }
.amwaj .slabel { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: .02em; line-height: 1.2; }
.amwaj .sfield input, .amwaj .svalue { appearance: none; -webkit-appearance: none; border: 0; border-radius: 0; box-shadow: none; background: transparent; padding: 0; margin: 0; width: 100%; min-height: 28px; height: auto; color: var(--head); font: 400 17px/1.4 var(--font-sans); cursor: pointer; text-align: start; letter-spacing: -.005em; }
.amwaj .sfield input:focus, .amwaj .svalue:focus { outline: none; }
.amwaj .sfield input[data-empty] { color: var(--muted); }
.amwaj .sfield input[readonly] { cursor: default; }
.amwaj .sfield input::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }
.amwaj .svalue { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.amwaj .svalue svg { color: currentColor; opacity: .6; flex: none; transition: transform .25s var(--ease-out); }
.amwaj .svalue[aria-expanded="true"] svg { transform: rotate(180deg); }

/* Traveler popover */
.amwaj .spop { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 12px); background: var(--card); color: var(--head); border-radius: 20px; box-shadow: var(--float); padding: 4px 20px 20px; cursor: default; animation: amwaj-settle .5s var(--ease-out) both; min-width: 300px; }
@keyframes amwaj-settle { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.amwaj .prow { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.amwaj .prow b { display: block; font-weight: 500; font-size: 15px; color: var(--head); }
.amwaj .prow small { color: var(--muted); font-size: 13px; }
.amwaj .pstep { display: flex; align-items: center; gap: 14px; }
.amwaj .pstep button { width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--head); font: 400 20px/1 var(--font-sans); cursor: pointer; transition: border-color .15s; }
.amwaj .pstep button:hover:not(:disabled) { border-color: var(--head); }
.amwaj .pstep button:disabled { opacity: .3; cursor: default; }
.amwaj .pstep output { min-width: 20px; text-align: center; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--head); }
.amwaj .pdone { margin-top: 16px; width: 100%; }
.amwaj .ssubmit { height: 52px; padding: 0 28px; }
.amwaj .search-stack .ssubmit { margin-top: 20px; width: 100%; }
.amwaj .ssubmit:disabled { opacity: .5; cursor: not-allowed; }

/* ---- Booking panel (brand guide p.13), level 3 float ---- */
.amwaj .bpanel { position: sticky; top: 96px; background: var(--card); border-radius: var(--r-card); box-shadow: inset 0 0 0 1px var(--line), 0 18px 48px rgba(0, 0, 0, .08); padding: 28px 28px 24px; scroll-margin-top: 96px; }
.amwaj .bprice { margin: 0 0 8px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; color: var(--head); max-width: none; }
.amwaj .bprice small { font-size: 14px; color: var(--muted); }
.amwaj .bprice b { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.amwaj .berror { color: var(--error); font-size: 13px; margin: 6px 0 0; }
.amwaj .sfield input[aria-invalid="true"] { color: var(--error); }
.amwaj .bextras { border: 0; margin: 20px 0 0; padding: 0; display: grid; min-width: 0; }
.amwaj .bextras legend { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: .02em; padding: 0 0 4px; }
.amwaj .bextra { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; line-height: 1.5; color: var(--head); }
.amwaj .bextra label { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; width: 100%; }
.amwaj .bextra input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--gold-700); margin: 1px 0 0; flex: none; }
.amwaj .bextra small { display: block; color: var(--muted); font-size: 12px; }
.amwaj .bextra .pstep button { width: 36px; height: 36px; font-size: 18px; }
.amwaj .bsum { margin: 20px 0 0; font-size: 14px; }
.amwaj .bsum ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; color: var(--text); }
.amwaj .bsum li { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.amwaj .bsum li.note { color: var(--muted); font-size: 13px; }
.amwaj .btotal { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--head); max-width: none; font-weight: 600; }
.amwaj .btotal b { font-size: 22px; font-variant-numeric: tabular-nums; }
.amwaj .bnote { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.55; color: var(--muted); margin: 12px 0 0; max-width: none; }
.amwaj .bnote svg { color: var(--accent-text); flex: none; margin-top: 2px; }
.amwaj.bbar { display: none; }

/* ---- Transfer panel: passengers stepper and vehicle choice (transfer.css) ---- */
.amwaj .sfield.pax .sbody { grid-template-columns: 1fr auto; align-items: center; }
.amwaj .sfield.pax .slabel { grid-column: 1; }
.amwaj .sfield.pax .pstep { grid-column: 2; grid-row: 1 / 3; }
.amwaj .sfield.pax { cursor: default; }
.amwaj .vchoice { border: 0; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.amwaj .vchoice legend { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: .02em; padding: 0 0 6px; }
.amwaj .vopt { display: grid; grid-template-columns: 20px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; line-height: 1.5; transition: box-shadow .25s var(--ease-out), background-color .25s; }
.amwaj .vopt:hover { box-shadow: inset 0 0 0 1px var(--head); }
.amwaj .vopt:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--gold-700); background: var(--gold-50); }
:root[data-theme="dark"] .amwaj .vopt:has(input:checked) { background: #1f1a10; box-shadow: inset 0 0 0 1.5px var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .amwaj .vopt:has(input:checked) { background: #1f1a10; box-shadow: inset 0 0 0 1.5px var(--gold); } }
.amwaj .vopt input { width: 18px; height: 18px; accent-color: var(--gold-700); margin: 0; }
.amwaj .vopt.nofit { opacity: .45; cursor: not-allowed; }
.amwaj .vname { color: var(--head); font-size: 15px; }
.amwaj .vname small { display: block; color: var(--muted); font-size: 12px; }
.amwaj .vprice { font-weight: 600; color: var(--head); font-variant-numeric: tabular-nums; font-size: 14px; }

/* ---- Phone booking bar and static panel (brand guide p.13 and p.17). 980px matches Divi's tablet breakpoint ---- */
@media (max-width: 980px) {
  .amwaj .bpanel { position: static; }
  .amwaj.bbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9980; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--card); box-shadow: 0 -8px 30px rgba(0, 0, 0, .12); transition: transform .5s var(--ease-out); }
  .amwaj.bbar .bprice { margin: 0; }
  .amwaj.bbar .bprice b { font-size: 20px; }
  .amwaj.bbar.away { transform: translateY(110%); }
  /* The booking bar is the main action on these pages; the WhatsApp bubble would cover the panel. */
  body:has(.amwaj-bookbar) .amwaj-wa { display: none; }
  body:has(.amwaj-bookbar) { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
}

/* ---- Checkout (steps 2 and 3): focused layout like GetYourGuide; Red Sea style fields ---- */
/* Focus mode: the Next checkout had no site header, footer or WhatsApp bubble. */
body:has(.amwaj-checkout.is-focus) :is(.et-l--header, .et-l--footer, #main-header, #top-header, #main-footer, .amwaj-wa) { display: none !important; }
.amwaj-checkout.is-focus { min-height: 100vh; min-height: 100svh; }
body:has(.amwaj-checkout.is-focus) :is(#page-container, #main-content) { padding-top: 0 !important; margin-top: 0 !important; }

.amwaj-checkout .wrap { max-width: 1280px; margin: 0 auto; padding-inline: var(--gutter); position: relative; z-index: 2; }
.amwaj-checkout .co-top { border-bottom: 1px solid var(--line); background: var(--bg); position: relative; z-index: 3; }
.amwaj-checkout .co-top .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; height: 72px; }
.amwaj-checkout .co-logo { font-weight: 600; font-size: 20px; letter-spacing: .08em; color: var(--head); text-decoration: none; }
.amwaj-checkout .co-logo span { color: var(--accent-text); }
.amwaj-checkout .co-steps { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--muted); }
.amwaj-checkout .co-steps li[aria-current="step"] { color: var(--head); font-weight: 500; }
.amwaj-checkout .co-steps li.done { color: var(--muted); }

.amwaj-checkout .co-back { display: inline-block; margin-top: 36px; font-size: 14px; color: var(--muted); text-decoration: none; }
.amwaj-checkout .co-back:hover { color: var(--head); }
.amwaj-checkout .co-title { font-size: clamp(32px, 4vw, 44px); letter-spacing: -.03em; line-height: 1.1; margin: 10px 0 8px; }
.amwaj-checkout .co-lead { color: var(--muted); font-size: 16px; }

.amwaj-checkout .co-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(28px, 4vw, 48px); align-items: start; margin-top: 32px; padding-bottom: var(--section); }
.amwaj-checkout .co-form { display: grid; gap: 18px; }
.amwaj-checkout .co-form h2 { font-size: 20px; letter-spacing: -.01em; margin-top: 12px; }
.amwaj-checkout .co-form hr { border: 0; border-top: 1px solid var(--line); margin: 8px 0; height: 0; background: none; }
.amwaj-checkout .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.amwaj-checkout .co-guest { display: flex; gap: 14px; align-items: center; padding: 18px 20px; border-radius: 18px; background: var(--surface); line-height: 1.5; }
.amwaj-checkout .co-guest .tick { width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: #000; display: grid; place-items: center; font-size: 14px; flex: none; }
.amwaj-checkout .co-guest b { display: block; font-weight: 500; font-size: 14px; color: var(--head); }
.amwaj-checkout .co-guest small { color: var(--muted); font-size: 12px; }

.amwaj-checkout .co-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.amwaj-checkout .co-field { display: grid; gap: 8px; align-content: start; font-size: 14px; }
.amwaj-checkout .co-field > span { font-weight: 500; color: var(--head); }
.amwaj-checkout .co-field em { font-style: normal; color: var(--muted); font-weight: 400; }
.amwaj-checkout .co-field input, .amwaj-checkout .co-field textarea { width: 100%; margin: 0; border: 1px solid var(--line-2); border-radius: var(--r-input); background: var(--bg); color: var(--head); font: 400 15px/1.5 var(--font-sans); padding: 13px 14px; box-shadow: none; transition: border-color .15s, box-shadow .15s; }
.amwaj-checkout .co-field input { height: 50px; }
.amwaj-checkout .co-field textarea { resize: vertical; min-height: 96px; }
.amwaj-checkout .co-field input:focus, .amwaj-checkout .co-field textarea:focus { outline: none; border-color: var(--head); box-shadow: 0 0 0 4px rgba(229, 190, 119, .35); }
.amwaj-checkout .co-field input[aria-invalid="true"] { border-color: var(--error); }
.amwaj-checkout .co-field small { color: var(--muted); font-size: 12px; line-height: 1.5; }

.amwaj-checkout .co-review { background: var(--surface); border-radius: 18px; padding: 18px 20px; display: grid; gap: 8px; font-size: 14px; }
.amwaj-checkout .co-review p { max-width: none; color: var(--head); }
.amwaj-checkout .co-review span { color: var(--muted); }
.amwaj-checkout .co-hold { border-left: 3px solid var(--gold-700); background: var(--gold-50); color: var(--text); border-radius: 0 14px 14px 0; padding: 14px 16px; font-size: 13px; line-height: 1.6; max-width: none; }
:root[data-theme="dark"] .amwaj-checkout .co-hold { background: #1f1a10; border-color: var(--gold); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .amwaj-checkout .co-hold { background: #1f1a10; border-color: var(--gold); } }
.amwaj-checkout .co-error { color: var(--error); font-size: 14px; font-weight: 500; }
.amwaj-checkout .co-send { height: 56px; width: 100%; }
.amwaj-checkout .co-send:disabled { opacity: .6; cursor: wait; }
.amwaj-checkout .co-disclaimer { font-size: 12px; color: var(--muted); max-width: none; }

.amwaj-checkout .co-card { position: sticky; top: 24px; background: var(--card); border-radius: var(--r-card); box-shadow: inset 0 0 0 1px var(--line), 0 18px 48px rgba(0, 0, 0, .08); padding: 22px; display: grid; gap: 14px; }
.amwaj-checkout .co-photo { position: relative; aspect-ratio: 16/9; border-radius: var(--r-image); overflow: hidden; background: var(--surface); }
.amwaj-checkout .co-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.amwaj-checkout .co-card .kicker { font-size: 12px; letter-spacing: .12em; color: var(--accent-text); margin: 4px 0 0; }
.amwaj-checkout .co-card h2 { font-size: 19px; line-height: 1.3; }
.amwaj-checkout .co-facts, .amwaj-checkout .co-lines { margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: grid; gap: 10px; font-size: 13px; list-style: none; }
.amwaj-checkout .co-facts div, .amwaj-checkout .co-lines li { display: flex; justify-content: space-between; gap: 12px; }
.amwaj-checkout .co-facts dt, .amwaj-checkout .co-lines li span:first-child { color: var(--muted); font-weight: 400; }
.amwaj-checkout .co-facts dd { margin: 0; color: var(--head); text-align: end; }
.amwaj-checkout .co-lines li span:last-child { color: var(--head); font-variant-numeric: tabular-nums; text-align: end; }
.amwaj-checkout .co-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 14px; border-top: 1px solid var(--line); max-width: none; font-weight: 600; color: var(--head); }
.amwaj-checkout .co-total b { font-size: 26px; font-weight: 500; font-variant-numeric: tabular-nums; }
.amwaj-checkout .co-total b.req { font-size: 16px; }
.amwaj-checkout .co-note { font-size: 12px; color: var(--muted); max-width: none; }
.amwaj-checkout .co-after { background: #111; color: #d9d9d6; border-radius: 18px; padding: 18px 20px; font-size: 13px; }
.amwaj-checkout .co-after b { color: #fff; font-weight: 500; font-size: 14px; }
.amwaj-checkout .co-after ol { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 6px; line-height: 1.5; list-style: decimal; }

.amwaj-checkout .co-missing { padding: 96px var(--gutter); display: grid; gap: 20px; justify-items: start; }
.amwaj-checkout .co-sent { padding-top: clamp(48px, 8vw, 96px); padding-bottom: var(--section); display: grid; gap: 16px; justify-items: start; max-width: 640px; }
.amwaj-checkout .co-sent-mark { width: 56px; height: 56px; border-radius: 50%; background: var(--gold); color: #000; display: grid; place-items: center; }
.amwaj-checkout .co-sent-facts { display: grid; grid-template-columns: repeat(2, auto); gap: 8px 40px; margin: 8px 0; padding: 18px 22px; background: var(--surface); border-radius: 18px; }
.amwaj-checkout .co-sent-facts dt { font-size: 12px; color: var(--muted); font-weight: 400; }
.amwaj-checkout .co-sent-facts dd { margin: 0; font-size: 17px; font-weight: 600; color: var(--head); font-variant-numeric: tabular-nums; }
.amwaj-checkout .co-sent-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

@media (max-width: 900px) {
  .amwaj-checkout .co-layout { grid-template-columns: 1fr; }
  .amwaj-checkout .co-card { position: static; order: -1; }
  .amwaj-checkout .co-photo { display: none; }
  .amwaj-checkout .co-grid { grid-template-columns: 1fr; }
  .amwaj-checkout .co-steps li:not([aria-current]) { display: none; }
  .amwaj-checkout .co-sent-facts { grid-template-columns: 1fr; }
}

/*
 * Compact booking panel: it never grows taller than the screen. Extras and the price breakdown fold away
 * ("Add to your day", "Price details"), the middle scrolls inside the panel if it must, and the total with the
 * Book button stays pinned at the bottom of the panel, always in reach.
 */
.amwaj .bpanel { padding: 22px 24px 0; max-height: calc(100vh - 120px); max-height: calc(100svh - 120px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.amwaj .bpanel .bprice { margin-bottom: 4px; }
.amwaj .bpanel .sfield { padding: 8px 0 8px; }
.amwaj .bpanel .sfield input, .amwaj .bpanel .svalue { font-size: 16px; min-height: 26px; }
.amwaj .bmore { margin: 14px 0 0; border-bottom: 1px solid var(--line); }
.amwaj .bmore > summary { list-style: none; display: flex; align-items: center; gap: 6px; padding: 10px 0; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--head); }
.amwaj .bmore > summary::-webkit-details-marker { display: none; }
.amwaj .bmore > summary small { color: var(--accent-text); font-size: 13px; font-weight: 500; }
.amwaj .bmore > summary svg { margin-left: auto; opacity: .6; transition: transform .25s var(--ease-out); }
.amwaj .bmore[open] > summary svg { transform: rotate(180deg); }
.amwaj .bextras-wrap .bextras { margin: 0 0 6px; }
.amwaj .bextra { padding: 8px 0; }
.amwaj .bdetails { margin: 0; border-bottom: 0; }
.amwaj .bdetails > summary { padding: 0 0 8px; font-weight: 400; color: var(--muted); font-size: 13px; }
.amwaj .bdetails ul { padding-bottom: 6px !important; }
.amwaj .bsum { margin: 0; }
.amwaj .btotal { margin-top: 0; padding-top: 10px; }
/* The pinned footer: total, button and the reassurance line. */
.amwaj .bfoot { position: sticky; bottom: 0; z-index: 2; margin: 14px -24px 0; padding: 12px 24px 18px; background: var(--card); box-shadow: 0 -10px 20px -14px rgba(0, 0, 0, .25); border-radius: 0 0 var(--r-card) var(--r-card); }
.amwaj .bfoot .ssubmit { margin-top: 12px; width: 100%; }
.amwaj .bfoot .bnote { margin-top: 10px; font-size: 12px; }
@media (max-width: 980px) { .amwaj .bpanel { max-height: none; overflow: visible; } }
/* Open "Price details" scrolls inside itself, so the pinned footer never covers the date and travelers. */
.amwaj .bfoot .bdetails ul { max-height: 132px; overflow-y: auto; overscroll-behavior: contain; padding-right: 4px !important; scrollbar-width: thin; }

/* Cancellation policy links (includes/cancellation.php) */
.bnote .bnote-link { color: inherit; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.co-privacy .amwaj-terms-note { display: block; margin-top: 6px; }
.co-privacy .amwaj-terms-note a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
