/* ==========================================================================
   app.css — ekrany aplikacji klienta
   ========================================================================== */

/* --- Ekran ładowania --- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: var(--bg);
  transition: opacity 0.35s ease;
}
.splash.is-hidden { opacity: 0; pointer-events: none; }
.splash-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--brand-soft);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Szkielet aplikacji --- */
.statusbar-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 45;
  height: var(--safe-top);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}

.view-root {
  max-width: var(--content-max);
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
}
.view-enter { animation: view-in 0.32s var(--ease-out) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: calc(var(--safe-top) + 20px) var(--gutter) 12px;
}
.page-header p { margin-top: 4px; font-size: 15px; }

/* --- Ekran błędu --- */
.fatal {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 100dvh;
  padding: 32px;
  text-align: center;
}
.fatal code { font-size: 13px; color: var(--text-muted); word-break: break-word; }
.fatal ul { display: grid; gap: 8px; margin-top: 8px; }
.fatal a { color: var(--brand); font-weight: 600; }

/* ==========================================================================
   MENU
   ========================================================================== */
.menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(var(--safe-top) + 18px) var(--gutter) 10px;
}
.menu-header .logo { width: 48px; height: 48px; border-radius: 50%; box-shadow: var(--shadow-sm); }
.menu-header p { font-size: 14px; color: var(--text-muted); }

/* Przyklejony pasek kategorii */
.cat-bar {
  position: sticky;
  top: var(--safe-top);
  z-index: 20;
  padding: 8px 0 10px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  transition: box-shadow 0.2s;
}
.cat-bar.is-stuck { box-shadow: 0 1px 0 var(--line); }
.cat-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 var(--gutter);
  scrollbar-width: none;
  scroll-behavior: smooth;
}
.cat-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  transition: background-color 0.25s, color 0.25s, border-color 0.25s, transform 0.15s var(--ease-out);
}
.chip:active { transform: scale(0.95); }
.chip.is-active { background: var(--text); border-color: var(--text); color: var(--surface); }

.menu-section { padding: 18px var(--gutter) 6px; scroll-margin-top: 70px; }
.menu-section > h2 { margin-bottom: 4px; }
.menu-section > .section-desc { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.menu-section > h2 + .dish-list { margin-top: 12px; }
.dish-list { display: grid; gap: 12px; }

/* Karta dania */
.dish {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.18s var(--ease-out), box-shadow 0.2s;
  content-visibility: auto;
  contain-intrinsic-size: auto 132px;
}
.dish:active { transform: scale(0.985); }
.dish-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dish-name { display: flex; align-items: baseline; gap: 6px; }
.dish-qty {
  flex: none;
  color: var(--brand);
  font-weight: 800;
  animation: bump 0.4s var(--ease-spring);
}
.dish-desc {
  margin-top: 4px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dish-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto; padding-top: 10px; }
.dish-price { font-weight: 700; margin-right: 4px; font-variant-numeric: tabular-nums; }
.dish-media { position: relative; flex: none; width: 108px; height: 108px; }
.dish-media .art {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: var(--art-bg);
}
.dish-media .art svg, .dish-media .art img { width: 100%; height: 100%; object-fit: cover; }
.dish-add {
  position: absolute;
  right: -6px;
  bottom: -6px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-contrast);
  border: 3px solid var(--surface);
  transition: transform 0.2s var(--ease-spring);
}
.dish-add svg { width: 18px; height: 18px; }
.dish-add:active { transform: scale(0.85); }
.dish.is-unavailable { cursor: default; }
.dish.is-unavailable .dish-media, .dish.is-unavailable .dish-name, .dish.is-unavailable .dish-desc { opacity: 0.45; filter: grayscale(0.8); }
.dish.is-unavailable:active { transform: none; }
.unavailable-label { font-size: 13px; font-weight: 600; color: var(--danger); }

/* Pływający pasek koszyka nad zakładkami */
.cart-fab {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px);
  z-index: 30;
  width: min(calc(100% - 2 * var(--gutter)), calc(var(--content-max) - 2 * var(--gutter)));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 8px 0 18px;
  border-radius: 18px;
  background: var(--brand);
  color: var(--brand-contrast);
  font-weight: 650;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--brand) 40%, transparent);
  transition: transform 0.35s var(--ease-spring), opacity 0.25s;
}
.cart-fab.is-hidden { transform: translate(-50%, 140%); opacity: 0; pointer-events: none; }
.cart-fab:active { transform: translateX(-50%) scale(0.98); }
.cart-fab-count {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--brand-contrast) 22%, transparent);
  font-size: 14px;
}
.cart-fab-label { flex: 1; }
.cart-fab-total {
  padding: 0 12px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: color-mix(in srgb, black 14%, transparent);
  font-variant-numeric: tabular-nums;
}
.has-fab { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 96px); }

/* ==========================================================================
   KARTA DANIA (panel wysuwany)
   ========================================================================== */
.dish-sheet-art {
  position: relative;
  height: 250px;
  background: var(--art-bg);
  display: grid;
  place-items: center;
  touch-action: none; /* przeciąganie w dół zamyka panel */
}
.dish-sheet-art svg { width: 230px; height: 230px; animation: art-pop 0.55s var(--ease-spring) both 0.08s; }
.dish-sheet-art img { width: 100%; height: 100%; object-fit: cover; }
@keyframes art-pop { from { transform: scale(0.85) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
.dish-sheet-body { padding: 20px var(--gutter) 8px; }
.dish-sheet-body h2 { font-size: 25px; }
.dish-sheet-body .dish-desc { -webkit-line-clamp: unset; font-size: 15px; margin-top: 6px; }
.dish-sheet-body .dish-meta { padding-top: 12px; }
.option-group { margin-top: 24px; }
.option-group-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.option-group-head span { font-size: 13px; color: var(--text-muted); }
.dish-sheet-footer { display: flex; gap: 12px; align-items: center; }
.dish-sheet-footer .btn { flex: 1; }
.price-pop { display: inline-block; animation: bump 0.35s var(--ease-spring); }

/* ==========================================================================
   KOSZYK
   ========================================================================== */
.pickup-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 var(--gutter) 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 14px;
}
.pickup-pill svg { width: 22px; height: 22px; color: var(--brand); flex: none; }
.pickup-pill strong { display: block; font-size: 15px; }

.cart-lines {
  margin: 0 var(--gutter);
  padding: 4px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.cart-line {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  transition: opacity 0.25s, transform 0.25s var(--ease-out);
}
.cart-line:last-child { border-bottom: 0; }
.cart-line.is-removing { opacity: 0; transform: translateX(-24px); }
.cart-line .art { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: var(--art-bg); }
.cart-line .art svg, .cart-line .art img { width: 100%; height: 100%; object-fit: cover; }
.cart-line-info { min-width: 0; }
.cart-line-top { display: flex; justify-content: space-between; gap: 8px; }
.cart-line-price { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cart-line-opts { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.cart-line-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.cart-line-unit { font-size: 13px; color: var(--text-faint); }
.cart-line .stepper { height: 34px; }
.cart-line .stepper button { width: 34px; height: 34px; }
.cart-line .stepper button svg { width: 16px; height: 16px; }
.cart-line.is-unavailable .cart-line-opts::after { content: " · niedostępne"; color: var(--danger); font-weight: 600; }

.upsell { margin-top: 26px; }
.upsell h2 { padding: 0 var(--gutter); font-size: 18px; margin-bottom: 10px; }

/* Pozioma lista małych kart dań (koszyk, ekran startowy) */
.h-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px var(--gutter) 8px;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 var(--gutter);
  scrollbar-width: none;
}
.h-scroll::-webkit-scrollbar { display: none; }
.mini-card {
  flex: none;
  width: 136px;
  padding: 10px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  scroll-snap-align: start;
  text-align: left;
  transition: transform 0.15s var(--ease-out);
}
.mini-card:active { transform: scale(0.96); }
.mini-card .art { width: 100%; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--art-bg); }
.mini-card .art svg, .mini-card .art img { width: 100%; height: 100%; object-fit: cover; }
.mini-name { font-size: 14px; font-weight: 600; margin-top: 8px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 35px; }
.mini-price { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 6px; font-size: 13.5px; font-weight: 700; }
.mini-add { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: var(--brand-contrast); }
.mini-add svg { width: 14px; height: 14px; }

.summary {
  margin: 22px var(--gutter) 0;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.summary-row { display: flex; justify-content: space-between; padding: 4px 0; font-variant-numeric: tabular-nums; }
.summary-row.total { margin-top: 6px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: 19px; font-weight: 800; }
.direct-note {
  display: flex;
  gap: 10px;
  margin: 16px var(--gutter) 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--accent-soft);
  font-size: 13.5px;
  line-height: 1.4;
}
.direct-note svg { flex: none; width: 20px; height: 20px; color: color-mix(in srgb, var(--accent) 60%, black); }

.checkout-bar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px);
  z-index: 30;
  width: min(calc(100% - 2 * var(--gutter)), calc(var(--content-max) - 2 * var(--gutter)));
  transform: translateX(-50%);
  animation: rise 0.4s var(--ease-spring) both;
}
@keyframes rise { from { transform: translate(-50%, 30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ==========================================================================
   START
   ========================================================================== */
.home { padding-top: calc(var(--safe-top) + 12px); }

.demo-clock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 var(--gutter) 10px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #fff4d6;
  color: #8a5a00;
  font-size: 12.5px;
  font-weight: 600;
}

/* Karta powitalna w kolorze marki */
.hero { padding: 0 var(--gutter); }
.hero-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 20px 58px;
  border-radius: 28px;
  background: linear-gradient(150deg, var(--brand) 0%, var(--brand-strong) 100%);
  color: var(--brand-contrast);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--brand) 32%, transparent);
}
.hero-deco { position: absolute; inset: 0; width: 100%; height: 100%; fill: currentColor; opacity: 0.07; pointer-events: none; }
.hero-logo {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 4px solid color-mix(in srgb, var(--brand-contrast) 28%, transparent);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  animation: art-pop 0.6s var(--ease-spring) both;
}
.hero-card h1 { position: relative; margin-top: 14px; font-size: 27px; }
.hero-tagline { position: relative; margin-top: 4px; font-size: 15px; opacity: 0.85; max-width: 290px; }

.status-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 7px 14px 7px 11px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand-contrast) 16%, transparent);
  font-size: 14px;
  font-weight: 650;
}
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #fbbf24; }
.status-pill.is-open .status-dot { background: #4ade80; animation: pulse 2s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}

/* Szybkie akcje — nachodzą na dół karty powitalnej */
.home-actions { position: relative; margin: -38px var(--gutter) 0; display: grid; gap: 10px; }
.order-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 14px 14px 14px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.15s var(--ease-out);
}
.order-cta:active { transform: scale(0.98); }
.order-cta > svg { color: var(--text-faint); }
.order-cta-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--brand);
  color: var(--brand-contrast);
}
.order-cta-text { flex: 1; display: flex; flex-direction: column; }
.order-cta-text strong { font-size: 17px; }
.order-cta-text span { font-size: 13.5px; color: var(--text-muted); }

.quick-actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; }
.quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 600;
  transition: transform 0.15s var(--ease-out);
}
.quick-btn:active { transform: scale(0.95); }
.quick-btn svg { width: 22px; height: 22px; color: var(--brand); }

.home-section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 var(--gutter); margin-bottom: 10px; }
.section-head h2 { font-size: 19px; }
.section-head a { font-size: 14px; font-weight: 600; color: var(--brand); }

/* Podpowiedź instalacji na ekranie początkowym */
.install-hint {
  position: relative;
  display: flex;
  gap: 12px;
  margin: 0 var(--gutter);
  padding: 14px 40px 14px 14px;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  border: 1.5px dashed color-mix(in srgb, var(--brand) 30%, transparent);
}
.install-hint img { flex: none; width: 46px; height: 46px; border-radius: 12px; }
.install-hint div { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; font-size: 13.5px; color: var(--text-muted); }
.install-hint strong { font-size: 15px; color: var(--text); }
.install-hint span svg { display: inline; vertical-align: -3px; color: #2f7de1; }
.install-hint .btn { margin-top: 6px; }
.install-close { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: var(--text-faint); }

/* Promocja dnia */
.promo-card {
  position: relative;
  display: block;
  width: calc(100% - 2 * var(--gutter));
  min-height: 196px;
  margin: 0 var(--gutter);
  padding: 18px;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--accent-soft) 0%, color-mix(in srgb, var(--accent) 30%, white) 100%);
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s var(--ease-out);
}
.promo-card:active { transform: scale(0.98); }
.promo-text { position: relative; z-index: 1; width: 56%; display: flex; flex-direction: column; align-items: flex-start; }
.promo-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--accent) 45%, black);
}
.promo-card h2 { margin-top: 6px; font-size: 20px; }
.promo-item { margin-top: 3px; font-size: 14px; font-weight: 600; }
.promo-desc { margin-top: 2px; font-size: 13px; color: var(--text-muted); line-height: 1.35; }
.promo-prices { display: flex; align-items: baseline; gap: 8px; margin-top: 10px; }
.promo-new { font-size: 24px; font-weight: 800; color: var(--brand); letter-spacing: -0.02em; }
.promo-prices s { font-size: 14px; color: var(--text-muted); }
.promo-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 12px;
  padding: 8px 10px 8px 14px;
  border-radius: 999px;
  background: var(--text);
  color: var(--surface);
  font-size: 14px;
  font-weight: 650;
}
.promo-art {
  position: absolute;
  right: -62px;
  top: 50%;
  width: 200px;
  height: 200px;
  margin-top: -100px;
  filter: drop-shadow(0 12px 18px rgba(70, 35, 10, 0.2));
}
.promo-art svg, .promo-art img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.promo-art.is-spinning svg { animation: spin 60s linear infinite; }
.promo-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-contrast);
  font-size: 15px;
  font-weight: 800;
  transform: rotate(12deg);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--brand) 35%, transparent);
}

/* Godziny i kontakt */
.info-card {
  margin: 0 var(--gutter);
  padding: 4px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.hours-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.hours-list li:last-child { border-bottom: 0; }
.hours-list li.is-today { font-weight: 700; color: var(--brand); }
.hours-list em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--brand-soft);
  vertical-align: 1px;
}
.contact-list a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}
.contact-list a:last-child { border-bottom: 0; }
.contact-list a > svg:first-child { flex: none; width: 22px; height: 22px; color: var(--brand); }
.contact-list a > svg:last-child { flex: none; color: var(--text-faint); }
.contact-list span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.contact-list strong { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.home-footnote {
  display: flex;
  gap: 8px;
  margin: 24px var(--gutter) 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}
.home-footnote svg { flex: none; color: var(--brand); margin-top: 1px; }
