/* Ideal Studio — shared styles (booking + admin)
   Palette: rose identity, warm-neighbour register.
   Contrast commitments: body/muted text >=4.5:1 on --bg; white on --primary >=4.5:1. */
:root {
  --bg: #fbf7f7;            /* near-white tinted toward the brand rose, not generic cream */
  --surface: #ffffff;
  --ink: #362a2d;
  --muted: #6f585e;
  --primary: #9a5560;       /* buttons, selection — white text passes 4.5:1 */
  --primary-hover: #82434e;
  --tint: #f4e6e8;          /* selected/backdrop tint of the primary */
  --line: #e8dadc;
  --ok: #1f6b43;
  --ok-bg: #e3f1e9;
  --warn: #8f4517;
  --warn-bg: #f9ecdf;
  --danger: #9c3838;
  --danger-bg: #f7e4e4;
  --radius: 12px;
  --shadow-press: 0 1px 2px rgba(54, 42, 45, 0.12);
  --speed: 160ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1); /* ease-out-quint-ish */
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue',
    'PingFang SC', 'Noto Sans SC', sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}
main { max-width: 560px; margin: 0 auto; padding: 16px 16px 72px; }
.admin main { max-width: 960px; }

header.site {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 16px;
  text-align: center;
}
header.site h1 {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}
header.site .tagline { margin: 2px 0 0; font-size: 0.85rem; color: var(--muted); }

h2 {
  font-size: 1.05rem;
  margin: 28px 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-wrap: balance;
}
/* Booking is a genuine 4-step sequence; the numbers carry real order. */
.step {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.muted { color: var(--muted); font-size: 0.88rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.card.selectable { cursor: pointer; transition: border-color var(--speed) var(--ease), background-color var(--speed) var(--ease); }
.card.selectable:hover { border-color: var(--primary); }
.card.selected { border-color: var(--primary); background: var(--tint); }
.card .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card .name { font-weight: 600; }
.card .zh { color: var(--muted); font-size: 0.85rem; margin-top: 2px; }
.pricecol { text-align: right; flex: none; }
.price { font-weight: 700; color: var(--primary); white-space: nowrap; }
.price .strike { text-decoration: line-through; color: var(--muted); font-weight: 400; font-size: 0.85rem; margin-right: 6px; }
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge.offer { background: var(--tint); color: var(--primary); margin-top: 4px; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: 10px 16px;
  min-height: 44px;
  font-size: 0.92rem;
  cursor: pointer;
  transition: border-color var(--speed) var(--ease), background-color var(--speed) var(--ease), color var(--speed) var(--ease);
}
.chip:hover { border-color: var(--primary); }
.chip.selected { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip:disabled { opacity: 0.4; cursor: default; }
.chip:disabled:hover { border-color: var(--line); }

.btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: var(--radius);
  padding: 14px 18px;
  min-height: 48px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.btn:hover { background: var(--primary-hover); }
.btn:active { transform: scale(0.99); box-shadow: var(--shadow-press); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn.secondary { background: var(--surface); color: var(--primary); border: 1px solid var(--primary); }
.btn.secondary:hover { background: var(--tint); }
.btn.small { width: auto; padding: 7px 12px; min-height: 0; font-size: 0.82rem; border-radius: 8px; }
.btn.danger { background: var(--danger); }
.btn.danger:hover { background: #7f2c2c; }

:is(a, button, input, select, textarea, .chip, .card.selectable):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

label { display: block; font-size: 0.88rem; font-weight: 600; margin: 14px 0 5px; }
input[type='text'], input[type='tel'], input[type='password'], input[type='number'],
input[type='time'], select, textarea {
  width: 100%;
  padding: 12px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 1rem;
  background: var(--surface);
  color: var(--ink);
  transition: border-color var(--speed) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
.error { color: var(--danger); font-size: 0.88rem; margin-top: 8px; }
.notice {
  background: var(--tint);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.92rem;
  margin: 12px 0;
}

.success { text-align: center; padding: 36px 8px; }
.success .tick {
  font-size: 3rem;
  color: var(--ok);
  display: inline-block;
  animation: tick-pop 350ms var(--ease);
}
@keyframes tick-pop {
  0% { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

footer.trust {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}
footer.trust p { margin: 4px 0; }

/* Admin */
nav.admin-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 8px 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}
nav.admin-nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease);
}
nav.admin-nav a.active, nav.admin-nav a:hover { background: var(--tint); color: var(--primary); }
table { width: 100%; border-collapse: collapse; background: var(--surface); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
th {
  background: var(--tint);
  color: var(--primary);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
tbody tr { transition: background-color var(--speed) var(--ease); }
tbody tr:hover { background: var(--bg); }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .grid2 { grid-template-columns: 1fr; } }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 12px 0; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi .n { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.kpi .l { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Venue-style booking page (Fresha pattern) */
.venue-wrap { max-width: 1024px; margin: 0 auto; padding: 16px 20px 40px; }
.venue-gallery {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: repeat(2, 150px);
  gap: 10px;
  border-radius: var(--radius);
  overflow: hidden;
}
.venue-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vg-main { grid-row: 1 / 3; }
.venue-head { margin: 18px 0 4px; }
.venue-head h1 { margin: 0 0 4px; font-size: 1.7rem; letter-spacing: 0.04em; }
.venue-rating { margin: 2px 0 4px; font-size: 1.05rem; }
.venue-rating .stars { color: #e8a33d; letter-spacing: 2px; }
.venue-head .tagline { margin: 0; color: var(--muted); }
.venue-cols { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; margin-top: 10px; }
.venue-main { min-width: 0; }
.venue-sticky { position: sticky; top: 14px; }
.venue-sticky .vs-line { margin: 12px 0 0; font-size: 0.92rem; }
.venue-reviews { display: grid; gap: 10px; margin: 14px 0; }
.review-quote { margin: 0; padding: 12px 16px; }
.review-quote p { margin: 0 0 6px; font-style: italic; }
.review-quote footer { color: var(--muted); font-size: 0.88rem; }
@media (max-width: 760px) {
  .venue-cols { grid-template-columns: 1fr; }
  .venue-sticky { position: static; order: -1; }
  .venue-gallery { grid-template-rows: repeat(2, 96px); }
  .venue-wrap { padding: 10px 14px 32px; }
}

/* CRM stamp card */
.stamp-row { display: flex; gap: 8px; margin: 10px 0 6px; }
.stamp {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: var(--surface);
}
.stamp.filled { background: var(--primary); }

/* In-shop iPad menu (/menu) */
.menu main.menu-main { max-width: 1024px; margin: 0 auto; padding: 8px 20px 48px; }
.menu-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 10px 20px;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
}
.menu-nav::-webkit-scrollbar { display: none; }
.menu-nav .chip { text-decoration: none; color: var(--ink); flex: none; }
.mcat { scroll-margin-top: 72px; }
.mcat h2 { font-size: 1.35rem; margin: 34px 0 4px; }
.mzh-h { font-weight: 400; color: var(--muted); font-size: 1.05rem; margin-left: 6px; }
.mnote { margin: 0 0 14px; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.mcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.mcard.highlight { border-color: var(--primary); }
/* position:absolute pins every image to an identical 4:3 frame — a plain
   height:100% child can force an aspect-ratio box to grow to the photo's
   natural proportions, which made card images render at different heights. */
.mimg { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--tint); }
.mimg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.mimg.placeholder img.ill {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 40%;
  height: auto;
  inset: auto;
  opacity: 0.9;
}
.mbody { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.mbody h3 { margin: 0; font-size: 1.05rem; }
.mzh { margin: 2px 0 6px; color: var(--muted); font-size: 0.88rem; }
.mdesc { margin: 0; font-size: 0.88rem; }
.mdesc.zh2 { color: var(--muted); }
.mprice { margin: 0; font-weight: 700; font-size: 1.1rem; color: var(--primary); }
.mfoot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mbook { flex: none; }
.chip-primary { background: var(--primary); color: #fff !important; border-color: var(--primary); }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
