/*
 * Quiet-luxury search: no boxes, a single hairline under each field, small labels, larger values.
 * Layouts "row" and "stack"; "glass" for use over photography. Labels in sentence case (brand guide p.4).
 */
.amwaj.search { position: relative; color: var(--head); }
.amwaj.search-row { display: grid; grid-template-columns: 1.2fr 1fr 1.1fr auto; gap: 0 32px; align-items: end; }
.amwaj.search-stack { display: grid; gap: 4px; }
.amwaj.search .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.search .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.search .sfield:focus-within::after, .amwaj.search .sfield:has([aria-expanded="true"])::after { transform: scaleX(1); }
.amwaj.search .sfield:hover { border-bottom-color: var(--head); }
.amwaj.search .sfield > svg { display: none; }
.amwaj.search .sbody { display: grid; gap: 4px; min-width: 0; }
.amwaj.search .slabel { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: .02em; line-height: 1.2; }
.amwaj.search .sfield select, .amwaj.search .sfield input, .amwaj.search .svalue { appearance: none; -webkit-appearance: none; border: 0; border-radius: 0; box-shadow: none; background-color: 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.search .sfield select { padding-inline-end: 24px; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-size: 5px 5px; background-position: calc(100% - 9px) 55%, calc(100% - 4px) 55%; background-repeat: no-repeat; }
.amwaj.search .sfield select option { color: #000; background: #fff; }
.amwaj.search .sfield select:focus, .amwaj.search .sfield input:focus, .amwaj.search .svalue:focus { outline: none; }
.amwaj.search .sfield input[data-empty] { color: var(--muted); }
.amwaj.search .sfield input::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }
.amwaj.search .svalue { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.amwaj.search .svalue svg { opacity: .6; flex: none; transition: transform .25s var(--ease-out); }
.amwaj.search .svalue[aria-expanded="true"] svg { transform: rotate(180deg); }
.amwaj.search .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.search .prow { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.amwaj.search .prow b { display: block; font-weight: 500; font-size: 15px; color: var(--head); }
.amwaj.search .prow small { color: var(--muted); font-size: 13px; }
.amwaj.search .pstep { display: flex; align-items: center; gap: 14px; }
.amwaj.search .pstep button { width: 44px; height: 44px; padding: 0; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--head); font-size: 20px; line-height: 1; cursor: pointer; transition: border-color .15s; }
.amwaj.search .pstep button:hover:not(:disabled) { border-color: var(--head); }
.amwaj.search .pstep button:disabled { opacity: .3; cursor: default; }
.amwaj.search .pstep output { min-width: 20px; text-align: center; font-weight: 500; font-variant-numeric: tabular-nums; }
.amwaj.search .pdone { margin-top: 16px; width: 100%; }
.amwaj.search .ssubmit { height: 52px; padding: 0 28px; }
.amwaj.search-row .ssubmit { align-self: end; margin-bottom: 4px; }
.amwaj.search-stack .ssubmit { margin-top: 20px; width: 100%; }
/* Glass: over photography (brand guide p.9, level 2). */
.amwaj.search-glass { padding: 20px 28px 22px; border-radius: 28px; background: rgba(0, 0, 0, .32); backdrop-filter: blur(32px) saturate(140%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); color: #fff; }
.amwaj.search-glass .sfield { border-bottom-color: rgba(255, 255, 255, .38); }
.amwaj.search-glass .sfield:hover { border-bottom-color: #fff; }
.amwaj.search-glass .sfield::after { background: var(--gold); }
.amwaj.search-glass .slabel { color: rgba(255, 255, 255, .72); }
.amwaj.search-glass select, .amwaj.search-glass input, .amwaj.search-glass .svalue { color: #fff !important; }
.amwaj.search-glass input[data-empty] { color: rgba(255, 255, 255, .72) !important; }
.amwaj.search-glass input::-webkit-calendar-picker-indicator { filter: invert(1); opacity: .8; }
@media (max-width: 900px) {
  .amwaj.search-row { grid-template-columns: 1fr; gap: 4px; }
  .amwaj.search-row .ssubmit { margin: 20px 0 0; width: 100%; }
  .amwaj.search-glass { padding: 16px 20px 20px; border-radius: 24px; }
}

/*
 * Boxes (homepage): Where, When and Travelers as three equal glass boxes with the same look, blur 32px like
 * every glass surface. Over the photo (glass) the boxes are dark glass; on light grounds they are frosted white.
 */
.amwaj.search-boxes.search-row { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: stretch; }
.amwaj.search-boxes.search-stack { grid-template-columns: 1fr; gap: 12px; }
.amwaj.search-boxes .sfield { min-height: 72px; padding: 14px 18px 12px; border: 0; border-radius: 18px; align-content: center; background: rgba(255, 255, 255, .55); backdrop-filter: blur(32px) saturate(140%); box-shadow: inset 0 0 0 1px var(--line-2); transition: box-shadow .25s var(--ease-out), background-color .25s var(--ease-out); }
.amwaj.search-boxes .sfield:hover { box-shadow: inset 0 0 0 1px var(--head); }
.amwaj.search-boxes .sfield:focus-within, .amwaj.search-boxes .sfield:has([aria-expanded="true"]) { box-shadow: inset 0 0 0 1.5px var(--gold-700); }
.amwaj.search-boxes .sfield::after { display: none; }
:root[data-theme="dark"] .amwaj.search-boxes .sfield { background: rgba(255, 255, 255, .06); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .amwaj.search-boxes .sfield { background: rgba(255, 255, 255, .06); } }
.amwaj.search-boxes .ssubmit { height: auto; min-height: 56px; margin: 0; align-self: stretch; border-radius: 18px; }
.amwaj.search-boxes.search-stack .ssubmit { margin-top: 8px; }
/* Over the photo: the bar itself stays clear, each box is its own dark glass. */
.amwaj.search-boxes.search-glass { padding: 0; background: none; backdrop-filter: none; box-shadow: none; }
.amwaj.search-boxes.search-glass .sfield { background: rgba(0, 0, 0, .32); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.amwaj.search-boxes.search-glass .sfield:hover { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6); }
.amwaj.search-boxes.search-glass .sfield:focus-within, .amwaj.search-boxes.search-glass .sfield:has([aria-expanded="true"]) { box-shadow: inset 0 0 0 1.5px var(--gold); }
.amwaj.search-boxes .spop { top: calc(100% + 8px); }
@media (max-width: 900px) {
  .amwaj.search-boxes.search-row { grid-template-columns: 1fr; }
}

/* ---- Where list and When calendar (same popover as Travelers) ---- */
.amwaj.search .svalue [data-empty] { color: var(--muted); }
.amwaj.search-glass .svalue [data-empty] { color: rgba(255, 255, 255, .72); }
.amwaj.search .slist { padding: 8px; max-height: 340px; overflow-y: auto; }
.amwaj.search .sopt { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 0; border-radius: 12px; background: transparent; color: var(--head); font: 400 15px var(--font-sans); text-align: start; cursor: pointer; transition: background-color .15s; }
.amwaj.search .sopt:hover, .amwaj.search .sopt:focus-visible { background: var(--surface); outline: none; }
.amwaj.search .sopt svg { color: var(--accent-text); opacity: 0; }
.amwaj.search .sopt[aria-selected="true"] { font-weight: 600; }
.amwaj.search .sopt[aria-selected="true"] svg { opacity: 1; }
.amwaj.search .scal { padding: 16px 16px 14px; min-width: 320px; }
.amwaj.search .calhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.amwaj.search .calhead b { font-weight: 600; font-size: 15px; color: var(--head); text-transform: capitalize; }
.amwaj.search .calnav { width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; color: var(--head); display: grid; place-items: center; cursor: pointer; }
.amwaj.search .calnav:hover:not(:disabled) { border-color: var(--head); }
.amwaj.search .calnav:disabled { opacity: .3; cursor: default; }
.amwaj.search .calgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.amwaj.search .calwd { text-align: center; font-size: 11px; font-weight: 500; color: var(--muted); padding: 4px 0 6px; }
.amwaj.search .calday { aspect-ratio: 1; min-width: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--head); font: 400 14px var(--font-sans); font-variant-numeric: tabular-nums; cursor: pointer; transition: background-color .15s; }
.amwaj.search .calday:hover:not(:disabled) { background: var(--surface); }
.amwaj.search .calday.today { box-shadow: inset 0 0 0 1px var(--line-2); }
.amwaj.search .calday[aria-pressed="true"] { background: var(--gold); color: #000; font-weight: 600; }
.amwaj.search .calday:disabled { color: var(--muted); opacity: .35; cursor: default; }
.amwaj.search .calfoot { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.amwaj.search .calfoot .btn { flex: 1; }

/* All three popovers are glass: frosted card with the brand 32px blur. */
.amwaj.search .spop { background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(32px) saturate(140%); box-shadow: var(--float), inset 0 0 0 1px var(--line); }
/* The open box sits above its neighbours so its popover is never covered. */
.amwaj.search .sfield.open { z-index: 40; }

/* Stronger glass for the homepage search: boxes and all three dropdowns (asked for more blur). */
.amwaj.search-boxes .sfield { backdrop-filter: blur(48px) saturate(160%); }
.amwaj.search .spop { background: color-mix(in srgb, var(--card) 78%, transparent); backdrop-filter: blur(64px) saturate(170%); }
/*
 * The box glass lives on a ::before layer, not on the box itself: an element with backdrop-filter becomes a
 * "backdrop root", and the dropdown inside it could then only blur the box, not the page behind it.
 */
.amwaj.search-boxes .sfield { position: relative; z-index: 0; backdrop-filter: none; background: none !important; }
.amwaj.search-boxes .sfield.open { z-index: 40; }
.amwaj.search-boxes .sfield::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: rgba(255, 255, 255, .55); backdrop-filter: blur(48px) saturate(160%); pointer-events: none; }
:root[data-theme="dark"] .amwaj.search-boxes .sfield::before { background: rgba(255, 255, 255, .06); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .amwaj.search-boxes .sfield::before { background: rgba(255, 255, 255, .06); } }
.amwaj.search-boxes.search-glass .sfield::before { background: rgba(0, 0, 0, .32); }
/* The glass layer sits over the box's own outline, so it carries the outline (and its hover/focus states). */
.amwaj.search-boxes .sfield::before { box-shadow: inherit; transition: inherit; }

/* Glass tuning (see-through enough to feel the glass): lighter tint, softer blur. */
.amwaj.search .spop { background: color-mix(in srgb, var(--card) 55%, transparent); backdrop-filter: blur(28px) saturate(160%); }
.amwaj.search-boxes .sfield::before { background: rgba(255, 255, 255, .38); backdrop-filter: blur(24px) saturate(150%); }
:root[data-theme="dark"] .amwaj.search-boxes .sfield::before { background: rgba(255, 255, 255, .05); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .amwaj.search-boxes .sfield::before { background: rgba(255, 255, 255, .05); } }
.amwaj.search-boxes.search-glass .sfield::before { background: rgba(0, 0, 0, .18); }

/*
 * Apple-style glass (macOS / iOS materials): a thin translucent tint, strong saturation of what is behind,
 * a medium blur, a hairline bright edge and a soft highlight along the top.
 */
.amwaj.search .spop {
  background: rgba(250, 250, 252, .62);
  backdrop-filter: blur(24px) saturate(180%);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .22), 0 2px 8px rgba(0, 0, 0, .08), inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 0 0 .5px rgba(255, 255, 255, .45);
}
:root[data-theme="dark"] .amwaj.search .spop { background: rgba(30, 30, 32, .55); box-shadow: 0 24px 60px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 0 0 .5px rgba(255, 255, 255, .14); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .amwaj.search .spop { background: rgba(30, 30, 32, .55); box-shadow: 0 24px 60px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 0 0 .5px rgba(255, 255, 255, .14); } }
.amwaj.search .sopt:hover, .amwaj.search .sopt:focus-visible, .amwaj.search .calday:hover:not(:disabled) { background: rgba(127, 127, 127, .16); }
.amwaj.search .prow, .amwaj.search .calfoot { border-color: rgba(127, 127, 127, .22); }

/* Boxes: the same material. On light grounds a bright frosted tint; over the photo and in dark mode a clear one. */
.amwaj.search-boxes .sfield::before {
  background: rgba(255, 255, 255, .5);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75), inset 0 0 0 .5px rgba(0, 0, 0, .08), 0 8px 24px rgba(0, 0, 0, .06);
}
:root[data-theme="dark"] .amwaj.search-boxes .sfield::before { background: rgba(255, 255, 255, .07); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 0 0 .5px rgba(255, 255, 255, .12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .amwaj.search-boxes .sfield::before { background: rgba(255, 255, 255, .07); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), inset 0 0 0 .5px rgba(255, 255, 255, .12); } }
.amwaj.search-boxes.search-glass .sfield::before { background: rgba(255, 255, 255, .14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 0 0 .5px rgba(255, 255, 255, .3), 0 8px 30px rgba(0, 0, 0, .12); }
/* Hover and open states: a slightly brighter pane and the gold hairline, drawn on the box itself. */
.amwaj.search-boxes .sfield { box-shadow: none !important; }
.amwaj.search-boxes .sfield::after { display: block; content: ""; position: absolute; inset: 0; border-radius: inherit; transform: none; height: auto; background: none; pointer-events: none; box-shadow: inset 0 0 0 1px transparent; transition: box-shadow .25s var(--ease-out); }
.amwaj.search-boxes .sfield:hover::after { box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .35); }
.amwaj.search-boxes .sfield:focus-within::after, .amwaj.search-boxes .sfield.open::after { box-shadow: inset 0 0 0 1.5px var(--gold); }
.amwaj.search-boxes.search-glass .sfield:hover::before { background: rgba(255, 255, 255, .2); }
/* Softer blur on the three boxes (Where, When, Travelers); the dropdowns keep theirs. */
.amwaj.search-boxes .sfield::before { backdrop-filter: blur(8px) saturate(170%); }
/* The hover look is now the resting look of the three boxes (brighter pane + hairline outline). */
.amwaj.search-boxes.search-glass .sfield::before { background: rgba(255, 255, 255, .2); }
.amwaj.search-boxes .sfield::after { box-shadow: inset 0 0 0 1px rgba(127, 127, 127, .35); }
.amwaj.search-boxes.search-glass .sfield::after { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35); }
.amwaj.search-boxes .sfield:focus-within::after, .amwaj.search-boxes .sfield.open::after { box-shadow: inset 0 0 0 1.5px var(--gold); }
/* Plain glass boxes: tint + blur only — no outline, edge highlight, shadow or hover/open effects. */
.amwaj.search-boxes .sfield::before,
.amwaj.search-boxes .sfield:hover::before { box-shadow: none !important; }
.amwaj.search-boxes .sfield::after,
.amwaj.search-boxes .sfield:hover::after,
.amwaj.search-boxes .sfield:focus-within::after,
.amwaj.search-boxes .sfield.open::after { display: none; }
.amwaj.search-boxes.search-glass .sfield:hover::before { background: rgba(255, 255, 255, .2); }
/*
 * Final box glass: neutral (no colour boost, so the sand isn't pushed to orange), the lighter pane that used to
 * appear on hover is now the resting look, and hovering changes nothing.
 */
.amwaj.search-boxes .sfield::before,
.amwaj.search-boxes .sfield:hover::before { backdrop-filter: blur(8px); }
.amwaj.search-boxes.search-glass .sfield::before,
.amwaj.search-boxes.search-glass .sfield:hover::before { background: rgba(255, 255, 255, .22); }
/* Over the photo the boxes use the same glass in light and dark mode (the dark-mode tint rule must not win). */
.amwaj.search-boxes.search-glass .sfield::before { background: rgba(255, 255, 255, .22) !important; backdrop-filter: blur(8px) !important; }

/* Touch screens: a taller invisible tap area on the search fields (no visual change) */
@media (pointer: coarse) {
  .amwaj.search .svalue { position: relative; }
  .amwaj.search .svalue::after { content: ""; position: absolute; inset: -8px -4px; }
}
