/* ==========================================================================
   UI: form fields, takeaway basket (FAB + drawer), mobile action bar, toasts
   ========================================================================== */
.fgrid { display: grid; gap: 16px 14px; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .field > legend { font: 600 .78rem/1.3 var(--ff-b); letter-spacing: .14em; text-transform: uppercase; color: var(--brass-hi); }
.field > legend { margin-bottom: 7px; }
.req { margin-left: 3px; color: var(--amber); }
.field input, .field select, .field textarea, .g-custom input {
  width: 100%; min-height: 50px; padding: 12px 15px; border-radius: 13px;
  border: 1px solid rgba(239, 224, 198, .22); background: rgba(5, 4, 3, .58); color: var(--cream-2); font-size: 1rem;
  transition: border-color .25s, box-shadow .25s; -webkit-appearance: none; appearance: none;
}
.field textarea { min-height: 92px; line-height: 1.5; resize: vertical; }
.field select {
  padding-right: 42px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f4a922' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
}
.field select:disabled { opacity: .55; cursor: not-allowed; }
.field select option { background: #17110c; color: var(--cream-2); }
.field input[type="date"] { color-scheme: dark; }
/* italic examples, so a placeholder never reads like a field already filled in */
.field input::placeholder, .field textarea::placeholder { color: rgba(239, 224, 198, .58); font-style: italic; }
.field input:focus, .field select:focus, .field textarea:focus, .g-custom input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 4px rgba(244, 169, 34, .22); }
.field [aria-invalid="true"], .g-custom input[aria-invalid="true"] { border-color: #ff8f7e; box-shadow: 0 0 0 3px rgba(255, 143, 126, .16); }
.field__err { font-size: .86rem; font-weight: 700; line-height: 1.4; color: var(--err); }
.field__err:empty { display: none; }
.field__err::before { content: "! "; }
.seg__opts { display: flex; flex-wrap: wrap; gap: 8px; }
.seg__opt { position: relative; flex: 1 1 auto; display: flex; }
.seg__opt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.seg__opt span {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 16px; border-radius: 13px;
  border: 1px solid rgba(239, 224, 198, .22); background: rgba(5, 4, 3, .42); font-weight: 700; text-align: center; color: rgba(239, 224, 198, .86);
  transition: border-color .25s, background-color .25s, color .25s, box-shadow .25s;
}
.seg__opt:hover span { border-color: var(--brass); }
.seg__opt input:checked + span { color: var(--cream-2); border-color: var(--amber); background: rgba(244, 169, 34, .14); box-shadow: inset 0 0 0 1px var(--amber), 0 0 20px -6px rgba(244, 169, 34, .8); }
.seg__opt input:focus-visible + span { outline: 3px solid var(--amber); outline-offset: 3px; }
.form__hint { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0; font-size: .88rem; color: var(--muted); }
.form__hint .ic { width: 22px; height: 22px; color: #5fd68a; }
@media (min-width: 560px) {
  .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field--full { grid-column: 1 / -1; }
}

/* ---------- basket button: floating pill on wide screens ---------- */
.fab {
  position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: 16px; z-index: 61;
  display: inline-flex; align-items: center; gap: 14px; min-height: 58px; padding: 0 9px 0 20px; border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #f7df9f, #d9b261 52%, #b38a3c); color: var(--ink); font-weight: 800; font-size: .95rem;
  box-shadow: 0 18px 40px -12px rgba(0, 0, 0, .95), 0 0 34px -6px rgba(244, 169, 34, .75), inset 0 1px 0 rgba(255, 255, 255, .6);
  transition: transform .4s var(--ease), opacity .3s, visibility 0s;
}
.fab:hover { transform: translateY(-3px); }
/* wide screens: steps aside while it would sit on the hero's departures board (basket.js) */
@media (min-width: 860px) {
  .fab.is-tucked { opacity: 0; visibility: hidden; transform: translate3d(0, 28px, 0); transition: transform .4s var(--ease), opacity .3s, visibility 0s .4s; }
}
.fab__ic { position: relative; display: grid; place-items: center; }
.fab .ic { width: 26px; height: 26px; }
.fab__count {
  position: absolute; top: -9px; right: -12px; display: grid; place-items: center; min-width: 21px; height: 21px; padding: 0 5px; border-radius: 11px;
  background: var(--ink); color: var(--amber); font-size: .75rem; line-height: 1; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px #e6c47a;
}
.fab__sum { display: grid; place-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; background: var(--ink); color: var(--brass-hi); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fab.is-new { animation: fabIn .7s var(--ease); }
.fab.is-bump { animation: fabBump .6s var(--ease); }
@keyframes fabIn { from { opacity: 0; transform: translate3d(0, 120%, 0) scale(.6); } }
@keyframes fabBump { 0% { transform: scale(1); } 30% { transform: scale(1.14) rotate(-5deg); } 62% { transform: scale(.95) rotate(2deg); } 100% { transform: scale(1); } }
.has-fab body { padding-bottom: 92px; }
/* a control reached with the keyboard is scrolled clear of the pill (or of the phones' action bar) */
html { scroll-padding-bottom: calc(var(--mbar) + 8px); }
@media (min-width: 860px) { html.has-fab { scroll-padding-bottom: 100px; } }

/* phones & tablets: docked as a 5th cell of the action bar, so it never sits on the "+" buttons */
@media (max-width: 859.98px) {
  :root { --fabw: max(64px, 20%); }
  .fab {
    right: 0; bottom: 0; width: var(--fabw); height: var(--mbar); min-height: 0;
    flex-direction: column; justify-content: center; gap: 5px; padding: 0 2px env(safe-area-inset-bottom, 0px); border-radius: 0;
    background: linear-gradient(180deg, #22180e, #0d0a07); color: var(--cream-2); font: 800 .75rem/1.1 var(--ff-s);
    border-top: 1px solid rgba(244, 169, 34, .8); border-left: 1px solid rgba(200, 164, 90, .32);
    box-shadow: 0 -12px 30px rgba(0, 0, 0, .6), inset 0 16px 24px -18px rgba(244, 169, 34, .6);
  }
  .fab:hover { transform: none; }
  .fab .ic { width: 22px; height: 22px; color: var(--amber); }
  .fab__count { top: -7px; right: -13px; min-width: 19px; height: 19px; font-size: .75rem; background: var(--amber); color: var(--ink); box-shadow: 0 0 10px rgba(244, 169, 34, .7); }
  .fab__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .fab__sum { min-height: 0; padding: 0; background: none; color: var(--cream-2); }
  .fab.is-new { animation: fabDock .55s var(--ease); }
  .fab.is-bump { animation: none; }
  .fab.is-bump .fab__ic { animation: fabBump .6s var(--ease); }
  .has-fab .mbar { right: var(--fabw); }
  .has-fab body { padding-bottom: var(--mbar); }
}
@keyframes fabDock { from { transform: translate3d(0, 100%, 0); } }
.fly { position: fixed; z-index: 130; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--amber); color: var(--ink); box-shadow: 0 0 20px var(--amber), 0 0 40px rgba(244, 169, 34, .6); pointer-events: none; }
.fly .ic { width: 18px; height: 18px; stroke-width: 2; }

/* ---------- basket drawer (dialog) ---------- */
.drawer { position: fixed; inset: 0; z-index: 110; display: flex; justify-content: flex-end; }
.drawer__scrim { position: absolute; inset: 0; background: rgba(3, 4, 3, .68); opacity: 0; transition: opacity .38s var(--ease); }
.drawer__panel {
  position: relative; display: flex; flex-direction: column; width: min(100%, 480px); height: 100%;
  background: radial-gradient(90% 40% at 100% 0%, rgba(244, 169, 34, .12), transparent 70%), linear-gradient(180deg, #16110c, #0b0907);
  border-left: 1px solid rgba(200, 164, 90, .32); box-shadow: -30px 0 80px rgba(0, 0, 0, .7);
  transform: translate3d(100%, 0, 0); transition: transform .5s var(--ease);
}
.drawer.is-open .drawer__scrim { opacity: 1; }
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 14px 22px; border-bottom: 1px solid var(--line); }
.drawer__title { display: flex; align-items: center; gap: 10px; font-size: 1.3rem; font-style: italic; color: var(--cream-2); }
.drawer__title .ic { color: var(--amber); }
.drawer__body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 18px 22px calc(26px + env(safe-area-inset-bottom, 0px)); }
/* the total and the send button always in view, under the scrolling lines and form */
.drawer__foot {
  flex: none; padding: 12px 22px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(200, 164, 90, .32); background: linear-gradient(180deg, #130f0b, #0b0907);
  box-shadow: 0 -18px 30px -20px rgba(0, 0, 0, .95);
}
.drawer__body:has(~ .drawer__foot:not([hidden])) { padding-bottom: 18px; }
@media (max-width: 599.98px) {
  .drawer { align-items: flex-end; }
  .drawer__panel { width: 100%; height: auto; max-height: 92vh; max-height: 92dvh; border-left: 0; border-top: 1px solid rgba(200, 164, 90, .38); border-radius: 22px 22px 0 0; transform: translate3d(0, 100%, 0); }
  /* grab handle: dragging the head down closes the sheet (basket.js) */
  .drawer__head { position: relative; padding-top: 20px; touch-action: none; cursor: grab; }
  .drawer__head::before { content: ""; position: absolute; top: 8px; left: 50%; width: 42px; height: 4px; margin-left: -21px; border-radius: 2px; background: rgba(239, 224, 198, .3); }
  .drawer__foot { padding-inline: 16px; }
  .drawer__body { padding-inline: 16px; }
}
.bk-empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 34px 10px; text-align: center; color: var(--muted); }
.bk-empty > .ic { width: 52px; height: 52px; color: var(--amber); stroke-width: 1.2; filter: drop-shadow(0 0 10px rgba(244, 169, 34, .6)); }
.bk-lines { display: grid; gap: 10px; }
.bl { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "info sum" "qty rm"; align-items: center; gap: 8px 10px; padding: 12px 12px 10px 14px; border-radius: 16px; border: 1px solid var(--line); background: rgba(239, 224, 198, .03); }
.bl__info { grid-area: info; min-width: 0; }
.bl__name { font-weight: 700; color: var(--cream-2); line-height: 1.35; }
.bl__unit { font-size: .84rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.bl__sum { grid-area: sum; align-self: start; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qty { grid-area: qty; justify-self: start; display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 1px solid var(--line-2); border-radius: 999px; }
.qty button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--cream); }
.qty button:hover { color: var(--amber); }
.qty .ic { width: 18px; height: 18px; stroke-width: 2.2; }
.qty output { min-width: 26px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.bl__rm { grid-area: rm; justify-self: end; color: var(--muted); }
.bl__rm:hover { color: var(--err); border-color: var(--err); }
.bk-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 10px; padding: 0 2px; font-weight: 700; }
.bk-total strong { font: 600 1.65rem/1 var(--ff-d); color: var(--brass-hi); font-variant-numeric: tabular-nums; }
/* "Vider" sits under the lines, far from the send button (and can be undone) */
.bk-tools { display: flex; justify-content: flex-end; margin-top: 8px; }
.bk-clear { margin-right: -4px; }
.bk-undo:not(:empty) {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; margin-bottom: 6px; padding: 8px 14px;
  border-radius: 14px; border: 1px solid rgba(141, 190, 69, .45); background: rgba(141, 190, 69, .08); color: var(--cream-2); font-weight: 600;
}
.bk-undo .linkbtn { color: var(--brass-hi); }
.bk-choice { display: flex; align-items: flex-start; gap: 10px; margin: 14px 0 0; padding: 12px 14px; border-radius: 14px; border: 1px dashed rgba(244, 169, 34, .6); background: rgba(244, 169, 34, .07); font-size: .9rem; color: var(--cream-2); }
.bk-choice .ic { margin-top: 2px; color: var(--amber); }
.bk-note { display: flex; align-items: center; gap: 9px; margin: 16px 0 20px; font-size: .88rem; color: var(--muted); }
.bk-note .ic { color: var(--amber); }
.bk-form .fgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bk-form .field--full { grid-column: 1 / -1; }
.bk-form .form__hint { margin-bottom: 0; }
@media (max-width: 379.98px) { .bk-form .fgrid { grid-template-columns: minmax(0, 1fr); } }
/* "WhatsApp opens…" inside the sheet, right above the send button (or "did not open" + its link) */
.wa-note {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; padding: 10px 12px;
  border-radius: 14px; border: 1px solid rgba(95, 214, 138, .5); background: rgba(95, 214, 138, .08); color: var(--cream-2); font-weight: 600; font-size: .92rem;
}
.wa-note > .ic { color: #5fd68a; }
.wa-note p { flex: 1 1 180px; min-width: 0; }
.wa-note--alert { border-color: rgba(244, 169, 34, .75); background: rgba(244, 169, 34, .1); }

/* ---------- mobile action bar ---------- */
.mbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  height: var(--mbar); padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(8, 10, 8, .95); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid rgba(200, 164, 90, .32); box-shadow: 0 -12px 30px rgba(0, 0, 0, .6);
}
.mbar { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.mbar__a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 44px; min-width: 0; padding: 0 2px; color: var(--cream); text-decoration: none; font: 700 .75rem/1.1 var(--ff-s); letter-spacing: 0; text-align: center; }
.mbar__a .ic { width: 22px; height: 22px; color: var(--amber); }
.mbar__a:active { background: rgba(244, 169, 34, .1); }
.mbar__a--hot { color: var(--ink); background: linear-gradient(180deg, #f7df9f, #c99f4c); }
.mbar__a--hot .ic { color: var(--ink); }
.mbar__a:focus-visible { outline-offset: -4px; }
/* amber would vanish on the gold cell: an ink ring there */
.mbar__a--hot:focus-visible { outline-color: var(--ink); }
@media (min-width: 860px) { .mbar { display: none; } }
/* short landscape phones: a slimmer bar, icon beside the label */
@media (max-height: 520px) and (max-width: 859.98px) and (orientation: landscape) {
  :root { --mbar: calc(50px + env(safe-area-inset-bottom, 0px)); }
  .mbar__a, .fab { flex-direction: row; gap: 7px; }
}

/* ---------- toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: calc(var(--mbar) + 18px); z-index: 120; display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(92vw, 460px); transform: translateX(-50%); pointer-events: none; }
@media (min-width: 860px) { .has-fab .toasts { bottom: 88px; } }
/* phones: the "added" toast keeps to the left, clear of the column of "+" buttons; the others span the width */
@media (max-width: 859.98px) {
  .toasts { left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); width: auto; transform: none; align-items: flex-start; }
  .toasts .toast--add { width: auto; max-width: calc(100% - 84px); }
}
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 6px 8px 16px; border-radius: 16px;
  background: rgba(22, 16, 11, .97); border: 1px solid rgba(200, 164, 90, .45); color: var(--cream-2); font-weight: 600; font-size: .92rem;
  box-shadow: 0 20px 50px -14px rgba(0, 0, 0, .95), 0 0 30px -10px rgba(244, 169, 34, .55);
  opacity: 0; transform: translate3d(0, 16px, 0) scale(.97); transition: opacity .35s, transform .45s var(--ease);
}
.toast.is-in { opacity: 1; transform: none; }
/* the "added" toast is click-through: a tap meant for the next "+" goes to the "+" */
.toast--add { pointer-events: none; padding: 10px 16px; }
.toast--alert { border-color: rgba(244, 169, 34, .8); }
.toast > .ic { color: var(--green); }
.toast p { flex: 1; min-width: 0; padding: 6px 0; }
@media (max-width: 479.98px) {
  .toast { flex-wrap: wrap; }
  .toast p { flex-basis: calc(100% - 90px); }
  .toast__a { order: 3; flex: 1 0 100%; justify-content: center; margin: 0 6px 4px 0; }
}
.toast__a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px; background: var(--amber); color: var(--ink); font-weight: 800; font-size: .82rem; text-decoration: none; }
.toast__x { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--muted); }
.toast__x:hover { color: var(--cream); }
.toast__x .ic { width: 18px; height: 18px; }
