/* UnBound table picker: light papercraft controls around a paper-diorama map. */

.utp {
  --sand-50: #F3ECDF; --sand-100: #E8DCC8; --sand-200: #DCCBAF; --sand-300: #CBB58F;
  --terra: #A84A32; --terra-deep: #7A2E1D; --terra-ink: #4E1D12; --gold: #D4AC5E; --gold-deep: #A9813A;
  --ink: #4A2E1A; --ink-soft: #6B4E37; --cream: #FBF3E4; --paper: #F4ECDC;
  --shadow-sm: 1px 2px 0 rgba(60, 30, 10, .28);
  --shadow-md: 2px 3px 0 rgba(60, 30, 10, .28);
  --shadow-soft: 0 10px 24px rgba(60, 40, 20, .18);
  --display: 'Fraunces', Georgia, serif;
  --body: 'Nunito', system-ui, sans-serif;
  box-sizing: border-box; display: block; max-width: 1280px; margin: 0 auto; padding: 20px 16px 28px;
  background: var(--sand-50); color: var(--ink); font: 400 16px/1.45 var(--body); border-radius: 10px;
}
.utp *, .utp *::before, .utp *::after { box-sizing: border-box; }
.utp :where(.utp-head, .utp-body) :where(button, select) { font: inherit; color: inherit; }   /* the picker's own controls only: a page form it takes in keeps the page's styles */

.utp-head { margin: 0 0 14px; }
.utp-title { margin: 0; font: 600 clamp(28px, 4vw, 40px)/1.1 var(--display); color: var(--terra-deep); }
.utp-sub { margin: 4px 0 0; color: var(--ink-soft); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; font-size: 13px; }

.utp-body { display: grid; gap: 14px 18px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "controls" "map" "card" "status"; }
@media (min-width: 1100px) { .utp-body { grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: "map controls" "map card" "map status" "map ."; grid-template-rows: auto auto auto 1fr; align-items: start; } }
.utp-controls { grid-area: controls; } .utp-left { grid-area: map; } .utp-card { grid-area: card; } .utp-status { grid-area: status; }
.utp-left { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* controls */
.utp-controls { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--cream); border-radius: 6px; box-shadow: var(--shadow-md); padding: 14px; }
@media (max-width: 560px) { .utp-controls { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 1100px) { .utp-controls { grid-template-columns: minmax(0, 1fr); } }
.utp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.utp-label { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.utp-select { min-height: 48px; width: 100%; padding: 0 12px; border: 2px solid var(--ink); border-radius: 6px; background: var(--paper); }

/* floors and key */
.utp-floors { display: flex; gap: 8px; flex-wrap: wrap; }
.utp-tab { display: flex; align-items: baseline; gap: 8px; min-height: 48px; padding: 0 18px; border: 0; border-radius: 24px; background: var(--cream); box-shadow: var(--shadow-sm); cursor: pointer; font-weight: 700; }
.utp-tab[aria-selected="true"] { background: var(--terra-deep); color: var(--cream); }
.utp-tab-count { font-weight: 400; font-size: 14px; }
.utp-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.utp-key { display: flex; align-items: center; gap: 6px; }
.utp-swatch { width: 18px; height: 18px; border-radius: 50%; box-shadow: var(--shadow-sm); }

/* the map */
/* the cafe stands on a sheet the colour of its corner sheet: cream for the ground floor, pale terracotta upstairs */
.utp-mapwrap { --sheet: var(--cream); position: relative; border-radius: 8px; box-shadow: var(--shadow-soft); background: var(--sheet); }
.utp-mapwrap[data-floor="up"] { --sheet: #F0D3C4; }
/* zoomed in, a sideways swipe stays on the map (no browser back by accident); up or down at its edge scrolls the page on */
.utp-viewport { height: min(76vh, 900px); overflow: auto; border-radius: 8px; overscroll-behavior: contain auto; cursor: grab; scrollbar-width: thin; }
.utp-viewport.is-dragging { cursor: grabbing; }
.utp-map { position: relative; aspect-ratio: 2 / 3; margin: 0 auto; user-select: none; }
.utp-floorimg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .45s ease; filter: drop-shadow(3px 6px 6px rgba(60, 30, 10, .28)); }
.utp-floorimg.is-on { opacity: 1; }
.utp-tokens { position: absolute; inset: 0; }
.utp-tokens[hidden] { display: none; }
.utp-zoombar { position: absolute; right: 10px; bottom: 10px; }
.utp-zoom { min-height: 44px; padding: 0 16px; border: 0; border-radius: 22px; background: var(--cream); box-shadow: var(--shadow-md); font-weight: 700; cursor: pointer; }

/* table tokens: paper discs standing on the tables */
.utp-token {
  position: absolute; width: var(--tk, 44px); height: var(--tk, 44px); margin: calc(var(--tk, 44px) * -.91) 0 0 calc(var(--tk, 44px) * -.5); border-radius: 50%;
  border: 2px solid var(--cream); font: 700 calc(var(--tk, 44px) * .34)/1 var(--body); cursor: pointer;
  box-shadow: 0 3px 0 rgba(60, 30, 10, .35), 0 6px 10px rgba(60, 30, 10, .25);
  transition: transform .15s ease, background-color .2s ease;
}
.utp-token[data-state="free"], .utp-swatch.is-free { background: var(--terra); color: var(--cream); }
.utp-token[data-state="free"]:hover { transform: translateY(-2px); }
.utp-token[data-state="picked"], .utp-swatch.is-picked { background: var(--gold); color: var(--ink); border-color: var(--ink); }
.utp-token[data-state="picked"] { transform: scale(1.12); box-shadow: 0 0 0 6px rgba(212, 172, 94, .45), 0 6px 10px rgba(60, 30, 10, .3); z-index: 2; }
.utp-token[data-state="booked"], .utp-swatch.is-booked { background: repeating-linear-gradient(45deg, var(--sand-100) 0 4px, var(--sand-300) 4px 8px); color: var(--ink); cursor: not-allowed; }
.utp-token[data-state="booked"] { text-decoration: line-through 2px; }
.utp-token[data-state="nofit"], .utp-swatch.is-nofit { background: var(--sand-100); color: var(--ink-soft); border-style: dashed; border-color: var(--ink-soft); cursor: not-allowed; }
.utp-token[data-state="walkin"] { background: var(--paper); color: var(--ink); border: 2px dashed var(--ink); cursor: default; }
.utp-token:focus-visible, .utp-tab:focus-visible, .utp-step:focus-visible, .utp-select:focus-visible,
.utp-go:focus-visible, .utp-clear:focus-visible, .utp-zoom:focus-visible { outline: 3px solid var(--gold-deep); outline-offset: 3px; }

/* selection card */
.utp-card { background: var(--cream); border-radius: 6px; box-shadow: var(--shadow-md); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.utp-card-title { margin: 0; font: 600 26px/1.15 var(--display); color: var(--terra-deep); }
.utp-card-meta { margin: 0; font-weight: 700; color: var(--ink-soft); }
.utp-card-text, .utp-card-when, .utp-card-note { margin: 0; }
.utp-card-note { font-size: 13px; color: var(--ink-soft); }
.utp-card-when { font-weight: 700; }
.utp-view { position: relative; height: 200px; overflow: hidden; border-radius: 6px; background: #3D2D20; }
.utp-viewimg { width: 100%; height: 100%; object-fit: cover; object-position: 50% 62%; }
.utp-viewcrop { position: absolute; left: 0; top: 50%; width: 100%; height: auto; margin-top: -75%; }
.utp-go { min-height: 52px; margin-top: 6px; border: 0; border-radius: 6px; background: var(--terra-deep); color: var(--cream); font-weight: 700; font-size: 16px; cursor: pointer; box-shadow: 0 3px 0 var(--terra-ink); }
.utp-go:active { transform: translateY(3px); box-shadow: none; }
.utp-clear { min-height: 44px; border: 2px solid var(--ink); border-radius: 6px; background: transparent; font-weight: 700; cursor: pointer; }
.utp-status { margin: 0; min-height: 1.4em; font-weight: 700; color: var(--terra-deep); }
.utp-error { padding: 16px; background: var(--cream); border-radius: 6px; }

@media (prefers-reduced-motion: reduce) { .utp * { transition: none !important; } }

/* phones: the map runs edge to edge, the controls keep a small gutter (owner: the biggest possible first view) */
@media (max-width: 699px) {
  .utp { padding-left: 0; padding-right: 0; border-radius: 0; }
  .utp-head, .utp-controls, .utp-floors, .utp-legend, .utp-card, .utp-status { margin-left: 12px; margin-right: 12px; }
  .utp-mapwrap, .utp-viewport { border-radius: 0; }
}

/* the floor buttons and the key on a cream paper sheet cut to the empty triangle beside the angled wall: it lies on the
   worktable like a label beside the model, a few millimetres short of the wall, so it never covers the cafe */
.utp-corner { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; filter: drop-shadow(2px 3px 0 rgba(60, 30, 10, .22)) drop-shadow(0 6px 10px rgba(60, 30, 10, .14)); }
.utp-corner::before { content: ""; position: absolute; inset: 0; background: var(--sheet); clip-path: polygon(0 0, 100% 0, 0 100%); }
.utp-corner[hidden] { display: none; }
.utp-corner > * { position: relative; pointer-events: auto; }
/* every size on the sheet is times --cs, which the picker sets so the controls reach out to the wall (never below 1);
   the words are in rem, so they follow the guest's text size */
.utp-corner { --cs: 1; }
.utp-corner .utp-legend { display: grid; grid-template-columns: auto auto; gap: calc(var(--cs) * 2px) calc(var(--cs) * 6px); margin: calc(var(--cs) * 8px) 0 0 calc(var(--cs) * 8px); padding: 0; font-size: calc(var(--cs) * .65625rem); line-height: 1.35; width: max-content; }
.utp-corner .utp-key { gap: calc(var(--cs) * 5px); }
.utp-corner .utp-swatch { width: calc(var(--cs) * .625rem); height: calc(var(--cs) * .625rem); }
.utp-corner .utp-floors { flex-direction: column; align-items: flex-start; gap: calc(var(--cs) * 4px); flex-wrap: nowrap; margin: calc(var(--cs) * 8px) 0 0 calc(var(--cs) * 8px);
  width: max-content; }   /* as wide as its buttons: the full corner width covered table 9 and swallowed its taps */
.utp-corner .utp-tab { min-height: calc(var(--cs) * 44px); padding: calc(var(--cs) * 3px) calc(var(--cs) * .625rem); border-radius: calc(var(--cs) * 24px); flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; font-size: calc(var(--cs) * .8125rem); line-height: 1.15; }
.utp-corner .utp-tab-count { font-size: calc(var(--cs) * .6875rem); }
/* text set too large for that triangle: the sheet leaves the drawing and the floor buttons, the zoom and the key sit in a
   row above the map, so nothing covers a table (adapt, 3 Nov 2026) */
.utp-corner.is-out { position: static; width: auto !important; height: auto !important; display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px 12px; padding: 6px 8px; pointer-events: auto; }   /* one 44 px row on a phone, so the drawing keeps its height */
.utp-corner.is-out::before { display: none; }
.utp-corner.is-out .utp-floors { flex-direction: row; flex-wrap: wrap; margin: 0; }
.utp-corner.is-out .utp-legend { order: 1; margin: 0; }   /* after the floor buttons and the zoom, still two by two */
.utp-corner.is-out .utp-zoom.is-icon { margin: 0; }

/* the picked table: a slim bar, no photo */
.utp-card-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.utp-card-top .utp-card-title { font-size: 22px; }
.utp-card-top .utp-card-meta { font-size: 13px; }
.utp-card-actions { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 4px; }
.utp-card-actions .utp-go { margin-top: 0; min-height: 44px; }
.utp-card-actions .utp-clear { padding: 0 14px; }

/* phones: the title and one compact row for guests, date and time; the rest of the first screen is the map */
@media (max-width: 699px) {
  .utp { padding-top: 10px; }
  .utp-head { margin-bottom: 8px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
  .utp-title { font-size: 22px; }
  .utp-sub { margin: 0; font-size: 11px; }
  .utp-controls { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); gap: 6px; padding: 8px; align-items: center; }
  .utp-controls .utp-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }   /* still read out */
  .utp-select { min-height: 44px; padding: 0 6px; font-size: 14px; }
  .utp-body { gap: 8px; }
  /* fixed, not sticky: phone browsers keep fixed bars above their bottom toolbar, but place sticky ones as if it were
     not there, which hid part of Confirm under the address bar */
  .utp.utp-picked .utp-card { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; box-shadow: 0 -4px 14px rgba(60, 40, 20, .2); }
}

/* Safari draws native selects at its own height: drawn as plain paper fields with an ink arrow they keep the 44 px target */
.utp-select { -webkit-appearance: none; appearance: none; padding-right: 26px;
  background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%234A2E1A' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 9px center; }

/* phones: the picked table's card stays slim at the bottom, so the floor stays in view behind it */
@media (max-width: 699px) {
  .utp.utp-picked .utp-card { padding: 10px 12px; gap: 4px; }
  .utp.utp-picked .utp-card-meta, .utp.utp-picked .utp-card-note { font-size: 13px; }
  .utp.utp-picked .utp-card-when { font-size: 14px; }
}

/* Confirm is a link to WhatsApp, drawn as the primary button */
a.utp-go { display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none; }
.utp-card-note { margin: 0; font-size: 12px; color: var(--ink-soft); }

/* zoom on the sheet: a round terracotta button with an ink-free magnifier, clear of the cafe */
.utp-zoom.is-icon { width: calc(var(--cs) * 44px); height: calc(var(--cs) * 44px); min-height: 0; margin: calc(var(--cs) * 6px) 0 0 calc(var(--cs) * 8px); padding: 0; border-radius: 50%; position: relative; pointer-events: auto;
  background: var(--terra-deep) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%23FBF3E4' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5L21 21M10.5 7.5v6M7.5 10.5h6'/%3E%3C/svg%3E") center / calc(var(--cs) * 22px) no-repeat;
  box-shadow: 0 3px 0 var(--terra-ink); }
.utp-zoom.is-icon:active { transform: translateY(2px); box-shadow: none; }
.utp-zoombar[hidden] { display: none; }

/* Mockup only: room between the picker and the form heading on the reserve page. */
.picker-section { padding-bottom: 32px; }
.form-head { margin-bottom: 20px; }
