/* booking page, sign-in sheet and "My bookings" */
.book__grid { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 1024px) { .book__grid { grid-template-columns: minmax(0, 1fr) 380px; gap: 2.5rem; } .book__summary { position: sticky; top: 108px; } }
.book__main { display: grid; gap: 1.5rem; min-width: 0; }

.book-step { margin: 0; padding: clamp(1.25rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--white); min-width: 0; }
.book-step__title { display: flex; align-items: center; gap: 0.75rem; margin: 0 0 1.25rem; padding: 0; font-size: 1.2rem; font-weight: 700; line-height: 1.4; color: var(--ink); }
.book-step__n { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--mist); color: var(--teal); font-size: 0.95rem; flex-shrink: 0; }
fieldset.book-step > legend.book-step__title { float: inline-start; width: 100%; }
fieldset.book-step > legend + * { clear: both; }
.book-hint { margin: 0; color: var(--ink-soft); }

.book-group + .book-group { margin-block-start: 1.5rem; padding-block-start: 1.5rem; border-block-start: 1px solid var(--line); }
.book-group__title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 1rem; margin: 0 0 0.75rem; }
.book-group__title strong { font-size: 1.05rem; }
.book-group__title span { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--ink-soft); font-size: 0.92rem; }
.book-group__title .icon { width: 16px; height: 16px; color: var(--peach); }
.book-group__opts { display: grid; gap: 0.6rem; }
@media (min-width: 640px) { .book-group__opts { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }

.opt { position: relative; display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; min-height: 56px; padding: 0.85rem 1rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--paper); cursor: pointer; transition: border-color 150ms ease, background-color 150ms ease; }
.opt__input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt__body { display: grid; gap: 0.15rem; }
.opt__name { font-weight: 600; line-height: 1.45; }
.opt__note, .opt__unavailable { font-size: 0.85rem; line-height: 1.5; color: var(--ink-soft); }
.opt__price .riyal { width: 1em; height: 1em; flex-shrink: 0; }
.opt__price { display: inline-flex; align-items: center; gap: 0.2rem; font-weight: 700; color: var(--teal); white-space: nowrap; }
.opt:has(.opt__input:checked) { border-color: var(--teal); background: var(--mist); box-shadow: inset 0 0 0 1px var(--teal); }
.opt:has(.opt__input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--teal) 40%, transparent); outline-offset: 2px; }
.opt[data-disabled] { opacity: 0.55; cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) { .opt:not([data-disabled]):hover { border-color: color-mix(in srgb, var(--teal) 55%, transparent); } }

.book-month { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-block-end: 0.75rem; }
.book-month__label { margin: 0; font-weight: 700; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--white); color: var(--ink); cursor: pointer; }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
[data-month-prev] .icon { transform: rotate(180deg); }

.book-days { display: flex; gap: 0.5rem; overflow-x: auto; padding-block: 0.25rem 0.75rem; scroll-snap-type: x proximity; overscroll-behavior-x: contain; scrollbar-width: thin; }
.day { flex: 0 0 auto; display: grid; justify-items: center; gap: 0.1rem; min-width: 64px; min-height: 68px; padding: 0.55rem 0.5rem; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--white); color: var(--ink); font: inherit; cursor: pointer; scroll-snap-align: start; }
.day__wd { font-size: 0.82rem; color: var(--ink-soft); }
.day__n { font-size: 1.2rem; font-weight: 700; line-height: 1.2; }
.day[aria-pressed="true"] { border-color: var(--teal); background: var(--teal); color: var(--white); }
.day[aria-pressed="true"] .day__wd { color: rgb(255 255 255 / 0.85); }

.book-times { display: grid; gap: 1rem; margin-block-start: 0.5rem; }
.times__label { margin: 0 0 0.5rem; font-size: 0.9rem; font-weight: 600; color: var(--ink-soft); }
.times__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 0.5rem; }
.time { min-height: 48px; padding: 0.5rem; border: 1.5px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.time[aria-pressed="true"] { border-color: var(--teal); background: var(--teal); color: var(--white); }
@media (hover: hover) and (pointer: fine) { .day:not([aria-pressed="true"]):hover, .time:not([aria-pressed="true"]):hover { border-color: var(--teal); } }
.day:active, .time:active { transform: scale(0.97); }
.day, .time { transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out); }

.book-state { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; padding: 1rem; border-radius: var(--r-sm); background: var(--paper); color: var(--ink-soft); }
.book-state p { margin: 0; }
.book-state--warn { background: var(--peach-soft); color: var(--ink); }
.book-state[hidden] { display: none; }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

.book-card { padding: clamp(1.25rem, 3vw, 1.75rem); border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow); }
.book-card__title { margin: 0 0 1rem; font-size: 1.15rem; }
.book-card__list { margin: 0; display: grid; gap: 0.7rem; }
.book-card__list > div { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.97rem; }
.book-card__list dt { color: var(--ink-soft); flex-shrink: 0; }
.book-card__list dd { margin: 0; text-align: end; font-weight: 600; }
.book-card__total { padding-block-start: 0.8rem; border-block-start: 1px solid var(--line); }
.book-card__total dd { display: inline-flex; align-items: center; gap: 0.2rem; font-size: 1.25rem; color: var(--teal); }
.book-card__cta { margin-block-start: 1.25rem; }
.book-card__mini { display: none; }
.book-card__note { margin: 0.75rem 0 0; font-size: 0.85rem; line-height: 1.6; color: var(--ink-soft); }
.book-card__existing { margin-block-start: 1rem; padding: 0.9rem 1rem; border-radius: var(--r-sm); background: var(--peach-soft); font-size: 0.9rem; }
.book-card__existing-title { margin: 0; font-weight: 700; }
.book-card__existing-text { margin: 0.2rem 0 0.5rem; }
.book-card__existing ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.book-card__existing li { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; }
.book-card__existing li > span:first-child { flex: 1 1 auto; }
.book-help { margin: 1rem 0 0; font-size: 0.92rem; color: var(--ink-soft); text-align: center; }
.btn--block { width: 100%; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.field__error { margin: 0.5rem 0 0; color: #a3341f; font-size: 0.9rem; }
.field__error:empty { display: none; }
.text-btn { min-height: 44px; padding: 0 0.25rem; border: 0; background: none; color: var(--teal); font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.text-btn:disabled { color: var(--ink-soft); text-decoration: none; cursor: default; }

/* on phones the confirm button sits above the page's bottom bar */
@media (max-width: 1023px) {
  .book .book-card__cta { position: sticky; bottom: calc(var(--bar-h) + 0.5rem); z-index: 5; padding: 0.75rem; margin-inline: -0.75rem; border-radius: var(--r-md); background: color-mix(in srgb, var(--white) 96%, transparent); backdrop-filter: blur(8px); }
  .book .book-card__mini:not(:empty) { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; justify-content: center; margin: 0 0 0.5rem; font-size: 0.9rem; font-weight: 600; }
  html:has(.book) .mobile-bar { display: none; }
  html:has(.book) body { --bar-h: env(safe-area-inset-bottom); }
}

/* sheet (reference/sheets.md) */
.sheet { position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 100%; max-height: calc(100vh - 1.5rem); max-height: calc(100dvh - 1.5rem); padding: 0; display: none; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-block-end: 0; border-radius: 2rem 2rem 0 0; background: var(--white); color: inherit; box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); translate: 0 100%; transition: translate 500ms var(--ease-drawer), overlay 500ms allow-discrete, display 500ms allow-discrete; }
.sheet[open] { display: flex; translate: 0 0; }
@starting-style { .sheet[open] { translate: 0 100%; } }
.sheet::backdrop { background: rgb(24 61 66 / 0.28); }
.sheet__header { flex-shrink: 0; padding: 28px 20px 12px; touch-action: none; }
.sheet__header h2 { margin: 0; font-size: 1.3rem; }
.sheet__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 20px 20px; }
.sheet__body:last-child { padding-block-end: max(1rem, env(safe-area-inset-bottom)); }
.sheet__close { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 1; }
.sheet--form { max-height: min(92dvh, 100svh); }
@media (min-width: 48rem) {
  .sheet { inset: 0; margin: auto; width: calc(100% - 3rem); max-width: 45rem; max-height: calc(100dvh - 3rem); border-block-end: 1px solid var(--line); border-radius: 2rem; translate: none; opacity: 1; scale: 1; transition: opacity 150ms ease, scale 150ms ease, overlay 150ms allow-discrete, display 150ms allow-discrete; }
  .sheet:not([open]) { opacity: 0; scale: 0.95; }
  @starting-style { .sheet[open] { opacity: 0; scale: 0.95; } }
  .sheet--compact { max-width: 30rem; }
  .sheet--form { max-height: calc(100dvh - 3rem); }
  .sheet__header { padding: 44px 40px 16px; }
  .sheet__body { padding-inline: 40px; padding-block-end: 36px; }
}
html:has(.sheet[open]) { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .sheet { transition-duration: 0.01ms; } }

.signin__lead { margin: 0.35rem 0 0; color: var(--ink-soft); font-size: 0.97rem; }
.signin__form { display: grid; gap: 0.6rem; }
.signin__form[hidden] { display: none; }
.signin__form .btn { margin-block-start: 0.5rem; }
.signin__row { display: flex; justify-content: space-between; gap: 1rem; }
.field__label { font-weight: 600; font-size: 0.95rem; }
.field__input { width: 100%; min-height: 56px; padding: 0 1rem; border: 1px solid #c9d5d2; border-radius: 16px; background: var(--white); color: var(--ink); font: inherit; font-size: 16px; }
.field__input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 25%, transparent); }
.field__input--code { font-size: 1.5rem; letter-spacing: 0.6em; text-align: center; }
.signin { --rk-phone-border: #c9d5d2; --rk-phone-ring: var(--teal); --rk-phone-radius: 16px; }
.rk-phone__input { font-size: 16px !important; }

/* header account link */
.account-link { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 44px; min-width: 44px; justify-content: center; padding-inline: 0.6rem; border-radius: 999px; color: var(--ink); font-weight: 600; font-size: 0.95rem; text-decoration: none; }
.account-link__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (min-width: 1200px) { .account-link__text { position: static; width: auto; height: auto; overflow: visible; clip-path: none; } }
@media (hover: hover) and (pointer: fine) { .account-link:hover { background: var(--mist); } }
.account-link[aria-current="page"] { color: var(--teal); }

/* my bookings */
.account { max-width: 820px; }
.account__signedout, .account__empty { display: grid; justify-items: start; gap: 1rem; padding: 1.5rem; border-radius: var(--r-lg); background: var(--white); border: 1px solid var(--line); }
.account__signedout p, .account__empty p { margin: 0; }
.account__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-block-end: 1rem; }
.account__hello { margin: 0; font-weight: 700; font-size: 1.1rem; }
.orders { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.order { padding: 1.1rem 1.25rem; border-radius: var(--r-md); background: var(--white); border: 1px solid var(--line); }
.order__when { font-weight: 700; }
.order__lines { list-style: none; margin: 0.35rem 0 0.75rem; padding: 0; color: var(--ink-soft); }
.order__lines li { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; }
.order__time { font-size: 0.88rem; }
.order__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; padding-block-start: 0.6rem; border-block-start: 1px solid var(--line); font-size: 0.93rem; }
.order__pay { padding: 0.1rem 0.7rem; border-radius: 999px; background: var(--mist); color: var(--teal); font-weight: 600; }
.order__foot strong { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 0.2rem; }
.signin__form > * { min-width: 0; }
.signin .rk-phone__input { min-width: 0; width: 100%; flex: 1 1 auto; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { min-height: 44px; padding: 0.4rem 1rem; border: 1.5px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease; }
.chip[aria-pressed="true"] { border-color: var(--teal); background: var(--teal); color: var(--white); }
.book-who { margin-block-end: 1rem; }
.book-who[hidden] { display: none; }
