/* pizza.risaro.la — solid tablecloth red, paper slips, receipt comanda */

:root {
  --tomato: #bc3220;
  --tomato-dark: #96271a;
  --basil: #2f6a3a;
  --char: #2b2118;
  --paper: #fffdf6;
  --paper-line: #e8ddc9;
  --cloth: #7e2617;
  --display: "Alfa Slab One", "Rockwell", serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; }

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--char);
  background-color: var(--cloth);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 27rem;
  margin: 0 auto;
  padding: 1rem 0.9rem 3rem;
}

/* --- masthead ----------------------------------------------------------- */

.masthead { text-align: center; margin-bottom: 1.1rem; }

.brand {
  display: inline-block;
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--tomato);
  background: var(--paper);
  text-decoration: none;
  padding: 0.35rem 0.8rem 0.3rem;
  border-radius: 0.4rem;
  box-shadow: 0 3px 0 rgba(43, 33, 24, 0.35);
  letter-spacing: 0.02em;
}

.brand-dot { opacity: 0.6; padding: 0 0.1em; }

.tricolore {
  width: 7rem;
  height: 4px;
  margin: 0.7rem auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg,
    var(--basil) 0 33.3%, #fff 33.3% 66.6%, var(--tomato) 66.6% 100%);
}

/* --- paper slips --------------------------------------------------------- */

.slip {
  background: var(--paper);
  border-radius: 0.6rem;
  padding: 1.1rem 1rem 1.2rem;
  box-shadow: 0 2px 10px rgba(43, 33, 24, 0.18);
}

.slip-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
  color: var(--char);
}

.stack { display: grid; gap: 0.8rem; }
.stack-lg { display: grid; gap: 1.1rem; }

.muted { color: #7a6d5f; font-size: 0.9rem; font-style: normal; }
.error { color: var(--tomato-dark); font-weight: 600; margin: 0.5rem 0; }

/* --- hero ---------------------------------------------------------------- */

.hero {
  text-align: center;
  background: var(--paper);
  border-radius: 0.6rem;
  padding: 1.4rem 1rem 1.2rem;
  box-shadow: 0 2px 10px rgba(43, 33, 24, 0.18);
}

.hero-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.6rem, 7vw, 2.2rem);
  line-height: 1.15;
  color: var(--tomato);
}

.hero-pizzeria { margin-top: 0.25rem; font-weight: 700; color: var(--tomato-dark); }
.hero-date { margin: 0.3rem 0 0.7rem; color: #7a6d5f; }

/* --- badges -------------------------------------------------------------- */

.badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.badge-open { background: #e4efe2; color: var(--basil); }
.badge-closed { background: #eee7dc; color: #7a6d5f; }

/* --- forms --------------------------------------------------------------- */

.field { display: grid; gap: 0.25rem; font-weight: 600; font-size: 0.92rem; }

input,
select {
  font: inherit;
  font-size: 1rem; /* never below 16px, or iOS Safari zooms the page when a field is focused */
  font-weight: 400;
  color: inherit; /* native iOS widgets tint select/date text blue otherwise */
  padding: 0.65rem 0.7rem;
  border: 2px solid var(--paper-line);
  border-radius: 0.5rem;
  background-color: #fff;
  min-height: 44px;
  width: 100%;
  /* iOS/WebKit native widgets (date, select) otherwise ignore width/min-height
     and overflow their container — not reproducible in Playwright's WebKit */
  appearance: none;
  -webkit-appearance: none;
}

input::-webkit-date-and-time-value {
  text-align: inherit; /* iOS centers the chosen date; align like text inputs */
}

select {
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' fill='none' stroke='%232b2118' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2.2rem;
}

input:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--basil);
  outline-offset: 2px;
}

.btn {
  font-family: var(--display);
  font-size: 1rem;
  color: #fff;
  background: var(--tomato);
  border: none;
  border-radius: 0.5rem;
  padding: 0.7rem 1rem;
  min-height: 48px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--tomato-dark);
  letter-spacing: 0.02em;
}

.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--tomato-dark); }
.btn-small { min-height: 44px; padding: 0.4rem 0.9rem; font-size: 0.9rem; }

.btn-ghost {
  font: inherit;
  font-weight: 600;
  color: var(--char);
  background: var(--paper);
  border: 2px solid var(--paper-line);
  border-radius: 0.5rem;
  padding: 0.55rem 0.9rem;
  min-height: 44px;
  cursor: pointer;
}

.btn-danger { color: var(--tomato-dark); border-color: #e8c5bd; }

.btn-x {
  font: inherit;
  color: #a08f7d;
  background: none;
  border: none;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  border-radius: 0.4rem;
}
.btn-x:hover { color: var(--tomato-dark); background: #f6ede1; }

/* --- lists --------------------------------------------------------------- */

.dinner-list, .order-list { list-style: none; padding: 0; }

.dinner-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.2rem;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px dashed var(--paper-line);
}

.dinner-list li:last-child .dinner-row { border-bottom: none; }
.dinner-row-main { display: grid; gap: 0.1rem; }
.dinner-row-side { display: grid; gap: 0.25rem; justify-items: end; }
.count { font-weight: 700; white-space: nowrap; }

.order-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.1rem;
  border-bottom: 1px dashed var(--paper-line);
}

.order-list li:last-child { border-bottom: none; }
.order-row[hidden] { display: none; }
.order-info { display: grid; gap: 0.05rem; }
.order-pizza { color: var(--tomato-dark); font-weight: 600; }
.order-ingredients { font-size: 0.85rem; color: #7a6d5f; }
.order-notes { font-size: 0.85rem; color: #7a6d5f; font-style: italic; }

.order-search { margin-bottom: 0.5rem; }

/* --- the comanda (receipt) ----------------------------------------------- */

.comanda {
  font-family: var(--mono);
  background: #fff;
  color: #33291f;
  padding: 1rem 1.1rem 1.1rem;
  margin: 0 0.8rem;
  box-shadow: 0 2px 10px rgba(43, 33, 24, 0.18);
  border-top: 2px dashed var(--char);
  border-bottom: 2px dashed var(--char);
  font-size: 0.95rem;
}

.comanda ul { list-style: none; padding: 0; }

.comanda-head {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  font-size: 0.8rem;
  margin-bottom: 0.7rem;
}

.comanda-line { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.15rem 0; }
.comanda-qty { font-weight: 700; min-width: 2ch; }
.comanda-dots { flex: 1; border-bottom: 2px dotted #b8ab99; }

.comanda-note {
  padding: 0 0 0.35rem 2.5ch;
  font-size: 0.85rem;
  font-style: italic;
  color: #6b5c48;
}

.comanda-total {
  margin-top: 0.7rem;
  padding-top: 0.5rem;
  border-top: 1px solid #b8ab99;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: right;
}

/* --- pizzeria menu -------------------------------------------------------- */

.menu-summary {
  cursor: pointer;
  margin-bottom: 0;
  border-radius: 0.4rem;
  list-style-position: outside;
}

.menu[open] .menu-summary { margin-bottom: 0.4rem; }

.menu-section { margin-top: 0.9rem; }

.menu-section-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tomato-dark);
  margin-bottom: 0.35rem;
}

.menu-list { list-style: none; padding: 0; }

.menu-item { padding: 0.3rem 0; }

.menu-item-head { display: flex; align-items: baseline; gap: 0.45rem; }
.menu-item-name { font-weight: 600; }
.menu-dots { flex: 1; border-bottom: 2px dotted var(--paper-line); }

.menu-item-price {
  font-family: var(--mono);
  font-size: 0.88rem;
  color: #55483a;
  white-space: nowrap;
}

.menu-item-ingredients { font-size: 0.85rem; color: #7a6d5f; }

.menu-source { margin-top: 0.9rem; font-size: 0.85rem; }
.menu-source a { color: var(--tomato-dark); font-weight: 600; }

/* --- misc ---------------------------------------------------------------- */

.crumbs a { color: rgba(255, 253, 246, 0.9); font-weight: 700; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.share-row { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.share-url { font-family: var(--mono); color: #55483a; min-width: 0; }

.danger-zone { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }
.signout { text-align: center; }

.closed-note {
  text-align: center;
  background: var(--paper);
  border-radius: 0.6rem;
  padding: 1rem;
  box-shadow: 0 2px 10px rgba(43, 33, 24, 0.18);
  font-weight: 600;
}

.footer {
  text-align: center;
  margin-top: 2rem;
  color: rgba(255, 253, 246, 0.75);
  font-size: 0.85rem;
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
