/* Keep the original brand, typography and full-width layouts. */
:root {
  color-scheme: only light;
  --radius-control: 12px;
  --radius-image: 16px;
  --radius-panel: 20px;
  --ease-soft: cubic-bezier(.22, 1, .36, 1);
}

/* Product names need room for descenders and dietary labels when they wrap. */
.product-detail h2,
.product-card h3,
.cart-line h3 {
  line-height: 1.3;
  letter-spacing: normal;
  text-wrap: pretty;
  overflow-wrap: anywhere;
}

.button,
button.primary {
  border-radius: 999px;
  transition: background-color 180ms ease, border-color 180ms ease,
    color 180ms ease, box-shadow 220ms ease, transform 220ms var(--ease-soft);
}

.button:disabled:hover,
button.primary:disabled:hover {
  background: var(--purple);
}

.button.outline:disabled:hover {
  background: transparent;
}

.round-add {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  transition: background-color 180ms ease, border-color 180ms ease,
    color 180ms ease, transform 220ms var(--ease-soft);
}

.icon-button {
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  transition: background-color 180ms ease;
}

.product-image,
.cart-line img {
  border-radius: var(--radius-image);
}

.product-image {
  transition: box-shadow 220ms ease;
}

.product-image img {
  transition: transform 450ms var(--ease-soft);
}

.product-image .image-label,
.badge,
#toast {
  border-radius: 999px;
}

.summary-box,
.order-group,
.email-preview,
.guest-count-editor {
  border-radius: var(--radius-panel);
}

.plan-option,
.note,
.notice {
  border-radius: var(--radius-control);
}

input:not([type=radio]):not([type=checkbox]),
select,
textarea {
  background-color: #fff;
  color: var(--ink);
  border-radius: var(--radius-control);
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

textarea {
  font: inherit;
  resize: vertical;
}

input:not([type=radio]):not([type=checkbox]):focus,
select:focus,
textarea:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 4px #64516810;
}

textarea:focus-visible {
  outline: 3px solid #82668b;
  outline-offset: 4px;
}

.site-header nav a,
.header-right > .desktop-link {
  position: relative;
}

.site-header nav a::after,
.header-right > .desktop-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  border-radius: 2px;
  background: var(--purple);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 220ms var(--ease-soft);
}

.site-header nav a:focus-visible::after,
.header-right > .desktop-link:focus-visible::after {
  transform: scaleX(1);
}

dialog {
  border-radius: var(--radius-panel);
  box-shadow: 0 24px 80px #25272230;
}

.dialog-close {
  box-shadow: 0 2px 12px #25272214;
}

#toast {
  box-shadow: 0 8px 30px #25272224;
}

/* Hover treatments are limited to devices with a precise pointer. */
@media (hover: hover) and (pointer: fine) {
  .button:hover:not(:disabled),
  button.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px #25272218;
  }

  .button.white:hover {
    background: var(--cream);
    border-color: var(--cream);
    color: var(--ink);
  }

  .round-add:hover:not(:disabled) {
    background: var(--purple);
    border-color: var(--purple);
    color: white;
    transform: translateY(-2px);
  }

  .icon-button:hover {
    background: var(--sage);
  }

  .product-image:hover {
    box-shadow: 0 8px 24px #25272214;
  }

  .site-header nav a:hover::after,
  .header-right > .desktop-link:hover::after {
    transform: scaleX(1);
  }
}

.button:active:not(:disabled),
button.primary:active:not(:disabled),
.round-add:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: none;
}

.preview-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.motion-controls {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-left: 12px;
}

.motion-controls button {
  border: 1px solid #bfc5b9;
  border-radius: 999px;
  padding: 5px 10px;
  min-height: 32px;
  background: #ffffffa8;
  color: var(--purple);
  font-size: var(--text-small);
  font-weight: 600;
  letter-spacing: 0;
}

.motion-controls button:hover { background: white; }
.motion-controls button[aria-pressed=true] { background: var(--purple); color: white; }
/* The animations switch is one small control at the foot of the page, not a bar across the top. */
.site-footer .motion-controls { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: flex-end; }
.site-footer .motion-controls button { min-height: 44px; border: 0; padding: 0 var(--space-2); background: none; color: inherit; font-weight: 400; text-decoration: underline; text-underline-offset: 4px; }
.site-footer .motion-controls button:hover, .site-footer .motion-controls button[aria-pressed=true] { background: none; color: inherit; }
.hero { overflow: hidden; }

/* The local toggle may explicitly enable motion even on a reduced-motion device. */
html[data-motion=on] .motion-intro .hero-copy > *,
html[data-motion=on] .motion-intro .page-heading > * {
  animation: welcome-in 900ms var(--ease-soft) backwards;
}

html[data-motion=on] .motion-intro .hero-copy > :nth-child(2),
html[data-motion=on] .motion-intro .page-heading > :nth-child(2) { animation-delay: 140ms; }
html[data-motion=on] .motion-intro .hero-copy > :nth-child(3),
html[data-motion=on] .motion-intro .page-heading > :nth-child(3) { animation-delay: 280ms; }
html[data-motion=on] .motion-intro .hero-copy > :nth-child(4) { animation-delay: 420ms; }

html[data-motion=on] .motion-intro .hero > img {
  animation: hero-settle 1800ms var(--ease-soft) backwards;
}

html[data-motion=on] dialog[open] {
  animation: welcome-in 360ms var(--ease-soft);
}

html[data-motion=on] dialog[open]::backdrop {
  animation: backdrop-in 300ms ease;
}

@media (max-width: 720px) {
  html[data-motion=on] .site-header nav.open {
    animation: welcome-in 300ms var(--ease-soft);
  }
  .motion-controls { margin-left: 0; }
}

@keyframes welcome-in {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes hero-settle {
  from { transform: scale(1.06); }
  to { transform: scale(1); }
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Device preference is the default; pausing also cancels JavaScript reveals. */
html[data-motion=off] *,
html[data-motion=off] *::before,
html[data-motion=off] *::after {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}

html[data-motion=off] .button,
html[data-motion=off] button.primary,
html[data-motion=off] .round-add,
html[data-motion=off] .product-image img {
  transform: none !important;
}

/* Customer browsing polish. Keep content visible and preserve the readable type scale. */
#main .menu-tools {
  border: 1px solid var(--line);
  box-shadow: 0 3px 12px #25272204;
}

#main .menu-tools :is(input, select) { border-color: #c7c9bf; }
#main .menu-tools :is(input, select):focus-visible { border-color: var(--purple); }
#main .menu-availability { padding-block: 6px; }
#main .menu-availability:has(input:checked) { color: var(--purple); font-weight: 600; }
#main .menu-availability:has(input:focus-visible) { outline: var(--focus-ring); outline-offset: 4px; border-radius: 4px; }
#main .menu-results-bar { padding-block: 4px; }
#main .menu-results-bar p { color: var(--ink); font-variant-numeric: tabular-nums; }

#main .product-card {
  display: flex;
  flex-direction: column;
  padding: 12px;
  background: var(--surface, #fff);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius-image) + 12px);
  box-shadow: 0 3px 12px #25272204;
}

#main .product-card h3 { margin: 18px 4px 12px; }
#main .product-card .card-bottom { margin-top: auto; padding: 0 4px 4px; }
#main .product-card .price { min-width: 0; color: var(--ink); font-size: var(--text-control); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.5; }
#main .product-card .round-add { border-color: var(--purple); }
#main .product-card .round-add:active:not(:disabled) { background: var(--purple); color: white; }
#main .product-card .round-add:disabled { border-color: var(--line); opacity: .6; cursor: not-allowed; }
#main .product-card:focus-within { border-color: var(--purple); box-shadow: 0 0 0 2px #64516820; }
#main .product-card :is(.product-image, h3 button, .round-add):focus-visible { outline: var(--focus-ring); outline-offset: 4px; }
#main .product-card h3 button:focus-visible { border-radius: 4px; text-decoration: underline; text-underline-offset: .2em; }
#main .product-card .product-image img { height: auto; transform: none; }

#main .menu-empty {
  border-radius: var(--radius-panel);
  border: 1px solid var(--line);
  border-top: 4px solid var(--purple);
  padding: 40px 24px;
}
#main .menu-empty h2 { text-wrap: balance; }
#main .menu-empty p { line-height: 1.65; }
#main .loading { max-width: 44rem; margin-inline: auto; line-height: 1.65; color: var(--ink); }
#main .loading::before { content: ''; display: block; width: 40px; height: 4px; margin: 0 auto 20px; border-radius: 999px; background: var(--purple); }

@media (hover: hover) and (pointer: fine) {
  #main .product-card:hover { border-color: #aaa29f; box-shadow: 0 8px 24px #2527220d; }
  #main .product-card:focus-within:hover { border-color: var(--purple); box-shadow: 0 0 0 2px #64516820; }
  #main .product-card h3 button:hover { color: var(--purple); text-decoration: underline; text-underline-offset: .2em; }
}

/* A dish answers the pointer: its photo grows a little inside its frame and the card lifts slightly.
   Only where a pointer can hover, so a tap on a phone never leaves a card enlarged; keyboard focus inside
   the card does the same. Off when the device asks for reduced motion or the site's Animations switch is off. */
#main .product-card .product-image { border-radius: var(--radius-image); }
@media (prefers-reduced-motion: no-preference) and (hover: hover) and (pointer: fine) {
  html:not([data-motion=off]) #main .product-card { transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease; }
  html:not([data-motion=off]) #main .product-card .product-image img { transition: transform 200ms ease; }
  html:not([data-motion=off]) #main .product-card:is(:hover, :focus-within) { transform: translateY(-2px); }
  html:not([data-motion=off]) #main .product-card:hover { box-shadow: 0 10px 28px #25272214; }
  html:not([data-motion=off]) #main .product-card:is(:hover, :focus-within) .product-image img { transform: scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  #main .product-card, #main .product-card .product-image img { transition: none; transform: none; }
}

/* Saving a dish sits on its photo, so the card spends no row on it. */
#main .product-card { position: relative; }
#main .product-card .favorite-toggle { position: absolute; top: 20px; right: 20px; z-index: 1; margin: 0; box-shadow: 0 2px 8px #25272218; }
@media (max-width: 520px) {
  #main .product-card .favorite-toggle { top: 12px; right: 12px; width: 44px; padding: 0; gap: 0; justify-content: center; font-size: 0; }
}

@media (max-width: 520px) {
  #main .product-card { padding: 8px; border-radius: calc(var(--radius-image) + 8px); }
  #main .product-card h3 { margin: 14px 2px 12px; }
  #main .product-card .card-bottom { padding: 0 2px 2px; gap: 6px; }
  #main .menu-empty { padding: 32px 20px; }
}

@media (max-width: 360px) {
  #main .grid:has(> .product-card) { grid-template-columns: minmax(0, 1fr); }
}

@media (forced-colors: active) {
  #main .product-card:focus-within { border-color: Highlight; }
  #main .product-card :is(.product-image, h3 button, .round-add):focus-visible,
  #main .menu-availability:has(input:focus-visible) { outline-color: Highlight; }
}
