/* ─────────────────────────────────────────────────────────────
   foodys: design system
   Μοτίβο: το πιάτο από πάνω (κύκλος με χείλος).
   Geologica για το interface. Piazzolla για ό,τι τρώγεται.
   ───────────────────────────────────────────────────────────── */

@font-face { font-family: 'Geologica'; src: url('/assets/fonts/geologica.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Piazzolla'; src: url('/assets/fonts/piazzolla.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Piazzolla'; src: url('/assets/fonts/piazzolla-italic.woff2') format('woff2'); font-weight: 100 900; font-style: italic; font-display: swap; }

:root {
  /* Παλέτα */
  --melitzana: #2B1630;      /* μελιτζανί: κείμενο, σκούρες επιφάνειες */
  --melitzana-2: #452A4B;
  --krokos: #F2A900;         /* κρόκος Κοζάνης: η υπογραφή του foodys, προσοχή */
  --krokos-soft: #FFF1CC;
  --asvestis: #F4F2F6;       /* φόντο: ψυχρό, με μια ιδέα μελιτζανί */
  --alati: #FFFFFF;
  --vasilikos: #2F7D4F;      /* έτοιμο, σωστό */
  --vasilikos-soft: #E0F0E5;
  --ntomata: #D2361E;        /* σφάλμα, ακύρωση */
  --ntomata-soft: #FBE3DE;
  --line: #E4DEE8;
  --muted: #6E5F73;

  --ink: var(--melitzana);
  --bg: var(--asvestis);
  --surface: var(--alati);
  --accent: var(--melitzana);  /* στη βιτρίνα: το χρώμα του brand */
  --accent-ink: #FFFFFF;

  --sans: 'Geologica', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Piazzolla', Georgia, 'Times New Roman', serif;

  /* Κλίμακα 1.25 */
  --t-xs: .8125rem; --t-s: .9375rem; --t-m: 1.0625rem; --t-l: 1.3125rem; --t-xl: 1.75rem; --t-2xl: 2.5rem; --t-3xl: clamp(2.75rem, 11vw, 5.5rem);

  --r-s: 10px; --r-m: 16px; --r-l: 28px; --round: 999px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: var(--t-m); line-height: 1.5;
  font-variation-settings: 'CRSV' 1;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; line-height: 1.08; font-weight: 800; letter-spacing: -0.025em; }
p { margin: 0 0 .75em; }
img { max-width: 100%; display: block; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1.5px; }
button { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hidden, [hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dish { font-family: var(--serif); font-variation-settings: 'opsz' 24; letter-spacing: 0; }

:focus-visible { outline: 3px solid var(--krokos); outline-offset: 2px; border-radius: 4px; }

/* ── Λογότυπο: τα «oo» είναι δύο πιάτα ── */
.wordmark { display: inline-flex; align-items: baseline; font-weight: 800; letter-spacing: -0.04em; text-decoration: none; color: inherit; line-height: 1; }
.wordmark .plates { display: inline-flex; gap: .04em; margin: 0 .03em; transform: translateY(.02em); }
.wordmark .plates i { width: .52em; height: .52em; border-radius: 50%; background: var(--krokos); box-shadow: inset 0 0 0 .085em currentColor; }

/* ── Κουμπιά ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 52px; padding: 0 1.4em; border-radius: var(--round);
  border: 0; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line);
  font-weight: 650; font-size: var(--t-m); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .1s var(--ease), background-color .15s, box-shadow .15s;
}
.btn:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ink { background: var(--melitzana); color: #fff; box-shadow: none; }
.btn.saffron { background: var(--krokos); color: var(--melitzana); box-shadow: none; }
.btn.danger { color: var(--ntomata); box-shadow: inset 0 0 0 1.5px var(--ntomata-soft); }
.btn.quiet { box-shadow: none; background: transparent; }
.btn.block { width: 100%; }
.btn.sm { min-height: 40px; padding: 0 1em; font-size: var(--t-s); }
.btn.busy { pointer-events: none; opacity: .65; }
.link { background: none; border: 0; padding: 0; cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: .2em; }

/* ── Φόρμες ── */
label, .field { display: block; margin-bottom: 1.1rem; }
label > span, .field > span { display: block; font-size: var(--t-s); font-weight: 600; margin-bottom: .4rem; }
input:not([type]), input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=search], select, textarea {
  width: 100%; min-height: 52px; padding: .75rem 1rem; font: inherit; color: var(--ink);
  background: var(--surface); border: 0; border-radius: var(--r-s); box-shadow: inset 0 0 0 1.5px var(--line);
  transition: box-shadow .15s;
}
textarea { min-height: 92px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--ink); }
::placeholder { color: #A497A8; }
[aria-invalid=true] { box-shadow: inset 0 0 0 2px var(--ntomata) !important; }
.field-error { color: var(--ntomata); font-size: var(--t-s); font-weight: 550; margin: .35rem 0 0; }
.row { display: flex; gap: .75rem; }
.row > * { flex: 1; min-width: 0; }

/* Radio/checkbox ως πιάτο: χείλος, και γέμισμα όταν επιλεγεί */
.plate-input { appearance: none; -webkit-appearance: none; flex: none; width: 26px; height: 26px; margin: 0; border-radius: 50%;
  background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); cursor: pointer; transition: box-shadow .15s var(--ease); }
.plate-input:checked { box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 0 6px var(--surface), inset 0 0 0 13px var(--accent); }
.plate-input[type=checkbox] { border-radius: 8px; }
.plate-input[type=checkbox]:checked { box-shadow: none; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/18px no-repeat; }
.plate-input:disabled { opacity: .35; cursor: not-allowed; }

.check { display: flex; align-items: center; gap: .8rem; min-height: 48px; margin: 0; cursor: pointer; }
.check > span { margin: 0; font-size: var(--t-m); font-weight: 500; }

/* Διακόπτης */
.switch { position: relative; display: inline-block; width: 54px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: var(--round); background: #CFC6D3; transition: background .2s; }
.switch i::after { content: ''; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.switch input:checked + i { background: var(--vasilikos); }
.switch input:checked + i::after { transform: translateX(22px); }
.switch input:focus-visible + i { outline: 3px solid var(--krokos); outline-offset: 2px; }

/* ── Sheet: από κάτω στο κινητό, στο κέντρο στη μεγάλη οθόνη ── */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(43, 22, 48, .5); opacity: 0; transition: opacity .2s; }
.sheet {
  position: relative; width: 100%; max-height: 94dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: var(--r-l) var(--r-l) 0 0;
  padding: 1.5rem 1.25rem calc(1.5rem + var(--safe-b));
  transform: translateY(100%); transition: transform .28s var(--ease);
}
.sheet::before { content: ''; position: sticky; top: -1.1rem; display: block; width: 44px; height: 5px; margin: -1rem auto .9rem; border-radius: 9px; background: var(--line); }
.sheet:focus { outline: none; }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: none; }
.sheet-close {
  position: absolute; top: 1rem; right: 1rem; z-index: 3; width: 42px; height: 42px; border: 0; border-radius: 50%;
  background: var(--asvestis); cursor: pointer; display: grid; place-items: center;
}
.sheet-close::before, .sheet-close::after { content: ''; position: absolute; width: 16px; height: 2px; border-radius: 2px; background: var(--ink); transform: rotate(45deg); }
.sheet-close::after { transform: rotate(-45deg); }
.sheet-body > h2:first-child, .sheet-body > .sheet-title { padding-right: 52px; font-size: var(--t-xl); }
@media (min-width: 760px) {
  .sheet-wrap { align-items: center; padding: 2rem; }
  .sheet { max-width: 540px; border-radius: var(--r-l); max-height: 88vh; padding: 2rem; transform: translateY(16px) scale(.98); opacity: 0; transition: transform .25s var(--ease), opacity .2s; }
  .sheet::before { display: none; }
  .sheet.wide { max-width: 780px; }
  .sheet-wrap.open .sheet { opacity: 1; }
}

/* ── Toast ── */
.toast {
  position: fixed; left: 50%; bottom: calc(1.25rem + var(--safe-b)); z-index: 90; transform: translate(-50%, 160%);
  max-width: min(92vw, 460px); padding: .9rem 1.25rem; border-radius: var(--round);
  background: var(--melitzana); color: #fff; font-weight: 550; transition: transform .25s var(--ease); pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); }
.toast.error { background: var(--ntomata); }
.toast.ok { background: var(--vasilikos); }

.tag { display: inline-flex; align-items: center; gap: .4em; padding: .2em .7em; border-radius: var(--round); font-size: var(--t-xs); font-weight: 650; background: var(--asvestis); white-space: nowrap; }
.tag.ok { background: var(--vasilikos-soft); color: var(--vasilikos); }
.tag.warn { background: var(--krokos-soft); color: #6B4A00; }
.tag.danger { background: var(--ntomata-soft); color: var(--ntomata); }
.tag.dot::before { content: ''; width: .55em; height: .55em; border-radius: 50%; background: currentColor; }

.empty { text-align: center; padding: 3.5rem 1rem; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation: none !important; }
}
