:root {
  font-family: system-ui, sans-serif;
  color: #24231f;
  background: #f5f4ee;
  --paper: #fffefa;
  --green: #203d32;
  --accent: #ff775e;
  --border: #d7d9cd;
  --muted: #585e53;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.5; }
a { color: inherit; }
button, select, input { font: inherit; }
button, .pill {
  border: 1px solid var(--border); border-radius: 999px; padding: .55rem 1rem;
  color: inherit; background: var(--paper); cursor: pointer; min-height: 44px;
}
button:hover:not(:disabled), .pill:hover { filter: brightness(.92); }
button:disabled { cursor: default; opacity: .58; }
button[aria-pressed=true] { background: var(--green); color: white; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid #287657; outline-offset: 3px;
}
.wrap { max-width: 1200px; margin-inline: auto; padding-inline: clamp(1rem, 4vw, 3rem); }
.top { background: var(--paper); border-bottom: 1px solid var(--border); }
.shop-top { position: sticky; top: 0; z-index: 10; }
.shop-actions { display: flex; align-items: center; gap: .4rem; }
#toggle-categories { display: grid; width: 44px; padding: 0; place-items: center; }
#toggle-categories[aria-expanded=true] { background: var(--green); color: white; }
.menu-icon {
  width: 18px; height: 2px; border-radius: 2px; background: currentColor;
  box-shadow: 0 -6px currentColor, 0 6px currentColor;
}
#category-strip { background: var(--paper); }
#category-strip.is-open { min-height: var(--category-height, 0px); }
#category-strip.is-open #categories {
  position: fixed; z-index: 9; inset: var(--shop-header-height, 72px) 0 auto;
  max-height: calc(100dvh - var(--shop-header-height, 72px));
  overflow-y: auto; overscroll-behavior: contain; background: var(--paper);
  border: 1px solid var(--border); border-radius: 0 0 .75rem .75rem;
  box-shadow: 0 .5rem 1rem #24231f20;
}
#categories { display: flex; flex-wrap: wrap; gap: .5rem; padding-block: .3rem .65rem; }
#categories button { max-width: 100%; overflow-wrap: anywhere; }
#menu { scroll-margin-top: calc(var(--shop-header-height, 72px) + .75rem); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.top .bar { min-height: 72px; }
.brand { display: inline-flex; gap: .5rem; align-items: center; font-weight: 850; text-decoration: none; }
.brand img { max-width: 112px; max-height: 60px; object-fit: contain; border-radius: .4rem; }
.pill { display: inline-flex; align-items: center; gap: .5rem; text-decoration: none; }
.primary { background: var(--accent); color: #2a1711; border-color: #db5e48; font-weight: 750; }
#count { background: var(--green); color: white; border-radius: 1rem; min-width: 1.5rem; text-align: center; }
.hero { background: #100d0b; }
h1, h2, h3 { line-height: 1.1; }
.hero h1 { margin-block: 0; }
.hero img { display: block; width: min(100%, 30rem); height: auto; margin-inline: auto; }
.layout { padding-block: 2rem; }
#menu h2, .cart-heading h2 { margin-top: 0; }
#menu-message:empty { display: none; }
.cart-heading h2 { margin-bottom: 0; }
.order-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 1rem; }
.card, .panel { background: var(--paper); border: 1px solid var(--border); border-radius: 1rem; padding: 1rem; overflow-wrap: anywhere; }
.card { display: flex; flex-direction: column; }
.card img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #100d0b; border-radius: .6rem; }
.card h3, .card p { margin: .45rem 0; }
.card .bar { margin-top: auto; padding-top: .75rem; flex-wrap: wrap; }
.card .tube { margin-top: .5rem; }
#availability { margin-top: 2rem; }
#rates summary { cursor: pointer; font-weight: 700; }
#rate-list { padding-inline-start: 1.3rem; }
.muted { color: var(--muted); font-size: .9rem; }
#cart {
  position: fixed; inset: 0 0 0 auto; margin: 0;
  width: min(100%, 28rem); max-width: none; height: 100%; max-height: none;
  border-radius: 1rem 0 0 1rem; color: inherit; padding: 0; overflow: hidden;
}
#cart[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.cart-heading { padding: .7rem 1rem; border-bottom: 1px solid var(--border); }
.cart-content { padding: 1rem; overflow-y: auto; overscroll-behavior: contain; }
#cart::backdrop { background: rgb(18 22 17 / .55); }
body:has(#cart[open]) { overflow: hidden; }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .25rem .75rem; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.line strong { grid-column: 1 / -1; }
.quantity { display: flex; align-items: center; gap: .35rem; }
.quantity button { min-width: 44px; padding: 0; }
label { display: grid; gap: .3rem; margin-bottom: .75rem; }
input, select { width: 100%; min-height: 44px; border: 1px solid #929c90; border-radius: .5rem; padding: .5rem; background: white; color: inherit; }
footer { padding-bottom: 2rem; }
.staff { padding-block: 1rem 2rem; }
.login { max-width: 28rem; }
.tools { margin-block: 1rem; flex-wrap: wrap; }
.queue { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 1rem; }
.queue h2 { margin: 0; }
.badge, .banner { background: #e6ecdc; border-radius: .6rem; padding: .45rem .7rem; }
.fresh, .banner { background: #ffc9b7; color: #3a2019; font-weight: 700; }
@media (max-width: 600px) {
  .wrap { padding-inline: max(.75rem, env(safe-area-inset-left)) max(.75rem, env(safe-area-inset-right)); }
  .shop-top { padding-top: env(safe-area-inset-top); }
  .shop-top .bar { min-height: 54px; gap: .5rem; }
  .shop-top .brand img { max-width: 80px; max-height: 42px; }
  #open-cart { padding-inline: .7rem; }
  #categories { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; }
  #categories button { padding: .3rem .4rem; font-size: .875rem; line-height: 1.2; }
  .layout { padding-block: 1.15rem; }
  #products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  #products .card { padding: .65rem; border-radius: .75rem; }
  #products .card h3 { font-size: 1rem; line-height: 1.2; }
  #products .card p { font-size: .875rem; }
  #products .card .bar { align-items: stretch; flex-direction: column; gap: .35rem; }
  #products .card button { padding-inline: .35rem; font-size: .875rem; }
  #cart { width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  .cart-heading, .cart-content {
    padding-inline: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right));
  }
  .cart-heading { padding-top: calc(.7rem + env(safe-area-inset-top)); }
  .cart-content { padding-bottom: max(1rem, env(safe-area-inset-bottom)); }
  .cart-content input, .cart-content select { font-size: max(1rem, 16px); }
  #submit { width: 100%; min-height: 48px; }
}
@media (max-width: 355px) {
  #products { grid-template-columns: minmax(0, 1fr); }
}
