/* Teff Gebeya — shared styles for the shop and the admin panel */

:root {
  --paper: #fbf6ee;
  --paper-2: #f4ece0;
  --card: #ffffff;
  --ink: #2a1d14;
  --ink-2: #6a5646;
  --ink-3: #97836f;
  --line: #e6d9c8;
  --line-2: #d8c7b1;

  --green: #1e6b4f;
  --green-dark: #16523c;
  --green-soft: #e6f1ec;
  --gold: #d99a17;
  --gold-soft: #fdf0d6;
  --red: #b8322c;
  --red-soft: #fbeae9;
  --berbere: #c2410c;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(42, 29, 20, .06), 0 2px 8px rgba(42, 29, 20, .05);
  --shadow-md: 0 4px 12px rgba(42, 29, 20, .09), 0 12px 32px rgba(42, 29, 20, .08);
  --shadow-lg: 0 18px 50px rgba(42, 29, 20, .22);

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --ethiopic: "Noto Sans Ethiopic", "Nyala", var(--sans);
}

* { box-sizing: border-box; }

/* Any author rule that sets `display` beats the browser's [hidden] rule, and
   .field/.btn/.pill all do. Without this, hiding an element by setting
   `el.hidden = true` silently does nothing. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: -.01em; }

a { color: inherit; }

img { max-width: 100%; display: block; }

button, input, select, textarea { font: inherit; color: inherit; }

.amh { font-family: var(--ethiopic); }

.wrap { width: min(1180px, 100% - 2.5rem); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 1px solid transparent; border-radius: 999px;
  padding: .6rem 1.15rem; font-size: .93rem; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.btn-primary { background: var(--green); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--green-dark); }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: var(--paper-2); border-color: var(--ink-3); }
.btn-gold { background: var(--gold); color: #3a2708; }
.btn-gold:hover { filter: brightness(1.05); }
.btn-danger { background: transparent; border-color: var(--line-2); color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn-sm { padding: .38rem .8rem; font-size: .82rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ------------------------------------------------------------- fields */

.field { display: block; margin-bottom: .9rem; }
.field > span { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-2); margin-bottom: .3rem; }
.field > span .hint { font-weight: 400; color: var(--ink-3); }

.input, .select, .textarea {
  width: 100%; padding: .62rem .8rem;
  border: 1px solid var(--line-2); border-radius: 10px;
  background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(30, 107, 79, .14);
}
.textarea { min-height: 84px; resize: vertical; }
.row { display: grid; gap: 0 .9rem; grid-template-columns: 1fr 1fr; }

/* ------------------------------------------------------------- header */

.announce {
  background: var(--green); color: #fff;
  font-size: .82rem; text-align: center; padding: .48rem 1rem;
  letter-spacing: .01em;
}
.announce b { color: var(--gold); font-weight: 600; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(251, 246, 238, .93);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 1.1rem; padding: .8rem 0; }

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; margin-right: auto; }
/* The logo mark stands on its own — no coloured tile behind it. */
.brand-mark {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }

.login-logo {
  display: block; width: 100%; max-width: 260px;
  margin: 0 auto 1.2rem; height: auto;
}
.brand-name { font-family: var(--serif); font-size: 1.3rem; font-weight: 600; line-height: 1.05; }
.brand-sub { font-family: var(--ethiopic); font-size: .74rem; color: var(--ink-2); letter-spacing: .04em; }

.search {
  position: relative; flex: 1 1 260px; max-width: 340px;
}
.search input {
  width: 100%; padding: .55rem .9rem .55rem 2.3rem;
  border: 1px solid var(--line-2); border-radius: 999px; background: #fff;
}
.search input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(30,107,79,.14); }
.search svg { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--ink-3); }

.cart-btn { position: relative; }
.cart-count {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px;
  padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff;
  font-size: .7rem; font-weight: 700; display: grid; place-items: center;
}
.cart-count[hidden] { display: none; }

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

.hero { padding: 3.2rem 0 2.2rem; position: relative; overflow: hidden; }
.hero::after {
  content: ""; position: absolute; inset: auto -10% -60% 55%; height: 420px;
  background: radial-gradient(ellipse at center, rgba(217,154,23,.16), transparent 65%);
  pointer-events: none;
}
.hero-grid { display: grid; gap: 2.5rem; align-items: center; max-width: 62ch; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); }
.hero h1 .amh { display: block; font-size: .42em; color: var(--green); letter-spacing: .06em; margin-bottom: .5rem; }
.hero p { color: var(--ink-2); font-size: 1.02rem; max-width: 46ch; margin: 1rem 0 1.6rem; }
.hero-actions { display: flex; gap: .7rem; flex-wrap: wrap; }

.ribbon { display: flex; height: 4px; border-radius: 999px; overflow: hidden; margin-bottom: 1.1rem; width: 84px; }
.ribbon i { flex: 1; }
.ribbon i:nth-child(1) { background: var(--green); }
.ribbon i:nth-child(2) { background: var(--gold); }
.ribbon i:nth-child(3) { background: var(--red); }

/* ------------------------------------------------------------- catalog */

.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin: 1.6rem 0 1rem;
}
.section-head h2 { font-size: 1.5rem; }
.section-head p { margin: .25rem 0 0; color: var(--ink-2); font-size: .9rem; }

.chips { display: flex; gap: .5rem; overflow-x: auto; padding: .3rem 0 .8rem; scrollbar-width: thin; }
.chip {
  border: 1px solid var(--line-2); background: #fff; color: var(--ink-2);
  border-radius: 999px; padding: .42rem .95rem; font-size: .85rem; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: all .15s;
}
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.grid {
  display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
  padding-bottom: 2rem;
}

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-2); }

.card-media {
  position: relative; aspect-ratio: 4 / 3; background: var(--paper-2);
  display: grid; place-items: center; overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media .glyph {
  font-family: var(--serif); font-size: 2.6rem; color: rgba(42, 29, 20, .28);
  user-select: none;
}
.card-media.sold-out img, .card-media.sold-out .glyph { opacity: .45; filter: grayscale(.6); }

.badge {
  position: absolute; top: .6rem; left: .6rem;
  font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: .25rem .55rem; border-radius: 6px; background: var(--gold); color: #3a2708;
}
.badge.low { background: var(--red-soft); color: var(--red); border: 1px solid rgba(184,50,44,.25); }
.badge.out { background: var(--ink); color: var(--paper); }

.card-body { padding: .85rem .95rem 1rem; display: flex; flex-direction: column; flex: 1; gap: .15rem; }
.card-body h3 { font-size: 1.02rem; font-family: var(--sans); font-weight: 650; letter-spacing: -.005em; }
.card-body .amh { font-size: .82rem; color: var(--green); }
.card-body .desc {
  font-size: .82rem; color: var(--ink-2); margin: .4rem 0 .7rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.price { font-weight: 700; font-size: 1.05rem; }
.price small { display: block; font-weight: 400; font-size: .74rem; color: var(--ink-3); }

.stepper { display: flex; align-items: center; gap: .1rem; border: 1px solid var(--line-2); border-radius: 999px; }
.stepper button {
  width: 30px; height: 30px; border: 0; background: transparent; cursor: pointer;
  border-radius: 999px; font-size: 1.1rem; line-height: 1; color: var(--ink-2);
}
.stepper button:hover { background: var(--paper-2); color: var(--ink); }
.stepper span { min-width: 20px; text-align: center; font-weight: 650; font-size: .9rem; }

.empty { text-align: center; padding: 3rem 1rem; color: var(--ink-2); }

/* ------------------------------------------------------------- cart */

.scrim {
  position: fixed; inset: 0; background: rgba(42, 29, 20, .42);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 50;
  backdrop-filter: blur(2px);
}
.scrim.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%);
  background: var(--paper); z-index: 60; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s cubic-bezier(.4, 0, .2, 1);
  box-shadow: var(--shadow-lg);
}
.drawer.open { transform: none; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.2rem; border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 1.2rem; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 999px; border: 1px solid transparent;
  background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--ink-2);
}
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }

.drawer-body { flex: 1; overflow-y: auto; padding: 1rem 1.2rem; }
.drawer-foot { border-top: 1px solid var(--line); padding: 1.1rem 1.2rem 1.3rem; background: var(--card); }

.line-item { display: flex; gap: .8rem; padding: .8rem 0; border-bottom: 1px dashed var(--line-2); }
.line-item:last-child { border-bottom: 0; }
.line-thumb {
  width: 54px; height: 54px; flex: none; border-radius: 10px; background: var(--paper-2);
  display: grid; place-items: center; overflow: hidden; font-family: var(--serif); color: var(--ink-3);
}
.line-thumb img { width: 100%; height: 100%; object-fit: cover; }
.line-main { flex: 1; min-width: 0; }
.line-main strong { display: block; font-size: .92rem; font-weight: 600; }
.line-main small { color: var(--ink-3); font-size: .78rem; }
.line-controls { display: flex; align-items: center; justify-content: space-between; margin-top: .45rem; }
.line-price { font-weight: 650; font-size: .92rem; }

.totals { display: grid; gap: .4rem; margin-bottom: .9rem; font-size: .9rem; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-size: 1.15rem; font-weight: 700; padding-top: .5rem; border-top: 1px solid var(--line); }
.totals .muted { color: var(--ink-2); }
.totals .save { color: var(--green); font-weight: 600; }

/* ------------------------------------------------------------- modal */

.modal {
  position: fixed; inset: 0; z-index: 70; display: none;
  align-items: flex-start; justify-content: center; padding: 2rem 1rem; overflow-y: auto;
}
.modal.open { display: flex; }
.modal-panel {
  background: var(--paper); border-radius: var(--radius-lg); width: min(560px, 100%);
  box-shadow: var(--shadow-lg); overflow: hidden; animation: pop .2s ease-out;
}
.modal-panel.wide { width: min(760px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.99); } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.4rem; border-bottom: 1px solid var(--line);
}
.modal-body { padding: 1.3rem 1.4rem; }
.modal-foot {
  padding: 1rem 1.4rem 1.3rem; border-top: 1px solid var(--line);
  display: flex; gap: .7rem; justify-content: flex-end; background: var(--card);
}

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-bottom: 1.1rem; }
.choice label {
  border: 1.5px solid var(--line-2); border-radius: var(--radius); padding: .85rem .9rem;
  cursor: pointer; background: #fff; transition: all .15s; display: block;
}
.choice label:hover { border-color: var(--ink-3); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice input:checked + .choice-body { color: var(--green-dark); }
.choice label:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.choice strong { display: block; font-size: .95rem; }
.choice small { color: var(--ink-2); font-size: .78rem; }

.alert {
  border-radius: 10px; padding: .7rem .9rem; font-size: .87rem; margin-bottom: 1rem;
  border: 1px solid transparent;
}
.alert-error { background: var(--red-soft); border-color: rgba(184,50,44,.3); color: #8c231f; }
.alert-info { background: var(--gold-soft); border-color: rgba(217,154,23,.35); color: #7a5406; }
.alert-ok { background: var(--green-soft); border-color: rgba(30,107,79,.3); color: var(--green-dark); }
.alert[hidden] { display: none; }

.success { text-align: center; padding: 1rem .5rem; }
.success .tick {
  width: 62px; height: 62px; margin: 0 auto 1rem; border-radius: 999px;
  background: var(--green-soft); color: var(--green); display: grid; place-items: center;
}
.success h2 { font-size: 1.5rem; margin-bottom: .5rem; }
.success .order-no {
  display: inline-block; font-family: var(--serif); font-size: 1.6rem; letter-spacing: .04em;
  background: var(--card); border: 1px dashed var(--line-2); border-radius: 12px;
  padding: .5rem 1.2rem; margin: .8rem 0;
}
.success p { color: var(--ink-2); font-size: .92rem; }

/* ------------------------------------------------------------- toast */

.toast {
  position: fixed; left: 50%; bottom: 1.6rem; transform: translate(-50%, 130%);
  background: var(--ink); color: var(--paper); padding: .7rem 1.2rem;
  border-radius: 999px; font-size: .88rem; font-weight: 500; z-index: 90;
  box-shadow: var(--shadow-lg); transition: transform .25s cubic-bezier(.4,0,.2,1);
  max-width: calc(100% - 2rem); text-align: center;
}
.toast.show { transform: translate(-50%, 0); }

/* ------------------------------------------------------------- footer */

.site-footer { background: #241811; color: #e8dccd; margin-top: 3rem; padding: 3rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2.2rem; }
.site-footer h3 { font-size: 1rem; margin-bottom: .8rem; color: #fff; }
.site-footer p, .site-footer li { font-size: .87rem; color: #bfae9a; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.site-footer .hours-row { display: flex; justify-content: space-between; gap: 1rem; }
.site-footer a { color: #e8dccd; }
.footer-bottom {
  margin-top: 2.2rem; padding-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.1);
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-size: .8rem; color: #9a8874;
}

/* ------------------------------------------------------------- admin */

.admin-body { background: var(--paper-2); }

.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.login-card {
  background: var(--card); border-radius: var(--radius-lg); padding: 2rem;
  width: min(400px, 100%); box-shadow: var(--shadow-md); border: 1px solid var(--line);
}
.login-card h1 { font-size: 1.5rem; margin-bottom: .3rem; }
.login-card > p { color: var(--ink-2); font-size: .9rem; margin: 0 0 1.4rem; }

.admin-header { background: var(--ink); color: var(--paper); padding: .8rem 0; }
.admin-header .header-inner { padding: 0; }
.admin-header .brand-name { color: #fff; }
.admin-header .brand-sub { color: #c9b8a3; }
.admin-header .btn-ghost { color: var(--paper); border-color: rgba(255,255,255,.25); }
.admin-header .btn-ghost:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.4); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; box-shadow: var(--shadow-sm);
}
.stat .label { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; }
.stat .value { font-family: var(--serif); font-size: 1.9rem; line-height: 1.2; margin-top: .2rem; }
.stat.warn .value { color: var(--red); }
.stat.good .value { color: var(--green); }

.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line-2); margin-bottom: 1.4rem; overflow-x: auto; }
.tab {
  border: 0; background: transparent; padding: .7rem 1.05rem; cursor: pointer;
  font-weight: 600; font-size: .92rem; color: var(--ink-2); white-space: nowrap;
  border-bottom: 2.5px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--green-dark); border-bottom-color: var(--green); }
.tab .pill {
  display: inline-block; margin-left: .4rem; background: var(--red); color: #fff;
  font-size: .7rem; padding: 0 .4rem; border-radius: 999px; font-weight: 700;
}

.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: .7rem; flex-wrap: wrap;
  padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); background: var(--paper);
}
.panel-head h2 { font-size: 1.05rem; margin-right: auto; font-family: var(--sans); font-weight: 700; }

.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .89rem; min-width: 720px; }
table.data th {
  text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); padding: .65rem .8rem; border-bottom: 1px solid var(--line);
  background: var(--paper); position: sticky; top: 0; z-index: 1;
}
table.data td { padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--paper); }
table.data .name { font-weight: 600; }
table.data .name small { display: block; font-weight: 400; color: var(--ink-3); font-size: .76rem; }
table.data .cell-actions { text-align: right; white-space: nowrap; }

.mini-input {
  width: 78px; padding: .35rem .5rem; border: 1px solid var(--line-2);
  border-radius: 8px; background: #fff; text-align: right; font-variant-numeric: tabular-nums;
}
.mini-input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(30,107,79,.14); }
.mini-input.dirty { border-color: var(--gold); background: var(--gold-soft); }

.tag {
  display: inline-block; font-size: .72rem; font-weight: 700; padding: .2rem .55rem;
  border-radius: 999px; letter-spacing: .02em;
}
.tag-ok { background: var(--green-soft); color: var(--green-dark); }
.tag-low { background: var(--gold-soft); color: #7a5406; }
.tag-out { background: var(--red-soft); color: var(--red); }
.tag-off { background: var(--paper-2); color: var(--ink-3); }
.tag-new { background: var(--gold); color: #3a2708; }
.tag-confirmed { background: #e0eaf7; color: #23507f; }
.tag-ready { background: var(--green-soft); color: var(--green-dark); }
.tag-completed { background: var(--paper-2); color: var(--ink-2); }
.tag-cancelled { background: var(--red-soft); color: var(--red); text-decoration: line-through; }

.switch { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; font-size: .85rem; }
.switch input { position: absolute; opacity: 0; }
.switch .track {
  width: 38px; height: 22px; border-radius: 999px; background: var(--line-2);
  position: relative; transition: background .15s; flex: none;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 999px; background: #fff; transition: transform .15s; box-shadow: var(--shadow-sm);
}
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(30,107,79,.25); }

.order-card { border-bottom: 1px solid var(--line); padding: 1rem 1.1rem; }
.order-card:last-child { border-bottom: 0; }
.order-top { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.order-top .num { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; }
.order-top .when { color: var(--ink-3); font-size: .8rem; margin-left: auto; }
.order-meta { display: flex; gap: 1.4rem; flex-wrap: wrap; margin-top: .5rem; font-size: .86rem; color: var(--ink-2); }
.order-meta b { color: var(--ink); font-weight: 600; }
.order-items { margin: .7rem 0 0; padding: .7rem .9rem; background: var(--paper); border-radius: 10px; font-size: .86rem; }
.order-items li { display: flex; justify-content: space-between; gap: 1rem; padding: .15rem 0; }
.order-items ul { list-style: none; margin: 0; padding: 0; }
.order-items .sum { border-top: 1px dashed var(--line-2); margin-top: .45rem; padding-top: .45rem; font-weight: 700; }
.order-actions { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: .8rem; }

.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.4rem; }
.settings-section { padding: 1.2rem 1.3rem; }
.settings-section h3 { font-size: .95rem; font-family: var(--sans); font-weight: 700; margin-bottom: .9rem; }
.helper { font-size: .82rem; color: var(--ink-2); margin: -.4rem 0 1rem; }

.hours-editor { display: grid; gap: .5rem; }
.hours-editor .hrow { display: grid; grid-template-columns: 1fr 1fr auto; gap: .5rem; align-items: center; }

.sticky-save {
  position: sticky; bottom: 0; background: var(--card); border-top: 1px solid var(--line);
  padding: .9rem 1.3rem; display: flex; gap: .7rem; align-items: center; justify-content: flex-end;
}
.sticky-save .status { margin-right: auto; font-size: .85rem; color: var(--ink-2); }

/* ------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .wrap { width: min(1180px, 100% - 1.6rem); }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .header-inner { flex-wrap: wrap; }
  .hero { padding: 2.2rem 0 1.4rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: .8rem; }
  .card-body { padding: .7rem .75rem .85rem; }
  .card-body .desc { display: none; }
  .card-foot { flex-direction: column; align-items: stretch; gap: .5rem; }
  .card-foot .stepper { justify-content: space-between; }
  .row, .choice { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .modal { padding: 1rem .7rem 3rem; }
  .brand-mark { width: 38px; height: 38px; }
}

@media print {
  .site-header, .admin-header, .tabs, .order-actions, .panel-head, .btn { display: none !important; }
  body { background: #fff; }
  .panel { border: 0; box-shadow: none; }
}

/* ------------------------------------------------------------- product photos */

/* Our own category artwork is drawn to fit the 4:3 media box exactly; a real
   photo is cropped to fill it. */
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media img.artwork { object-fit: contain; background: var(--paper-2); }
.line-thumb img.artwork { object-fit: cover; }

.photo-block {
  display: grid; grid-template-columns: 132px 1fr; gap: 1rem;
  align-items: start; margin-bottom: .9rem;
}
.photo-preview {
  position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden;
  border: 2px dashed var(--line-2); background: var(--paper-2);
  display: grid; place-items: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.photo-preview:hover, .photo-preview.dragging { border-color: var(--green); background: var(--green-soft); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-preview img.artwork { object-fit: contain; }
.photo-preview .busy {
  position: absolute; inset: 0; background: rgba(251, 246, 238, .88);
  display: grid; place-items: center; font-size: .8rem; font-weight: 600; color: var(--green-dark);
}
.photo-preview .busy[hidden] { display: none; }

.photo-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; }
.photo-note { font-size: .8rem; color: var(--ink-2); margin: 0 0 .6rem; }
.photo-note b { color: var(--ink); }

.photo-link summary {
  font-size: .82rem; color: var(--ink-2); cursor: pointer; margin-bottom: .4rem;
  list-style: none;
}
.photo-link summary::-webkit-details-marker { display: none; }
.photo-link summary::before { content: "▸ "; }
.photo-link[open] summary::before { content: "▾ "; }

.row-thumb {
  width: 44px; height: 44px; border-radius: 9px; overflow: hidden; flex: none;
  background: var(--paper-2); border: 1px solid var(--line);
}
.row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-thumb img.artwork { object-fit: contain; }
table.data td.cell-product { display: flex; align-items: center; gap: .7rem; }

@media (max-width: 700px) {
  .photo-block { grid-template-columns: 104px 1fr; }
}

/* ------------------------------------------------------------- card payment */

.field-label {
  display: block; font-size: .8rem; font-weight: 600;
  color: var(--ink-2); margin: .2rem 0 .4rem;
}

.pay-summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem 1rem; margin-bottom: 1.1rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  font-size: .9rem;
}
.pay-summary .pay-amount { font-size: 1.25rem; font-weight: 700; font-family: var(--serif); }

#paymentElement { min-height: 40px; }

.pay-hold { font-size: .8rem; color: var(--ink-3); margin: .9rem 0 0; text-align: center; }

.paid-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  background: var(--green-soft); color: var(--green-dark);
  font-size: .78rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px;
}

.tag-paid { background: var(--green-soft); color: var(--green-dark); }
.tag-unpaid { background: var(--gold-soft); color: #7a5406; }
.tag-refunded { background: var(--red-soft); color: var(--red); }
.tag-pending_payment { background: var(--gold-soft); color: #7a5406; }

/* ------------------------------------------------------------- policy pages */

.policy-page { padding: 2.4rem 0 3rem; max-width: 760px; }
.policy-page h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: .6rem; }
.policy-lede { color: var(--ink-2); font-size: 1.02rem; margin: 0 0 1.8rem; max-width: 58ch; }

.policy-nav {
  display: flex; flex-wrap: wrap; gap: .5rem;
  padding-bottom: 1.6rem; border-bottom: 1px solid var(--line); margin-bottom: .6rem;
}
.policy-nav a {
  border: 1px solid var(--line-2); background: #fff; border-radius: 999px;
  padding: .38rem .9rem; font-size: .85rem; font-weight: 500;
  text-decoration: none; color: var(--ink-2); transition: all .15s;
}
.policy-nav a:hover { border-color: var(--ink-3); color: var(--ink); }

.policy-section { padding: 2rem 0; border-bottom: 1px solid var(--line); scroll-margin-top: 5rem; }
.policy-section:last-of-type { border-bottom: 0; }
.policy-section h2 { font-size: 1.45rem; margin-bottom: 1rem; }

.policy-body p { color: var(--ink-2); margin: 0 0 1rem; line-height: 1.65; }
.policy-body p:last-child { margin-bottom: 0; }
.policy-body ul { color: var(--ink-2); margin: 0 0 1rem; padding-left: 1.2rem; }
.policy-body li { margin-bottom: .35rem; }

.facts {
  margin: 0 0 1.4rem; padding: 1.1rem 1.3rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  display: grid; gap: .7rem;
}
.facts .fact { display: flex; justify-content: space-between; gap: 1.4rem; font-size: .9rem; }
.facts dt { color: var(--ink-2); flex: none; }
.facts dd { margin: 0; font-weight: 600; text-align: right; }

.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.contact-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.1rem;
}
.contact-card h3 { font-family: var(--sans); font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin-bottom: .5rem; }
.contact-card p { margin: 0 0 .25rem; font-size: .92rem; }
.contact-card .hours-row { display: flex; justify-content: space-between; gap: .8rem; font-size: .85rem; }

.policy-updated {
  margin-top: 2rem; padding-top: 1.2rem; border-top: 1px dashed var(--line-2);
  font-size: .85rem; color: var(--ink-3);
}

.footer-links a { color: #bfae9a; text-decoration: none; }
.footer-links a:hover { color: #e8dccd; text-decoration: underline; }

.checkout-terms { font-size: .8rem; color: var(--ink-3); margin: .8rem 0 0; text-align: center; }
.checkout-terms a { color: var(--green); }

.policy-input { min-height: 190px; font-size: .88rem; line-height: 1.6; }

@media (max-width: 700px) {
  .facts .fact { flex-direction: column; gap: .1rem; }
  .facts dd { text-align: left; }
}

/* ------------------------------------------------------------- bank debits */

.tag-clearing { background: #e0eaf7; color: #23507f; }

.pay-warning {
  margin-top: .7rem; padding: .75rem .95rem; border-radius: 10px;
  background: var(--gold-soft); border: 1px solid rgba(217, 154, 23, .45);
  color: #6b4a05; font-size: .86rem; line-height: 1.5;
}
.pay-warning.danger {
  background: var(--red-soft); border-color: rgba(184, 50, 44, .4); color: #8c231f;
}

.stat.clearing .value { color: #23507f; }
