/* Badi Palace booking — styled as part of badipalace.com.
   Colours, fonts, radius, card shadow and type scale follow the website's design tokens
   (Badi-Palace/src/styles/global.css). Fonts are self-hosted, SIL Open Font License (public/fonts/). */

/* ---------- fonts (same files and font-display choices as badipalace.com) ---------- */
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/fonts/plus-jakarta-sans-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: optional;
}

@font-face {
  font-family: 'Cormorant Garamond';
  src: url('/fonts/cormorant-garamond-latin-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Noto Naskh Arabic';
  src: url('/fonts/noto-naskh-arabic-arabic-600-normal.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: optional;
}

@font-face {
  font-family: 'Noto Sans Arabic';
  src: url('/fonts/noto-sans-arabic-arabic-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Metric-matched stand-ins, copied from the website, so text does not move when the web fonts arrive. */
@font-face {
  font-family: 'Inter Fallback';
  src: local('Arial');
  font-weight: 100 900;
  size-adjust: 106.8%;
  ascent-override: 90.7069%;
  descent-override: 22.5853%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Plus Jakarta Sans Fallback';
  src: local('Arial Bold'), local('Arial-BoldMT'), local('Liberation Sans Bold'), local('Roboto Bold');
  font-weight: 200 800;
  size-adjust: 99.85%;
  ascent-override: 103.96%;
  descent-override: 22.23%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Cormorant Garamond Fallback';
  src: local('Times New Roman'), local('TimesNewRomanPSMT'), local('Liberation Serif');
  font-weight: 600;
  size-adjust: 90%;
  ascent-override: 102.67%;
  descent-override: 31.89%;
  line-gap-override: 0%;
}

/* ---------- design tokens ---------- */
:root {
  color-scheme: light;

  /* badipalace.com @theme */
  --background: #f5efe6;
  --surface: #fffdf9;
  --primary: #234b3a;
  --primary-dark: #1a3a2c;
  --terracotta: #a65e44;
  --terracotta-strong: #8e4c35;
  --gold: #b79660;
  --gold-light: #e2cfa6;
  --border: #ddd1bd;
  --muted: #5c5448;
  --ink: #222222;
  --hover: #ebe2d3;
  --on-primary: #f5efe6;
  --on-primary-muted: #d6ccba;

  /* Booking roles mixed from the palette. Contrast (WCAG 2.2) in the comments. */
  --border-strong: #857761;  /* form-field outline: 4.3:1 on surface (non-text minimum 3:1) */
  --primary-tint: #e3ece6;   /* info message: primary-dark text 10.3:1 */
  --gold-tint: #f4ead6;      /* test-mode banner, waiting notes: ink 13.3:1 */
  --error-tint: #f7e8e1;     /* payment error: error-ink text 7.1:1 */
  --error-ink: #7a3b27;
  --closed: #f2ebe0;         /* closed / sold-out day: muted number 6.3:1 */
  --hatch: rgb(183 150 96 / 0.45);

  /* Layout */
  --container: 70rem;
  --radius: 0.25rem;
  --shadow-card: 0 1px 2px rgb(34 34 34 / 0.05), 0 10px 28px rgb(34 34 34 / 0.07);

  /* Type */
  --font-sans: 'Inter', 'Inter Fallback', ui-sans-serif, system-ui, sans-serif;
  --font-heading: 'Plus Jakarta Sans', 'Plus Jakarta Sans Fallback', ui-sans-serif, system-ui, sans-serif;
  --font-serif: 'Cormorant Garamond', 'Cormorant Garamond Fallback', ui-serif, Georgia, serif;
  --type-body: var(--font-sans);
  --type-heading: var(--font-heading);
  --type-accent: var(--font-serif);
  --leading-body: 1.7;

  --text-h2: clamp(1.625rem, 1.35rem + 1.35vw, 2.375rem);
  --text-h3: clamp(1.3125rem, 1.18rem + 0.65vw, 1.6875rem);
  --text-h4: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  --text-accent-3: clamp(1.5rem, 1.28rem + 1.1vw, 2.125rem);
  --text-accent-4: clamp(1.3125rem, 1.2rem + 0.55vw, 1.625rem);
  --text-accent-6: 1.125rem;
  --text-body: 1.0625rem;
  --text-small: 0.9375rem;
  --text-caption: 0.8125rem;
  --text-button: 1rem;

  /* Eight-point star (website `star` utility) and khatam lattice (footer band). */
  --star: polygon(50% 0, 64.64% 14.64%, 85.36% 14.64%, 85.36% 35.36%, 100% 50%, 85.36% 64.64%, 85.36% 85.36%, 64.64% 85.36%, 50% 100%, 35.36% 85.36%, 14.64% 85.36%, 14.64% 64.64%, 0 50%, 14.64% 35.36%, 14.64% 14.64%, 35.36% 14.64%);
  --pattern-khatam: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 56 56'%3E%3Cg fill='none' stroke='%23b79660' stroke-width='1'%3E%3Crect x='12' y='12' width='32' height='32'/%3E%3Crect x='12' y='12' width='32' height='32' transform='rotate(45 28 28)'/%3E%3Cpath d='M0 0l12 12M56 0L44 12M0 56l12-12M56 56L44 44'/%3E%3C/g%3E%3C/svg%3E");
}

/* Arabic text, if any, uses the website's Arabic fonts (downloaded only when used). */
:lang(ar) {
  --arabic-system: 'SF Arabic', 'Geeza Pro', 'Segoe UI', system-ui, Tahoma, sans-serif;
  --type-body: 'Noto Sans Arabic', var(--arabic-system);
  --type-heading: 'Noto Naskh Arabic', var(--arabic-system);
  --type-accent: 'Noto Naskh Arabic', var(--arabic-system);
  --leading-body: 1.95;
  letter-spacing: 0;
}

[lang='ar'] {
  font-family: var(--type-body);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font-family: var(--type-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
}

[hidden] {
  display: none !important;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

a:hover {
  text-decoration-thickness: 2px;
}

button,
input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

a,
button {
  scroll-margin-block: 1rem;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

/* ---------- site header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  min-height: 3.5rem;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  border-radius: var(--radius);
  color: var(--primary);
  font-family: var(--type-accent);
  font-size: var(--text-accent-4);
  font-weight: 600;
  line-height: 1.1;
  text-decoration: none;
}

.wordmark img {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
}

.wordmark:hover span {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}

/* ---------- page heading ---------- */
.masthead-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-top: 2.25rem;
  padding-bottom: 1.5rem;
}

.site-name {
  margin: 0;
  color: var(--primary);
  font-family: var(--type-heading);
  font-size: var(--text-h2);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
  word-spacing: 0.04em;
  text-wrap: balance;
}

.tagline {
  margin: 0.5rem 0 0;
  max-width: 56ch;
  color: var(--muted);
}

.hours {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  color: var(--muted);
  font-size: var(--text-small);
  line-height: 1.5;
  white-space: nowrap;
}

.hours:empty {
  display: none;
}

.hours::before {
  content: '';
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  background: var(--gold);
  clip-path: var(--star);
}

.banner {
  margin: 0;
  padding: 0.625rem 1.25rem;
  text-align: center;
  font-size: var(--text-small);
  line-height: 1.5;
}

.banner-test {
  background: var(--gold-tint);
  color: var(--ink);
  border-block: 1px solid var(--gold-light);
}

.banner-notice {
  background: var(--hover);
  color: var(--ink);
  border-block: 1px solid var(--border);
}

/* ---------- layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  gap: 2rem;
  align-items: start;
  flex: 1;
  padding-top: 0.5rem;
  padding-bottom: 3.5rem;
}

.banner:not([hidden]) ~ .layout {
  padding-top: 1.5rem;
}

.flow {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.step {
  padding: 1.75rem 2rem 2rem;
  scroll-margin-top: 1rem;
}

.step + .step {
  border-top: 1px solid var(--border);
}

.step-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  color: var(--primary);
  font-family: var(--type-heading);
  font-size: var(--text-h4);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.005em;
}

.step-num {
  flex: none;
  position: relative;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  color: var(--primary);
  display: grid;
  place-items: center;
  font: 600 0.875rem/1 var(--font-sans);
  letter-spacing: 0;
}

.step.is-complete .step-num {
  background: var(--primary);
  border-color: var(--primary);
  color: transparent;
}

.step.is-complete .step-num::after {
  content: '';
  position: absolute;
  width: 0.6875rem;
  height: 0.375rem;
  border-left: 2px solid var(--on-primary);
  border-bottom: 2px solid var(--on-primary);
  transform: translateY(-2px) rotate(-45deg);
}

.hint {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: var(--text-small);
  line-height: 1.6;
}

/* ---------- calendar ---------- */
.calendar {
  max-width: 28rem;
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.cal-month {
  margin: 0;
  color: var(--ink);
  font-family: var(--type-accent);
  font-size: var(--text-accent-4);
  font-weight: 600;
  line-height: 1.2;
}

.cal-nav {
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  background: var(--surface);
  color: var(--primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.15s;
}

.cal-nav svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cal-nav:hover:not(:disabled) {
  background: var(--hover);
}

.cal-nav:disabled {
  cursor: default;
  border-color: var(--border);
  color: var(--muted);
  opacity: 0.55;
}

/* Each cell is the whole touch target (at least 44 px); the visible tile sits inside a transparent border. */
.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cal-weekdays {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: var(--text-caption);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

.day {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  min-height: 2.75rem;
  padding: 0;
  border: 3px solid transparent;
  border-radius: calc(var(--radius) + 3px);
  background-color: var(--surface);
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--primary);
  font: 600 1rem/1 var(--font-sans);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background-color 0.15s, box-shadow 0.15s;
}

.day:hover:not(:disabled) {
  background-color: var(--hover);
  box-shadow: inset 0 0 0 1px var(--primary);
}

.day:focus-visible {
  outline-offset: -2px;
}

.day.is-today {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

/* Few left: a terracotta dot (4.8:1 on the tile). */
.day.is-few::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--terracotta);
}

.day:disabled {
  cursor: default;
}

.day.is-past,
.day.is-beyond,
.day.is-loading {
  background-color: transparent;
  box-shadow: none;
  color: var(--muted);
  font-weight: 400;
}

/* Closed, sold out or past the cut-off: hatched in gold, number still readable (6.3:1). */
.day.is-closed,
.day.is-soldout,
.day.is-cutoff {
  background-color: var(--closed);
  background-image: repeating-linear-gradient(135deg, transparent 0 5px, var(--hatch) 5px 6px);
  box-shadow: none;
  color: var(--muted);
  font-weight: 400;
}

/* Selected: zellige green with a small gold star. */
.day[aria-pressed='true'],
.day[aria-pressed='true']:hover:not(:disabled) {
  background-color: var(--primary);
  box-shadow: none;
  color: var(--on-primary);
  font-weight: 700;
  text-decoration: none;
}

.day[aria-pressed='true']::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 9px;
  height: 9px;
  border-radius: 0;
  background: var(--gold);
  clip-path: var(--star);
}

.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: var(--text-caption);
  line-height: 1.5;
}

.cal-legend li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.key {
  position: relative;
  width: 1rem;
  height: 1rem;
  border-radius: 3px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border);
}

.key-few::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--terracotta);
}

.key-off {
  box-shadow: none;
  background-color: var(--closed);
  background-image: repeating-linear-gradient(135deg, transparent 0 3px, var(--hatch) 3px 4px);
}

.cal-error {
  margin: 0.75rem 0 0;
  color: var(--terracotta-strong);
  font-size: var(--text-small);
  line-height: 1.5;
}

/* ---------- tickets ---------- */
.tickets {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ticket {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.25rem 1.5rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.ticket:first-child {
  padding-top: 0.25rem;
}

.ticket:last-child {
  border-bottom: 0;
}

.ticket-name {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.4;
}

.ticket-desc {
  margin: 0.125rem 0 0;
  color: var(--muted);
  font-size: var(--text-small);
  line-height: 1.5;
}

.ticket-price {
  margin: 0;
  color: var(--primary);
  font-family: var(--type-accent);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: lining-nums tabular-nums;
}

.ticket-out {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--terracotta-strong);
  font-size: var(--text-caption);
  font-weight: 500;
  line-height: 1.5;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.stepper button {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  background: var(--surface);
  color: var(--primary);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 0.15s;
}

.stepper button svg {
  width: 1rem;
  height: 1rem;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  fill: none;
}

.stepper button:hover:not(:disabled) {
  background: var(--hover);
}

.stepper button:disabled {
  border-color: var(--border);
  color: var(--muted);
  opacity: 0.6;
  cursor: default;
}

.stepper output {
  min-width: 2.25rem;
  text-align: center;
  font-weight: 600;
  font-size: 1.125rem;
  font-variant-numeric: tabular-nums;
}

/* ---------- details form ---------- */
.details {
  display: grid;
  gap: 1.25rem;
  max-width: 40rem;
}

.field label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 600;
  font-size: var(--text-small);
  line-height: 1.4;
}

.opt {
  color: var(--muted);
  font-weight: 400;
}

.field input[type='text'],
.field input[type='email'],
.field input[type='tel'],
.field input:not([type]) {
  width: 100%;
  height: 3rem;
  padding: 0 0.875rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 1rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:hover {
  border-color: var(--muted);
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(35 75 58 / 0.16);
}

.field input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.field input[aria-invalid='true'] {
  border-color: var(--terracotta-strong);
}

.help {
  margin: 0.375rem 0 0;
  color: var(--muted);
  font-size: var(--text-caption);
  line-height: 1.5;
}

.err {
  margin: 0.375rem 0 0;
  color: var(--terracotta-strong);
  font-size: var(--text-small);
  font-weight: 500;
  line-height: 1.5;
}

.err:empty {
  display: none;
}

.field .check {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  min-height: 2.75rem;
  margin: 0;
  font-weight: 400;
  font-size: var(--text-body);
  cursor: pointer;
}

.check input {
  flex: none;
  width: 1.375rem;
  height: 1.375rem;
  margin: 0;
  accent-color: var(--primary);
}

/* ---------- pay ---------- */
.inline-summary {
  display: none;
}

.pay-hint {
  margin-bottom: 0.875rem;
}

.pay-hint.is-error {
  color: var(--terracotta-strong);
  font-weight: 500;
}

.pay-box {
  max-width: 26rem;
}

#paypal-buttons {
  min-height: 0;
}

.pay-msg {
  margin: 0.875rem 0 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--terracotta);
  background: var(--error-tint);
  color: var(--error-ink);
  font-size: var(--text-small);
  line-height: 1.55;
}

.pay-msg.is-info {
  border-left-color: var(--primary);
  background: var(--primary-tint);
  color: var(--primary-dark);
}

.pay-unconfirmed {
  margin: 0.875rem 0 0;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  border-left: 3px solid var(--gold);
  background: var(--gold-tint);
  color: var(--ink);
  font-size: var(--text-small);
  line-height: 1.55;
}

.pay-unconfirmed p {
  margin: 0 0 0.75rem;
}

.fineprint {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: var(--text-caption);
  line-height: 1.6;
  max-width: 60ch;
}

/* ---------- buttons (website Button: 44 px, 4 px radius, semibold) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: var(--text-button);
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary:disabled {
  background: var(--border);
  color: var(--muted);
  cursor: default;
}

.btn-secondary {
  background: transparent;
  border-color: var(--primary);
  color: var(--primary);
}

.btn-secondary:hover {
  background: var(--hover);
}

.btn-block {
  width: 100%;
  min-height: 3rem;
}

/* ---------- summary ---------- */
.summary {
  position: sticky;
  top: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
}

.summary::before {
  content: '';
  display: block;
  width: 0.75rem;
  height: 0.75rem;
  margin-bottom: 0.75rem;
  background: var(--gold);
  clip-path: var(--star);
}

.summary-title {
  margin: 0 0 0.75rem;
  color: var(--primary);
  font-family: var(--type-heading);
  font-size: var(--text-h4);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: -0.005em;
}

.summary-date {
  margin: 0;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  font-family: var(--type-accent);
  font-size: 1.375rem;
  font-weight: 600;
  line-height: 1.25;
}

.summary-date.is-empty {
  color: var(--muted);
  font-family: var(--type-body);
  font-size: var(--text-small);
  font-weight: 400;
  line-height: 1.6;
}

.summary-lines {
  list-style: none;
  margin: 0;
  padding: 0.625rem 0;
}

.summary-lines li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.25rem 0;
  font-size: var(--text-small);
  line-height: 1.5;
}

.summary-lines li span:last-child {
  font-family: var(--type-accent);
  font-size: 1.25rem;
  font-weight: 600;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}

.summary-lines:empty {
  display: none;
}

.summary-email {
  margin: 0.625rem 0 0;
  color: var(--muted);
  font-size: var(--text-caption);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.summary-email strong {
  color: var(--ink);
  font-weight: 600;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-weight: 600;
}

.summary-total strong {
  color: var(--primary);
  font-family: var(--type-accent);
  font-size: var(--text-accent-3);
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: lining-nums tabular-nums;
}

.assurances {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 0.625rem;
  color: var(--muted);
  font-size: var(--text-caption);
  line-height: 1.5;
}

.assurances li {
  position: relative;
  padding-left: 1.375rem;
}

.assurances li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.3em;
  width: 0.625rem;
  height: 0.625rem;
  background: var(--gold);
  clip-path: var(--star);
}

/* ---------- confirmation ---------- */
.done {
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  flex: 1;
  outline: none;
}

.done-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 2.5rem 2.25rem 2.25rem;
  text-align: center;
}

.done-star {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 1.25rem;
  display: block;
  animation: star-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.done-star .s {
  fill: var(--gold);
  stroke: var(--gold);
  stroke-width: 3;
  stroke-linejoin: round;
}

.done-star .tick {
  fill: none;
  stroke: var(--primary-dark);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.done-star.is-waiting .s {
  fill: var(--gold-tint);
}

@keyframes star-in {
  from {
    opacity: 0;
    transform: rotate(-45deg) scale(0.6);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.done h2 {
  margin: 0 0 0.75rem;
  color: var(--primary);
  font-family: var(--type-heading);
  font-size: var(--text-h3);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.done-lead {
  margin: 0 auto;
  max-width: 46ch;
  color: var(--muted);
}

.done-lead strong {
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.done-facts {
  margin: 1.75rem 0 0;
  padding: 0;
  text-align: left;
  border-top: 1px solid var(--border);
}

.done-facts div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.75rem 0.125rem;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}

.done-facts dt {
  flex: none;
  color: var(--muted);
}

.done-facts dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

/* With a visit date the facts are: date, tickets, total, order number. Date and total in the serif. */
.done-facts div:nth-last-child(4) dd,
.done-facts div:nth-last-child(4) ~ div:nth-last-child(2) dd {
  color: var(--primary);
  font-family: var(--type-accent);
  font-size: 1.3125rem;
  line-height: 1.25;
  font-variant-numeric: lining-nums tabular-nums;
}

.done-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

.done .fineprint {
  margin: 1.25rem auto 0;
}

/* ---------- site footer (website footer, simplified) ---------- */
.site-footer {
  background: var(--primary);
  color: var(--on-primary);
  --focus-ring: var(--on-primary);
}

.site-footer :focus-visible {
  outline-color: var(--on-primary);
}

.site-footer-band {
  height: 1.5rem;
  background-color: var(--primary-dark);
  border-bottom: 1px solid rgb(183 150 96 / 0.3);
  position: relative;
}

.site-footer-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: var(--pattern-khatam);
  background-size: 3.5rem 3.5rem;
  opacity: 0.3;
}

.site-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem 2.5rem;
  padding-top: 2.25rem;
  padding-bottom: 2.5rem;
}

.site-footer .wordmark {
  color: var(--on-primary);
  font-size: var(--text-accent-4);
}

.site-footer .wordmark img {
  width: 1.5rem;
  height: 1.5rem;
}

.site-footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
}

.site-footer-brand .site-footer-links {
  margin-top: 0.25rem;
}

.site-footer-links a,
.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  border-radius: var(--radius);
  color: var(--on-primary);
  font-size: var(--text-small);
  font-weight: 500;
  line-height: 1.4;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.foot {
  color: var(--on-primary-muted);
  font-size: var(--text-small);
  line-height: 1.6;
  display: grid;
  align-content: start;
}

.foot:empty {
  display: none;
}

.foot p {
  margin: 0;
}

/* ---------- mobile bar ---------- */
.mobilebar {
  display: none;
}

/* ---------- processing overlay ---------- */
.processing {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgb(245 239 230 / 0.9);
  backdrop-filter: blur(2px);
}

.processing-card {
  color: var(--primary);
  text-align: center;
  font-weight: 600;
}

.spin-star {
  width: 3.5rem;
  height: 3.5rem;
  fill: var(--gold);
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linejoin: round;
  animation: spin 1.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- ticket download page (rendered by the server) ---------- */
.dl-page {
  background: var(--background);
}

.dl {
  max-width: 42rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3.5rem;
}

.dl .site {
  margin: 0 0 1.25rem;
  color: var(--primary);
  font-family: var(--type-accent);
  font-size: var(--text-accent-4);
  font-weight: 600;
  line-height: 1.1;
}

.dl h1 {
  margin: 0;
  color: var(--primary);
  font-family: var(--type-heading);
  font-size: var(--text-h2);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.dl .lead {
  margin: 0.375rem 0 1.25rem;
  color: var(--muted);
}

.dl .card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 0.5rem 1.375rem;
}

.dl .meta {
  margin: 0.875rem 0 0.375rem;
  color: var(--muted);
  font-size: var(--text-small);
  line-height: 1.5;
}

.tklist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tk {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 0;
  border-top: 1px solid var(--border);
}

.tk div:first-child {
  display: grid;
  line-height: 1.4;
}

.tk span {
  color: var(--muted);
  font-size: var(--text-small);
}

.tk .act {
  display: flex;
  gap: 0.5rem;
}

.tk a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--primary);
  font-weight: 600;
  font-size: var(--text-small);
  text-decoration: none;
}

.tk a.btn-dl {
  background: var(--primary);
  color: var(--on-primary);
}

.tk a.btn-dl:hover {
  background: var(--primary-dark);
}

.tk a.btn-view {
  color: var(--primary);
}

.tk a.btn-view:hover {
  background: var(--hover);
}

.dl .note {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: var(--text-small);
  line-height: 1.6;
}

/* ---------- responsive (mobile first where it matters: phones get one column) ---------- */
@media (min-width: 40rem) {
  .wrap {
    padding-inline: 2rem;
  }

  .site-footer-grid {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  }
}

@media (max-width: 899px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    padding-bottom: 2rem;
  }

  .summary {
    display: none;
  }

  .inline-summary {
    display: block;
    margin-bottom: 1.125rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--background);
  }

  .inline-summary:empty {
    display: none;
  }

  .inline-summary .summary-date {
    font-size: 1.25rem;
    padding-bottom: 0.625rem;
  }

  .mobilebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.625rem 1rem calc(0.625rem + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 20px rgb(34 34 34 / 0.08);
  }

  .mobilebar .btn {
    flex: none;
    min-height: 3rem;
  }

  .mobilebar-text {
    display: grid;
    min-width: 0;
    line-height: 1.3;
  }

  .mobilebar-text strong {
    color: var(--primary);
    font-family: var(--type-accent);
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.1;
    font-variant-numeric: lining-nums tabular-nums;
  }

  .mobilebar-text span {
    color: var(--muted);
    font-size: var(--text-caption);
  }

  /* Room under the footer for the fixed bar, while the bar is shown. */
  body:has(#mobilebar:not([hidden])) .site-footer {
    padding-bottom: calc(4.5rem + env(safe-area-inset-bottom));
  }

  .done {
    padding: 1.25rem 1rem 3rem;
  }
}

@media (max-width: 640px) {
  .layout.wrap {
    padding-inline: 0.75rem;
  }

  .masthead-inner {
    display: block;
    padding-top: 1.5rem;
    padding-bottom: 1rem;
  }

  .hours {
    margin-top: 0.625rem;
    white-space: normal;
  }

  .step {
    padding: 1.375rem 1rem 1.5rem;
  }

  /* The calendar uses part of the side padding so every day stays a 44 px target;
     a wider transparent border keeps the visible tiles clear of the card edge. */
  .calendar {
    margin-inline: -0.75rem;
  }

  .day {
    border-width: 4px;
    border-radius: calc(var(--radius) + 4px);
  }

  .cal-head,
  .cal-legend,
  .cal-error {
    margin-inline: 0.75rem;
  }

  .ticket {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 0.75rem;
  }

  .ticket .stepper {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .ticket-price {
    grid-column: 1;
    font-size: 1.3125rem;
  }

  .done-card {
    padding: 2rem 1.125rem 1.5rem;
  }

  .done-actions .btn {
    width: 100%;
  }

  .tk {
    flex-wrap: wrap;
  }
}

/* Phones narrower than 360 px: the booking card runs edge to edge so day cells stay 44 px. */
@media (max-width: 359px) {
  .layout.wrap {
    padding-inline: 0;
  }

  .flow {
    border-inline: 0;
    border-radius: 0;
  }

  .stepper output {
    min-width: 1.75rem;
  }
}

/* Embedded in another site (iframe): the host page has its own header and footer. */
.embed body {
  background: transparent;
}

.embed .site-header,
.embed .masthead,
.embed .mobilebar,
.embed .site-footer {
  display: none !important;
}

.embed .page {
  min-height: 0;
}

.embed .layout {
  padding: 4px 2px 8px;
}

.embed .done {
  padding: 4px 2px 8px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
