/* mesa — the restaurant's booking page and widget (body.site) and the guest's own pages.
   Design "Azulejo" (docs/DESIGN.md §4): the restaurant's logo and name are the brand; no tiles,
   no mark of ours but the small "Reservas con mesa" badge. Builds on base.css (tokens, forms,
   chips, panels, status pills) and on nothing else. The page follows the device's theme; the
   widget is told its theme by the embed (data-theme on <html>, set by site.widget). */

/* 1. Header: the logo on a plate, the name (the page's h1, so it drops the heading margin) ---- */
.site-header { padding-block: 24px 8px; }
.site-brand { display: inline-flex; align-items: center; gap: 16px; max-width: 100%; color: var(--ink); text-decoration: none; }
.site-brand:hover { color: var(--ink); }
/* --on-btn is white in both themes: the plate keeps the logo's own colours at night */
.site-plate { display: inline-grid; place-items: center; flex: none; width: 80px; height: 80px; padding: 4px; background: var(--on-btn); border: 1px solid var(--line); border-radius: var(--r-ctl); }
.site-logo { width: 72px; height: 72px; object-fit: contain; }
.site-name { margin: 0; min-width: 0; font-size: var(--fs-4); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; }
.site-plate + .site-name { font-size: var(--fs-3); }

/* 2. The page: the intro, then the one panel ----------------------------------- */
.site-main { padding-block: 8px 40px; }
.site-intro { margin: 16px 0 32px; }
.site-intro p { font-size: var(--fs-1); line-height: 1.5; }
.booking h2 { margin-bottom: 12px; }
.booking-form { padding: 24px 20px; }
@media (min-width: 560px) { .booking-form { padding: 32px; } }
.booking-form fieldset[disabled] { opacity: 0.55; }
.booking-form #b-submit { margin-top: 4px; }
/* Why the button is off (booking.js hides it once a time is chosen); gone with the button once booked */
.booking-form #b-submit-hint { margin: 10px 0 0; max-width: none; text-align: center; }
.booking-form.is-done #b-submit-hint { display: none; }

/* Kinds of table: radio chips. The input stays a real radio (keyboard, booking.js reads
   input[name=zone_id]) and is hidden off-screen; the label after it is the pill. */
.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented .segment-input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; opacity: 0; pointer-events: none; }
.segment { display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; max-width: 100%; min-height: 44px; padding: 8px 18px; border: 1.5px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface); color: var(--ink); font-weight: 500; line-height: 1.2; cursor: pointer; }
.segment:hover { border-color: var(--cobalt); color: var(--cobalt); }
.segment-desc { font-size: var(--fs-sm); font-weight: 400; line-height: 1.3; color: var(--muted); }
.segment-input:checked + .segment { background: var(--cobalt); border-color: var(--cobalt); color: var(--on-cobalt); }
.segment-input:checked + .segment .segment-desc { color: var(--on-cobalt); }
.segment-input:focus-visible + .segment { box-shadow: var(--focus); }

/* The day: the native picker, dressed like the other inputs (iOS gives it a look of its own) */
.booking-form input[type="date"] { -webkit-appearance: none; appearance: none; min-height: 48px; }
.booking-form input[type="date"]::-webkit-date-and-time-value { min-height: 1.3em; text-align: left; }

/* Times: chips from base.css; a message ("loading", "that time was just taken") takes the row */
.slots { min-height: 44px; }
.slots-msg { flex: 1 1 100%; align-self: center; margin: 0; color: var(--muted); }
.slots .slots-msg:not(.muted) { color: var(--warn); font-weight: 500; }
.hold-note { margin: 8px 0 0; font-size: var(--fs-sm); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.challenge { margin: 0 0 12px; }

/* The answer: registered, confirmed, or what went wrong */
.booking-result { margin: 0 0 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-ctl); background: var(--surface-2); color: var(--ink); }
.booking-result.is-ok { background: var(--ok-bg); border-color: var(--ok-bg); color: var(--ok); }
.booking-result.is-error { background: var(--err-bg); border-color: var(--err-bg); color: var(--err); }
.booking-result p { margin: 0 0 8px; max-width: none; font-weight: 500; }
.booking-result p:last-child { margin: 0; }
.booking-form.is-done #b-submit { display: none; }

/* 3. The guest's own page (and the manager link): one panel. Its heading is an h2 (the
   restaurant's name in the header is the h1), the same size as "Reserva tu mesa" on the page. */
.ticket { margin-top: 16px; }
.ticket h2 { margin-bottom: 12px; }
.ticket-status { margin: 0 0 24px; }
.ticket-rows { margin: 0 0 24px; border-top: 1px solid var(--line); }
.ticket-rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ticket-rows dt { flex: none; color: var(--muted); }
.ticket-rows dd { min-width: 0; text-align: right; font-weight: 500; overflow-wrap: anywhere; text-wrap: balance; }
.ticket-rows dd.num { font-size: var(--fs-1); }
.ticket form { margin: 0 0 16px; }
.cancel-box { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); }
.cancel-box summary { color: var(--ink-soft); }
.cancel-box form { margin: 8px 0 0; }
.ticket-foot { margin: 24px 0 0; }

/* 4. Footer: how to reach the restaurant, the languages, the badge ----------------- */
/* The language links and the badge are 44px tap targets with 4px of side padding; the lists
   start 4px to the left so the words still line up with the contact lines above. */
.site-footer { margin-top: 40px; padding-block: 24px 32px; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--muted); }
.site-footer p { margin: 0 0 8px; }
.lang-switch ul { display: flex; flex-wrap: wrap; gap: 0 8px; margin: 4px 0 0 -4px; padding: 0; list-style: none; }
.lang-switch li { margin: 0; }
.lang-switch a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--ink-soft); text-decoration: none; }
.lang-switch a:hover, .lang-switch a:focus-visible { color: var(--cobalt); text-decoration: underline; }
.lang-switch a[aria-current="true"] { color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.25em; }
.powered { margin: 12px 0 0; }
.powered a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-left: -4px; padding: 0 4px; color: var(--ink-soft); text-decoration: none; }
.powered a:hover, .powered a:focus-visible { color: var(--cobalt); text-decoration: underline; }
.powered-mark { width: 18px; height: 18px; flex: none; color: var(--ink); }

/* 5. The widget: the form alone, inside the restaurant's own page ------------------- */
body.widget { background: transparent; }
.widget-main { max-width: var(--narrow); margin-inline: auto; padding: 8px; }
.widget .booking-form { padding: 20px 16px; }
@media (min-width: 560px) { .widget .booking-form { padding: 24px; } }
/* The links' own 4px side padding is the inset here (no padding on the foot, no negative margins) */
.widget-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; margin: 4px 0 0; padding: 0; font-size: var(--fs-sm); color: var(--muted); }
.widget-foot .lang-switch ul { margin: 0; }
.widget-foot .powered { margin: 0; }
.widget-foot .powered a { margin-left: 0; }
@media (max-width: 479px) { .widget-main { padding: 4px; } }

@media (prefers-reduced-motion: no-preference) {
  .segment { transition: background-color 120ms, border-color 120ms, color 120ms; }
}
