/* SOLID — component system (shared by customer / courier / admin) */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-5);
  border: var(--border); border-radius: var(--r-md);
  background: var(--white); color: var(--ink);
  font-weight: 800; font-size: var(--fs-md);
  box-shadow: var(--sh-hard-sm);
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), color var(--t-fast);
}
.btn:hover { transform: translate(-1px,-1px); box-shadow: 3px 3px 0 var(--ink); }
.btn:active { transform: translate(2px,2px); box-shadow: 0 0 0 var(--ink); }
.btn--primary { background: var(--red); color: var(--white); border-color: var(--ink); }
.btn--dark { background: var(--ink); color: var(--bone); }
.btn--bone { background: var(--bone); color: var(--ink); border-color: var(--ink); }
.btn--ghost { background: transparent; box-shadow: none; }
.btn--ghost:hover { background: rgba(22,18,15,.06); box-shadow: none; transform: none; }
.btn--quiet { border-color: var(--line); box-shadow: none; font-weight: 700; }
.btn--sm { min-height: 44px; padding: 0 var(--s-3); font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn--lg { min-height: 54px; font-size: var(--fs-lg); border-radius: var(--r-md); }
.btn--block { display: flex; width: 100%; }
.btn--icon { padding: 0; width: 44px; min-height: 44px; }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: .45; pointer-events: none; box-shadow: none;
}
.btn svg { width: 18px; height: 18px; }

.iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; min-width: 44px; min-height: 44px; border-radius: var(--r-md);
  border: 2px solid transparent; color: var(--ink);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.iconbtn:hover { background: rgba(22,18,15,.07); }

/* ---------- Badges & Status pills ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; font-size: var(--fs-2xs); font-weight: 800;
  border-radius: var(--r-sm); background: var(--ink); color: var(--bone);
  letter-spacing: .01em; white-space: nowrap;
}
.badge--red { background: var(--red); color: var(--white); }
.badge--mustard { background: var(--mustard); color: var(--ink); }
.badge--leaf { background: var(--leaf-wash); color: var(--leaf); box-shadow: inset 0 0 0 1px var(--leaf); }
.badge--paper { background: var(--paper-2); color: var(--ink-3); }
.badge--outline { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.badge svg { width: 12px; height: 12px; }

/* diagonal "stamped" ribbon used on featured products */
.stamp {
  position: absolute; inset-inline-start: 10px; top: 10px; z-index: 2;
  transform: rotate(-3deg);
  background: var(--red); color: var(--white);
  font-family: var(--font-display); font-size: var(--fs-xs);
  padding: 3px 10px; border: 2px solid var(--ink);
  box-shadow: var(--sh-hard-sm);
}

.status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: 800; padding: 3px 10px;
  border-radius: var(--r-full); background: var(--paper-2); color: var(--ink-3);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status[data-s="new"]        { background: var(--sky-wash);     color: var(--st-new); }
.status[data-s="preparing"]  { background: var(--mustard-wash); color: var(--mustard-deep); }
.status[data-s="ready"]      { background: var(--leaf-wash);    color: var(--st-ready); }
.status[data-s="delivering"] { background: var(--ember-wash);   color: var(--ember-deep); }
.status[data-s="delivered"]  { background: var(--paper-2);      color: var(--st-done); }
.status[data-s="cancelled"]  { background: var(--red-wash);     color: var(--st-cancel); }

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-hard);
  position: relative;
}
.card--flat { box-shadow: none; border-color: var(--line); border-width: 1px; }
.card--paper { background: var(--bone); }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; height: 38px; padding: 0 var(--s-4);
  border: var(--border); border-radius: var(--r-full);
  background: var(--bone); font-weight: 800; font-size: var(--fs-sm);
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.chip[aria-pressed="true"], .chip.is-active { background: var(--red); color: var(--white); }
.chip:hover { transform: translateY(-1px); }
.chip svg { width: 16px; height: 16px; }

/* ---------- Price ---------- */
.price { font-family: var(--font-display); font-size: var(--fs-xl); color: var(--red); line-height: 1; }
.price small { font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 700; color: var(--ink-3); margin-inline-start: 3px; }
.price--ink { color: var(--ink); }
.price--lg { font-size: var(--fs-3xl); }

/* ---------- Quantity selector ---------- */
.qty { display: inline-flex; align-items: center; border: var(--border); border-radius: var(--r-full); background: var(--bone); overflow: hidden; }
.qty button { width: 44px; height: 44px; min-width: 44px; min-height: 44px; display: grid; place-items: center; transition: background var(--t-fast); }
.qty button:hover { background: var(--paper-2); }
.qty button svg { width: 16px; height: 16px; }
.qty output { min-width: 30px; text-align: center; font-weight: 900; font-family: var(--font-display); font-size: var(--fs-lg); }

/* ---------- Food art (illustrated placeholder, never fake photography) ---------- */
.food {
  position: relative; overflow: hidden;
  background: var(--paper-2);
  border-bottom: var(--border);
  display: grid; place-items: center;
}
.food svg { width: 100%; height: 100%; }
.food__note {
  position: absolute; inset-inline-end: 8px; bottom: 8px;
  font-size: var(--fs-2xs); font-weight: 700; color: var(--ink-3);
  background: rgba(253,250,243,.85); padding: 1px 7px; border-radius: var(--r-sm);
}

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: var(--s-4); }
.field > .label { display: block; font-size: var(--fs-sm); font-weight: 800; margin-bottom: 6px; }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 10px var(--s-4);
  background: var(--bone); border: 2px solid var(--line); border-radius: var(--r-md);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); background: var(--white); outline: none; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: left 18px top 50%, left 13px top 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.hint { font-size: var(--fs-xs); color: var(--muted); margin-top: 4px; }

.opt {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4); border: 2px solid var(--line);
  border-radius: var(--r-md); background: var(--bone); cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.opt:hover { border-color: var(--ink-3); }
.opt input { accent-color: var(--red); width: 18px; height: 18px; }
.opt.is-on { border-color: var(--ink); background: var(--white); box-shadow: var(--sh-hard-sm); }
.opt__title { font-weight: 800; }

.switch { position: relative; width: 46px; height: 26px; border-radius: 99px; background: var(--line); border: 2px solid var(--ink); transition: background var(--t-fast); flex: 0 0 auto; }
.switch::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--bone); border: 2px solid var(--ink); transition: transform var(--t-fast); }
.switch[aria-checked="true"] { background: var(--leaf); }
.switch[aria-checked="true"]::after { transform: translateX(-20px); }
[dir="ltr"] .switch[aria-checked="true"]::after { transform: translateX(20px); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: var(--s-1); border-bottom: 2px solid var(--line); }
.tab {
  padding: var(--s-3) var(--s-4); font-weight: 800; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -2px; transition: color var(--t-fast), border-color var(--t-fast);
}
.tab.is-active { color: var(--ink); border-color: var(--red); }

/* ---------- Sheet / Modal / Toast ---------- */
.scrim {
  position: fixed; inset: 0; background: rgba(14,12,11,.55);
  z-index: var(--z-sheet); opacity: 0; transition: opacity var(--t-med);
  backdrop-filter: blur(1.5px);
}
.scrim.is-open { opacity: 1; }

.sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: var(--z-sheet);
  max-height: 92vh; overflow-y: auto;
  background: var(--bone);
  border: 2px solid var(--ink);
  border-bottom: none;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--sh-sheet);
  transform: translateY(100%);
  transition: transform var(--t-slow);
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet.is-open { transform: translateY(0); }
.sheet__grip { width: 54px; height: 5px; border-radius: 99px; background: var(--line); margin: 10px auto 0; }
@media (min-width: 720px) {
  .sheet { inset-inline-start: 50%; inset-inline-end: auto; transform: translate(50%, 100%); width: min(520px, 94vw); }
  .sheet.is-open { transform: translate(50%, 0); }
}

.modal {
  position: fixed; z-index: var(--z-modal); top: 50%; inset-inline-start: 50%;
  transform: translate(50%, -46%) scale(.98);
  width: min(720px, 94vw); max-height: 88vh; overflow-y: auto;
  background: var(--bone); border: 3px solid var(--ink); border-radius: var(--r-lg);
  box-shadow: var(--sh-lift); opacity: 0; pointer-events: none;
  transition: opacity var(--t-med), transform var(--t-med);
}
.modal.is-open { opacity: 1; pointer-events: auto; transform: translate(50%, -50%) scale(1); }
.modal__head, .sheet__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-4) var(--s-5); border-bottom: 2px solid var(--line);
  position: sticky; top: 0; background: var(--bone); z-index: 2;
}
.modal__body, .sheet__body { padding: var(--s-5); }
.modal__foot, .sheet__foot {
  position: sticky; bottom: 0; background: var(--bone);
  border-top: 2px solid var(--line); padding: var(--s-4) var(--s-5);
  display: flex; gap: var(--s-3);
}

.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-end: 0; z-index: var(--z-modal);
  width: min(520px, 96vw); background: var(--bone); border-inline-start: 2px solid var(--ink);
  transform: translateX(-100%); transition: transform var(--t-slow); overflow-y: auto;
}
[dir="rtl"] .drawer { transform: translateX(-100%); }
.drawer.is-open { transform: translateX(0) !important; }

.toastwrap {
  position: fixed; z-index: var(--z-toast); bottom: calc(var(--bottomnav-h) + 16px);
  inset-inline: 0; display: flex; flex-direction: column; align-items: center; gap: var(--s-2);
  pointer-events: none; padding: 0 var(--s-4);
}
.toast {
  display: flex; align-items: center; gap: var(--s-3);
  background: var(--ink); color: var(--bone);
  border-radius: var(--r-md); padding: var(--s-3) var(--s-4);
  font-weight: 700; font-size: var(--fs-sm);
  box-shadow: var(--sh-lift); max-width: 420px;
  animation: toast-in var(--t-med) both;
}
.toast--ok { background: var(--leaf); }
.toast--warn { background: var(--mustard); color: var(--ink); }
.toast--err { background: var(--red); }
.toast svg { width: 18px; height: 18px; flex: 0 0 auto; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px); } }

/* ---------- States ---------- */
.state {
  display: grid; place-items: center; text-align: center;
  gap: var(--s-3); padding: var(--s-9) var(--s-5);
}
.state__art {
  width: 108px; height: 108px; display: grid; place-items: center;
  border: 3px dashed var(--line); border-radius: 50%; color: var(--ink-3);
  background: var(--bone);
}
.state__art svg { width: 44px; height: 44px; }
.state h3 { font-size: var(--fs-xl); }
.state p { color: var(--muted); max-width: 42ch; }

.skel { background: linear-gradient(90deg, var(--paper-2) 25%, var(--bone) 37%, var(--paper-2) 63%); background-size: 400% 100%; animation: shimmer 1.3s infinite linear; border-radius: var(--r-sm); }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.skel--line { height: 12px; margin-bottom: 8px; }
.skel--card { height: 168px; border-radius: var(--r-lg); }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; border: 2px solid var(--line); border-radius: var(--r-md); background: var(--white); }
table.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tbl th {
  text-align: start; font-size: var(--fs-xs); font-weight: 800; color: var(--ink-3);
  padding: var(--s-3) var(--s-4); background: var(--paper); border-bottom: 2px solid var(--line);
  position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
.tbl td { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:hover { background: var(--bone); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { font-size: var(--fs-md); }

/* ---------- Progress / timeline ---------- */
.timeline { position: relative; padding-inline-start: 26px; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-step { position: relative; padding-bottom: var(--s-5); }
.tl-step::before {
  content: ""; position: absolute; inset-inline-start: -25px; top: 5px;
  width: 16px; height: 16px; border-radius: 50%; background: var(--bone); border: 3px solid var(--line);
}
.tl-step.is-done::before { background: var(--leaf); border-color: var(--leaf); }
.tl-step.is-now::before { background: var(--red); border-color: var(--red); box-shadow: 0 0 0 5px var(--red-wash); }
.tl-step h4 { font-size: var(--fs-md); }
.tl-step.is-todo h4 { color: var(--muted); }

/* ---------- Ratings ---------- */
.stars { display: inline-flex; gap: 2px; color: var(--mustard); }
.stars svg { width: 16px; height: 16px; }
.stars--input svg { width: 30px; height: 30px; }
.stars--input button { transition: transform var(--t-fast); }
.stars--input button:hover { transform: scale(1.12); }
.star-off { color: var(--line); }

/* ---------- Brush divider ---------- */
.brush { display: block; width: 100%; height: 14px; color: var(--red); }

/* ---------- Brand mark ---------- */
.logo { display: inline-flex; align-items: center; gap: 9px; }
.logo__mark {
  display: grid; place-items: center;
  width: calc(var(--logo) * 1.7); height: calc(var(--logo) * 1.7);
  background: var(--red); color: var(--white); border: 2px solid var(--ink);
  font-family: var(--font-display); font-size: var(--logo);
  border-radius: var(--r-sm); transform: rotate(-4deg); box-shadow: var(--sh-hard-sm);
}
.logo__txt { display: flex; flex-direction: column; line-height: 1; }
.logo__txt b { font-family: var(--font-display); font-size: var(--logo); letter-spacing: .03em; font-weight: 400; }
.logo__txt i { font-style: normal; font-size: calc(var(--logo) * .42); font-weight: 700; color: var(--muted); letter-spacing: .08em; }

/* ---------- Product cards (shared) ---------- */
.pcard { display: flex; flex-direction: column; overflow: hidden; }
.pcard__art { display: block; width: 100%; padding: 0; border: 0; background: var(--paper-2); position: relative; }
.pcard__art svg { display: block; }
.pcard__body { padding: var(--s-3) var(--s-4) var(--s-4); display: flex; flex-direction: column; gap: 6px; }
.pcard__ar { font-size: var(--fs-md); font-weight: 900; }
.pcard__en { letter-spacing: .04em; }
.pcard__foot { margin-top: auto; padding-top: var(--s-2); flex-wrap: wrap; row-gap: 6px; }
.pcard__foot > *:last-child { margin-inline-start: auto; }
.pcard.is-out .pcard__art { filter: grayscale(1) contrast(.9); opacity: .65; }
.outflag {
  position: absolute; inset-inline-start: 50%; top: 50%; transform: translate(50%,-50%) rotate(-6deg);
  background: var(--ink); color: var(--bone); font-weight: 800; font-size: var(--fs-xs);
  padding: 4px 12px; border-radius: var(--r-sm);
}
.flags { display: flex; gap: 5px; flex-wrap: wrap; }
.pricepair { display: flex; align-items: baseline; gap: var(--s-2); }
.pricepair__alt { font-size: var(--fs-xs); font-weight: 800; color: var(--ink-3); background: var(--paper-2); padding: 2px 7px; border-radius: var(--r-sm); white-space: nowrap; }
.ing { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: var(--fs-xs); }
.ing li { position: relative; padding-inline-start: 9px; }
.ing li::before { content: ""; position: absolute; inset-inline-start: 0; top: 9px; width: 4px; height: 4px; border-radius: 50%; background: var(--red); }

.favbtn {
  position: absolute; inset-inline-end: 8px; top: 8px; z-index: 2;
  width: 44px; height: 44px; min-width: 44px; min-height: 44px; display: grid; place-items: center;
  background: rgba(253,250,243,.92); border: 2px solid var(--ink); border-radius: 50%;
  color: var(--ink); transition: transform var(--t-fast), color var(--t-fast);
}
.favbtn:hover { transform: scale(1.08); }
.favbtn.is-on { color: var(--red); }
.favbtn svg { width: 17px; height: 17px; }

.pcard--grid .pcard__art { height: 132px; }
.pcard--hero .pcard__art { height: 190px; }
.pcard--compact .pcard__art { height: 96px; }
.pcard--bundle .pcard__art { height: 150px; }
.pcard--row {
  display: grid; grid-template-columns: 86px 1fr auto; align-items: center; gap: var(--s-3);
  background: var(--white); border: 2px solid var(--line); border-radius: var(--r-md); padding: var(--s-2);
}
.pcard--row .pcard__art { height: 72px; width: 86px; border-radius: var(--r-sm); border: 0; overflow: hidden; }
.pcard--row .pcard__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--s-3); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px,1fr)); gap: var(--s-4); }
.skel-list { display: grid; gap: var(--s-3); }

.favbtn--static { position: static; flex: 0 0 auto; }
