:root {
  color-scheme: light;
  --ink: #211912;
  --muted: #766b60;
  --paper: #fffaf2;
  --surface: #ffffff;
  --line: #eadfce;
  --espresso: #3a2417;
  --roast: #8f3f24;
  --gold: #d89535;
  --sage: #68735c;
  --blue: #254b59;
  --shadow: 0 16px 44px rgba(33, 25, 18, 0.16);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #17120e;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.35;
}

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

button {
  cursor: pointer;
}

svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 14px) 14px calc(env(safe-area-inset-bottom) + 104px);
  overflow: hidden;
  background: var(--paper);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 48px 1fr 58px;
  align-items: center;
  gap: 12px;
  margin: -14px -14px 10px;
  padding: calc(env(safe-area-inset-top) + 12px) 14px 12px;
  background: rgba(255, 250, 242, 0.92);
  border-bottom: 1px solid rgba(234, 223, 206, 0.9);
  backdrop-filter: blur(16px);
}

.app-header p,
.section-title h2,
.sheet-panel header p {
  margin: 0;
}

.app-header p,
.sheet-panel header p {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.app-header h1 {
  margin: 1px 0 0;
  font-size: 1.24rem;
  line-height: 1.1;
}

.circle-button {
  position: relative;
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-weight: 900;
}

.circle-button:first-child {
  background: var(--espresso);
  color: #fff0dc;
}

.cart-trigger {
  justify-self: end;
  background: var(--ink);
  color: white;
}

.cart-trigger strong {
  position: absolute;
  right: -3px;
  top: -4px;
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  padding: 0 6px;
  border: 2px solid var(--paper);
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-size: 0.75rem;
}

main {
  display: grid;
  gap: 18px;
}

.pickup-card,
.hero-card,
.checkout-card,
.item-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(33, 25, 18, 0.06);
}

.pickup-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
}

.pickup-card span,
.pickup-card small,
.item-card p,
.order-note,
.cart-empty {
  color: var(--muted);
}

.pickup-card span,
.pickup-card small,
.pickup-card strong {
  display: block;
}

.pickup-card span {
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pickup-card strong {
  margin-top: 2px;
  font-size: 0.98rem;
}

.pickup-card small {
  margin-top: 2px;
  font-size: 0.82rem;
}

.pickup-card button,
.section-title button,
.hero-card button {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: #f4eadb;
  color: var(--roast);
  font-size: 0.84rem;
  font-weight: 900;
}

.pickup-card button,
.section-title button {
  padding: 0 13px;
}

.hero-card {
  position: relative;
  min-height: 238px;
  overflow: hidden;
  color: white;
  background: var(--ink);
}

.hero-card::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(0deg, rgba(33, 25, 18, 0.88), rgba(33, 25, 18, 0.12) 76%);
}

.hero-card img {
  width: 100%;
  height: 238px;
  object-fit: cover;
}

.hero-card div {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  padding: 18px;
}

.hero-card p {
  margin: 0 0 5px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-card h2 {
  max-width: 330px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.1rem;
  line-height: 0.98;
}

.hero-card button {
  margin-top: 14px;
  padding: 0 16px;
  background: var(--roast);
  color: white;
}

.app-section {
  scroll-margin-top: 84px;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-title h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  line-height: 1;
}

.category-row {
  display: flex;
  gap: 8px;
  margin: 0 -14px 12px;
  padding: 0 14px;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-row::-webkit-scrollbar {
  display: none;
}

.category-row button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-weight: 900;
}

.category-row button.active {
  background: var(--ink);
  color: white;
}

.item-list {
  display: grid;
  gap: 10px;
}

.item-card {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  cursor: pointer;
}

.item-card:focus-visible {
  outline: 3px solid rgba(193, 122, 58, 0.45);
  outline-offset: 2px;
}

.item-card img {
  width: 82px;
  height: 82px;
  border-radius: 6px;
  object-fit: cover;
}

.item-card h3,
.item-card p {
  margin: 0;
}

.item-card h3 {
  font-size: 1rem;
  line-height: 1.15;
}

.item-card p {
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 0.82rem;
}

.item-card strong {
  display: block;
  margin-top: 6px;
  color: var(--roast);
  font-size: 0.92rem;
}

.item-card button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: white;
  font-size: 1.45rem;
  line-height: 1;
}

.checkout-card {
  padding: 16px;
}

.checkout-form {
  display: grid;
  gap: 12px;
}

.checkout-help {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.45;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--ink);
  font-size: 16px;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.floating-cart {
  position: fixed;
  right: max(14px, calc((100vw - 430px) / 2 + 14px));
  bottom: calc(env(safe-area-inset-bottom) + 82px);
  z-index: 24;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(300px, calc(100vw - 28px));
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--roast);
  color: white;
  box-shadow: var(--shadow);
  font-weight: 900;
}

.floating-cart[hidden] {
  display: none;
}

.tab-bar {
  position: fixed;
  right: max(0px, calc((100vw - 430px) / 2));
  bottom: 0;
  left: max(0px, calc((100vw - 430px) / 2));
  z-index: 25;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 8px 10px calc(env(safe-area-inset-bottom) + 8px);
  background: rgba(255, 250, 242, 0.94);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.tab-bar button {
  display: grid;
  min-height: 52px;
  place-items: center;
  gap: 3px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.tab-bar button.active {
  background: #f4eadb;
  color: var(--roast);
}

.tab-bar svg {
  width: 20px;
  height: 20px;
}

.cart-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
}

.cart-sheet.open,
.customize-sheet.open {
  display: block;
}

.customize-sheet {
  position: fixed;
  inset: 0;
  z-index: 62;
  display: none;
}

.sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(23, 18, 14, 0.5);
}

.sheet-panel {
  position: absolute;
  right: max(0px, calc((100vw - 430px) / 2));
  bottom: 0;
  left: max(0px, calc((100vw - 430px) / 2));
  display: grid;
  grid-template-rows: auto auto minmax(120px, 1fr) auto auto auto;
  width: min(100%, 430px);
  max-height: 88dvh;
  margin: 0 auto;
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 18px);
  border-radius: 18px 18px 0 0;
  background: var(--paper);
  box-shadow: 0 -18px 50px rgba(33, 25, 18, 0.24);
}

.customize-panel {
  position: absolute;
  right: max(0px, calc((100vw - 430px) / 2));
  bottom: 0;
  left: max(0px, calc((100vw - 430px) / 2));
  display: grid;
  grid-template-rows: auto auto minmax(160px, 1fr) auto;
  width: min(100%, 430px);
  max-height: 92dvh;
  margin: 0 auto;
  padding: 8px 16px calc(env(safe-area-inset-bottom) + 18px);
  border-radius: 18px 18px 0 0;
  background: var(--paper);
  box-shadow: 0 -18px 50px rgba(33, 25, 18, 0.24);
}

.sheet-handle {
  justify-self: center;
  width: 42px;
  height: 5px;
  margin: 2px 0 10px;
  border-radius: 999px;
  background: #d8cbb9;
}

.sheet-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
}

.sheet-panel header h2,
.customize-panel header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
}

.customize-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
}

.customize-panel header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.customize-scroll {
  display: grid;
  align-content: start;
  gap: 18px;
  overflow-y: auto;
  padding: 6px 0 18px;
}

.option-group {
  display: grid;
  gap: 10px;
}

.option-group[hidden] {
  display: none;
}

.option-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.option-heading h3 {
  margin: 0;
  font-size: 1.05rem;
}

.option-heading span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.option-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice label {
  display: flex;
  min-height: 48px;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9rem;
}

.choice input:checked + label {
  border-color: var(--roast);
  background: #f8ecdf;
  color: var(--roast);
}

.choice small {
  color: var(--muted);
  font-size: 0.76rem;
}

.customize-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.customize-footer span,
.customize-footer strong {
  display: block;
}

.customize-footer span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.customize-footer strong {
  font-size: 1.3rem;
}

.customize-footer .checkout-button {
  min-width: 180px;
  padding: 0 18px;
}

.cart-items {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow-y: auto;
  padding: 4px 0 12px;
}

.cart-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.cart-row h3,
.cart-row p,
.cart-empty {
  margin: 0;
}

.cart-row h3 {
  font-size: 0.98rem;
}

.cart-row p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.82rem;
}

.cart-options {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.quantity {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
}

.quantity button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-weight: 900;
}

.cart-totals {
  display: grid;
  gap: 9px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.cart-totals div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.cart-totals div:last-child {
  color: var(--roast);
  font-size: 1.18rem;
}

.checkout-button {
  min-height: 52px;
  border: 0;
  border-radius: 8px;
  background: var(--roast);
  color: white;
  font-weight: 900;
}

.order-note {
  margin: 10px 0 0;
  font-size: 0.82rem;
  text-align: center;
}

@media (min-width: 431px) {
  .app-shell {
    min-height: 932px;
  }
}
