/* =========================================================================
   Restaurant Website Templates — shared foundation
   Motion system, header, mobile menu, booking sheet, lightbox, utilities.
   Each template sets its own colours/fonts through CSS variables.
   ========================================================================= */

:root {
  --edge: clamp(20px, 5vw, 88px);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --header-h: 84px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
h1, h2, h3, h4 { text-wrap: balance; }
p { text-wrap: pretty; }
section[id] { scroll-margin-top: calc(var(--header-h) - 8px); }
:focus-visible { outline: 2px solid var(--focus, currentColor); outline-offset: 4px; border-radius: 3px; }
::selection { background: var(--select-bg, #222); color: var(--select-ink, #fff); }

.skip-link {
  position: fixed; left: 16px; top: -80px; z-index: 200;
  padding: 12px 18px; background: #fff; color: #111; border-radius: 8px;
  transition: top .3s var(--ease);
}
.skip-link:focus { top: 16px; }

.container {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-left: max(var(--edge), env(safe-area-inset-left, 0px));
  padding-right: max(var(--edge), env(safe-area-inset-right, 0px));
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Media frames (images that zoom / parallax) ---------- */
.media { position: relative; overflow: hidden; background: var(--media-bg, #0001); }
.media > img {
  width: 100%; height: 100%; object-fit: cover;
  transform: translate3d(0, var(--py, 0px), 0) scale(var(--s, 1.12));
  transition: transform 1.8s var(--ease);
  will-change: transform;
}
.media[data-parallax] > img { transition: none; }
.media.zoom:hover > img { --s: 1.17; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .7em;
  min-height: 54px; padding: 0 1.7em;
  border: 1px solid transparent; border-radius: var(--btn-radius, 999px);
  font-size: 13px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  white-space: nowrap; line-height: 1;
  transition: background-color .4s var(--ease), color .4s var(--ease), border-color .4s var(--ease), transform .4s var(--ease), box-shadow .4s var(--ease);
}
.btn .arr { display: inline-block; transition: transform .45s var(--ease); }
.btn:hover .arr { transform: translateX(5px); }
.btn:active { transform: scale(.97); }
.btn-solid { background: var(--btn-bg); color: var(--btn-ink); }
.btn-solid:hover { background: var(--btn-bg-hover, var(--btn-bg)); box-shadow: 0 12px 30px -12px var(--btn-shadow, #0006); }
.btn-line { border-color: currentColor; background: transparent; }
.btn-line:hover { background: var(--line-hover, #0000000d); }
.btn-sm { min-height: 44px; padding: 0 1.3em; font-size: 12px; }

.link-arrow {
  display: inline-flex; align-items: center; gap: .6em;
  font-size: 13px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  padding-bottom: 6px; background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
  transition: background-size .5s var(--ease);
}
.link-arrow:hover { background-size: 30% 1px; }

/* ---------- Header ---------- */
body::before { /* paints the phone's status-bar area */
  content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px);
  z-index: 81; background: var(--header-bg-solid, transparent);
}
.site-header {
  position: fixed; left: 0; right: 0; top: env(safe-area-inset-top, 0px); z-index: 80;
  transition: background-color .5s var(--ease), color .5s var(--ease), box-shadow .5s var(--ease), transform .6s var(--ease), backdrop-filter .5s;
}
.site-header.is-hidden { transform: translateY(-110%); }
.header-inner { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; gap: 24px; transition: height .5s var(--ease); }
.is-scrolled .header-inner { height: calc(var(--header-h) - 12px); }
.nav { display: flex; align-items: center; gap: clamp(20px, 2.6vw, 40px); }
.nav-link { position: relative; padding: 6px 0; }
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform .5s var(--ease);
}
.nav-link:hover::after, .nav-link.is-active::after { transform: scaleX(1); transform-origin: left; }
.header-actions { display: flex; align-items: center; gap: 14px; }

.burger {
  display: none; position: relative; width: 48px; height: 48px; flex: none;
  border-radius: 50%; border: 1px solid currentColor; background: transparent;
}
.burger span {
  position: absolute; left: 14px; right: 14px; height: 1.5px; background: currentColor;
  transition: transform .5s var(--ease), top .5s var(--ease);
}
.burger span:nth-child(1) { top: 19px; }
.burger span:nth-child(2) { top: 27px; }
.nav-open .burger span:nth-child(1) { top: 23px; transform: rotate(45deg); }
.nav-open .burger span:nth-child(2) { top: 23px; transform: rotate(-45deg); }

/* ---------- Mobile navigation overlay ---------- */
.mobile-nav {
  position: fixed; inset: 0; z-index: 79;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  padding: calc(var(--header-h) + 24px + env(safe-area-inset-top, 0px)) max(var(--edge), env(safe-area-inset-right, 0px)) calc(40px + env(safe-area-inset-bottom, 0px)) max(var(--edge), env(safe-area-inset-left, 0px));
  background: var(--mnav-bg, #111); color: var(--mnav-ink, #fff);
  clip-path: inset(0 0 100% 0); visibility: hidden;
  transition: clip-path .8s var(--ease), visibility 0s .8s;
}
.nav-open .mobile-nav { clip-path: inset(0); visibility: visible; transition: clip-path .8s var(--ease), visibility 0s 0s; }
.mobile-nav a.m-link {
  font-family: var(--font-display); font-size: clamp(38px, 11vw, 64px); line-height: 1.12;
  opacity: 0; transform: translateY(24px);
  transition: opacity .5s var(--ease), transform .7s var(--ease);
}
.nav-open .mobile-nav a.m-link { opacity: 1; transform: none; transition-delay: calc(.18s + var(--i, 0) * .06s); }
.mobile-nav .m-meta { margin-top: 36px; display: grid; gap: 6px; font-size: 14px; opacity: .75; }
.nav-open { overflow: hidden; }

/* ---------- Load + scroll reveal ---------- */
.js .load { opacity: 0; transform: translateY(28px); }
.is-loaded .load { opacity: 1; transform: none; transition: opacity 1.1s var(--ease) var(--d, 0s), transform 1.3s var(--ease) var(--d, 0s); }
.js .load-mask { clip-path: inset(100% 0 0 0); }
.is-loaded .load-mask { clip-path: inset(0 0 0 0); transition: clip-path 1.6s var(--ease) var(--d, 0s); }
.line { display: block; overflow: hidden; padding: 0 .06em .08em; margin: 0 -.06em -.08em; }
.line > span { display: inline-block; }
.js .line > span { transform: translateY(115%); }
.is-loaded .line > span { transform: none; transition: transform 1.4s var(--ease) var(--d, 0s); }

.js .reveal { opacity: 0; transform: translateY(36px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity 1.1s var(--ease) var(--d, 0s), transform 1.3s var(--ease) var(--d, 0s); }
.js .mask { clip-path: inset(0 0 100% 0); }
.js .mask > img { --s: 1.25; }
.js .mask.in { clip-path: inset(0 0 0 0); transition: clip-path 1.5s var(--ease) var(--d, 0s); }
.js .mask.in > img { --s: 1.08; }

/* ---------- Marquee ---------- */
.marquee { display: flex; overflow: hidden; white-space: nowrap; user-select: none; }
.marquee-track {
  display: flex; flex: none; align-items: center; gap: var(--mq-gap, 3rem); padding-right: var(--mq-gap, 3rem);
  animation: marquee var(--mq-speed, 38s) linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-100%); } }

/* ---------- Scroll progress ---------- */
.progress {
  position: fixed; left: 0; right: 0; top: 0; height: 2px; z-index: 90; pointer-events: none;
  background: var(--progress, currentColor); transform-origin: 0 50%; transform: scaleX(var(--p, 0));
}

/* ---------- Filters / chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--chip-line, currentColor); background: transparent; color: inherit;
  min-height: 42px; padding: 0 18px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  transition: background-color .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
}
.chip:hover { border-color: var(--chip-on-bg, currentColor); }
.chip.is-active { background: var(--chip-on-bg); color: var(--chip-on-ink); border-color: var(--chip-on-bg); }
.pop { animation: pop .7s var(--ease) both; animation-delay: var(--d, 0s); }
@keyframes pop { from { opacity: 0; transform: translateY(16px); } }

/* Swappable visuals tied to filters */
.swap { position: relative; }
.swap > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.06); transition: opacity .9s var(--ease), transform 1.4s var(--ease); }
.swap > img.is-shown { opacity: 1; transform: scale(1); }

/* ---------- Opening hours ---------- */
.hours { list-style: none; margin: 0; padding: 0; font-variant-numeric: tabular-nums; }
.hours li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--hours-line, #0002); }
.hours li.is-today { font-weight: 700; }
.hours li.is-today span:first-child::after { content: var(--today-label, " · heute"); font-weight: 500; opacity: .7; }

/* ---------- Horizontal strip gallery ---------- */
.strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: var(--strip-col, clamp(240px, 30vw, 440px)); gap: var(--strip-gap, 16px);
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; overscroll-behavior-x: contain;
  scrollbar-width: none; padding-bottom: 4px;
}
.strip::-webkit-scrollbar { display: none; }
.strip > * { scroll-snap-align: start; }
.shot { border: 0; padding: 0; background: none; display: block; width: 100%; cursor: zoom-in; }

/* ---------- Dialogs (booking + lightbox) ---------- */
dialog.sheet {
  border: 0; padding: 0; margin: auto;
  width: min(580px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; overscroll-behavior: contain;
  background: var(--dlg-bg, #fff); color: var(--dlg-ink, #1b1b1b);
  border-radius: var(--dlg-radius, 22px);
  box-shadow: 0 50px 120px -20px #0008;
}
dialog[open] { animation: dlg-in .65s var(--ease); }
dialog.is-closing { animation: dlg-out .3s var(--ease) forwards; }
dialog::backdrop { background: #0a0a0acc; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
dialog[open]::backdrop { animation: fade .5s var(--ease); }
dialog.is-closing::backdrop { animation: fade .3s reverse forwards; }
@keyframes dlg-in { from { opacity: 0; transform: translateY(30px) scale(.97); } }
@keyframes dlg-out { to { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes fade { from { opacity: 0; } }

.sheet-body { padding: clamp(24px, 5vw, 44px); display: grid; gap: 22px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.sheet-head h2 { font-family: var(--font-display); font-weight: var(--dlg-title-weight, 500); font-size: clamp(30px, 5vw, 42px); line-height: 1.05; margin: 6px 0 0; letter-spacing: -.02em; }
.sheet-kicker { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--dlg-accent); }
.x-btn {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  border: 1px solid var(--dlg-line, #0002); background: transparent; color: inherit;
  display: grid; place-items: center; font-size: 22px; line-height: 1;
  transition: transform .5s var(--ease), background-color .3s;
}
.x-btn:hover { transform: rotate(90deg); background: var(--dlg-soft, #0000000a); }

.booking-form { display: grid; gap: 20px; }
.booking-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.f-label, .booking-form legend { display: block; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 9px; padding: 0; opacity: .8; }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.f-input {
  width: 100%; height: 52px; padding: 0 16px;
  background: var(--dlg-field, #0000000a); border: 1px solid transparent; border-radius: var(--field-radius, 12px);
  transition: border-color .3s, background-color .3s, box-shadow .3s;
}
textarea.f-input { height: 88px; padding: 14px 16px; resize: vertical; }
.f-input:focus { outline: none; border-color: var(--dlg-accent); background: var(--dlg-bg, #fff); box-shadow: 0 0 0 4px var(--dlg-ring, #0000000f); }
.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slot { position: relative; }
.slot input { position: absolute; opacity: 0; inset: 0; pointer-events: none; }
.slot span {
  display: grid; place-items: center; min-width: 70px; height: 44px; padding: 0 14px;
  border: 1px solid var(--dlg-line, #0002); border-radius: 999px; font-size: 14px; font-variant-numeric: tabular-nums;
  cursor: pointer; transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.slot span:hover { border-color: var(--dlg-accent); }
.slot input:checked + span { background: var(--dlg-accent); border-color: var(--dlg-accent); color: var(--dlg-accent-ink, #fff); }
.slot input:focus-visible + span { outline: 2px solid var(--dlg-accent); outline-offset: 2px; }
.stepper { display: flex; align-items: center; height: 52px; border-radius: var(--field-radius, 12px); background: var(--dlg-field, #0000000a); }
.stepper button { width: 52px; height: 52px; border: 0; background: transparent; font-size: 22px; border-radius: inherit; }
.stepper button:hover { background: var(--dlg-soft, #0000000a); }
.stepper output { flex: 1; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.demo-note { font-size: 12px; line-height: 1.55; opacity: .7; margin: 0; padding-top: 14px; border-top: 1px solid var(--dlg-line, #0002); }
.booking-done { display: grid; gap: 16px; text-align: left; }
.booking-done .tick {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--dlg-accent); color: var(--dlg-accent-ink, #fff); font-size: 24px;
  animation: pop .8s var(--ease) both;
}
.booking-done h3 { font-family: var(--font-display); font-weight: 500; font-size: 32px; line-height: 1.1; margin: 0; }
.booking-done p { margin: 0; line-height: 1.7; }
.booking-done dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 22px; margin: 0; padding: 18px 0; border-block: 1px solid var(--dlg-line, #0002); font-variant-numeric: tabular-nums; }
.booking-done dt { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .6; padding-top: 3px; }
.booking-done dd { margin: 0; }

dialog.lightbox {
  border: 0; padding: 0; margin: auto; width: min(1100px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  background: transparent; color: #fff; overflow: visible;
}
.lightbox figure { margin: 0; display: grid; gap: 14px; }
.lightbox img { width: 100%; max-height: calc(100dvh - 140px); object-fit: contain; border-radius: 10px; background: #111; }
.lightbox figcaption { display: flex; justify-content: space-between; gap: 20px; font-size: 13px; opacity: .8; }
.lb-controls { display: flex; gap: 10px; position: absolute; top: -58px; right: 0; }
.lb-controls .x-btn { border-color: #fff5; color: #fff; }
@media (max-width: 600px) { .lb-controls { top: auto; bottom: -62px; } }

/* ---------- Template badge + mobile booking bar ---------- */
.tpl-badge {
  position: fixed; z-index: 70;
  left: max(16px, env(safe-area-inset-left, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px 7px 7px;
  border-radius: 999px; background: #121212e6; color: #fff; backdrop-filter: blur(12px);
  font: 500 12px/1 system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: .01em;
  box-shadow: 0 10px 30px -8px #0007; transition: transform .4s var(--ease), opacity .4s;
}
.tpl-badge b { background: #fff; color: #111; border-radius: 999px; padding: 7px 10px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.tpl-badge:hover { transform: translateY(-3px); }
.in-frame .tpl-badge, .in-frame .progress { display: none; }

.mobile-book {
  position: fixed; z-index: 69; display: none;
  left: max(12px, env(safe-area-inset-left, 0px)); right: max(12px, env(safe-area-inset-right, 0px)); bottom: max(12px, env(safe-area-inset-bottom, 0px));
  align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 22px;
  border-radius: 999px; background: var(--mb-bg, #111); color: var(--mb-ink, #fff);
  box-shadow: 0 20px 40px -12px #0008; transform: translateY(160%);
  transition: transform .7s var(--ease);
  font-size: 14px; font-weight: 600;
}
.show-book .mobile-book { transform: none; }

@media (max-width: 900px) {
  :root { --header-h: 72px; }
  .desktop-only { display: none !important; }
  .burger { display: block; }
  .mobile-book { display: flex; }
  .tpl-badge { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); padding-right: 7px; }
  .tpl-badge .t-long { display: none; }
  .f-row { grid-template-columns: 1fr; }
}
@media (min-width: 901px) { .mobile-nav { display: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .js .reveal, .js .load, .js .line > span { opacity: 1; transform: none; }
  .js .mask, .js .load-mask { clip-path: none; }
  .marquee-track { animation: none; }
}
