:root {
  --primary: #1f3d32;
  --primary-soft: color-mix(in srgb, var(--primary) 12%, white);
  --ink: #1c1917;
  --muted: #6b645c;
  --line: rgba(28, 25, 23, 0.08);
  --bg: #f6f1ea;
  --card: #fffdf9;
  --shadow: 0 18px 50px rgba(48, 36, 24, 0.08);
  --radius: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, color-mix(in srgb, var(--primary) 18%, transparent), transparent 60%),
    var(--bg);
  font-family: Outfit, "Segoe UI", sans-serif;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; }

.store-header {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(16px);
  background: rgba(246, 241, 234, 0.86);
  border-bottom: 1px solid var(--line);
}

.header-inner,
.hero-inner,
main,
.footer-inner {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 84px;
}

.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-left: auto;
  min-width: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-link,
.header-logout button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.header-link:hover,
.header-logout button:hover { background: var(--primary-soft); }

.cart-count {
  display: inline-grid;
  place-items: center;
  min-width: 1.35em;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-size: 0.78rem;
  line-height: 1.35em;
}

.header-profile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  max-width: 220px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  cursor: pointer;
}

.header-profile:hover { background: var(--primary-soft); }

.header-profile-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  font-weight: 600;
}

.header-email {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
}

.header-logout { margin: 0; }

.account-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.account-panels-single {
  grid-template-columns: minmax(0, 640px);
}

.account-card,
.form-note,
.form-error {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.account-card { padding: 28px; }
.account-card h2 {
  margin: 0 0 8px;
  font-family: Fraunces, Georgia, serif;
  font-weight: 520;
  font-size: 1.8rem;
}
.account-card p { margin: 0 0 18px; color: var(--muted); }
.account-card form { display: grid; gap: 14px; }
.account-card form + form { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.account-card label { display: grid; gap: 6px; font-weight: 600; }
.account-card input,
.account-card textarea {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  font-weight: 400;
  background: white;
  color: var(--ink);
}

.account-card textarea { min-height: 110px; resize: vertical; }
.account-card button,
.form-note,
.form-error { font: inherit; }
.account-card button {
  justify-self: start;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--primary);
  color: white;
  font-weight: 600;
  cursor: pointer;
}
.form-note,
.form-error {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px 18px;
}
.form-note { color: var(--primary); }
.form-error { color: #8a2b2b; }

.flash-messages {
  width: min(1120px, calc(100% - 40px));
  margin: 18px auto 0;
  display: grid;
  gap: 10px;
}
.form-hint { margin: 0; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark,
.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  object-fit: cover;
  background: var(--primary);
  color: white;
  display: grid;
  place-items: center;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.3rem;
}

.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.brand-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.brand-name {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
  line-height: 1.1;
}

.search-bar {
  display: flex;
  gap: 8px;
  width: min(420px, 100%);
  padding: 6px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(48, 36, 24, 0.04);
}

.search-bar input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 10px 16px;
  font: inherit;
  color: var(--ink);
}

.search-bar button {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: var(--primary);
  color: white;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.store-hero { padding: 42px 0 8px; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 600;
}
.store-hero h1,
.detail-copy h1 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  font-weight: 520;
  letter-spacing: -0.04em;
  line-height: 0.95;
}
.store-hero p:last-child { max-width: 460px; color: var(--muted); font-size: 1.05rem; }

main { padding: 18px 0 64px; }

.category-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.category-nav a,
.category-nav span {
  padding: 8px 14px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}
.category-nav a.active {
  background: var(--primary);
  color: white;
  border-color: transparent;
}

.store-pages {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 28px;
}
.store-pages a,
.store-pages span {
  padding: 8px 14px;
  border-radius: 999px;
  background: white;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
}

.product-card,
.product-detail,
.menu-row,
.empty-state {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.product-card { overflow: hidden; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 24px 50px rgba(48, 36, 24, 0.12); }
.card-media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--primary-soft); }
.product-image,
.product-image.placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: grid;
  place-items: center;
}
.product-image.placeholder {
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--primary) 24%, white), #fff7ee 70%);
  color: var(--primary);
  font-family: Fraunces, Georgia, serif;
  font-size: 3rem;
}
.card-body { padding: 16px 16px 8px; }
.card-buy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px 18px;
}
.card-buy .product-price { margin: 0; }
.add-cart button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--primary);
  color: white;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.detail-copy .add-cart { margin-top: 18px; }
.card-body h2,
.menu-row h3 { margin: 0 0 6px; font-size: 1.12rem; font-weight: 600; }
.card-description,
.menu-row p,
.detail-description { margin: 0; color: var(--muted); line-height: 1.5; }
.card-description {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3em;
}
.product-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 14px 0 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
}
.product-price span {
  font-family: Outfit, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.product-grid .empty-state { grid-column: 1 / -1; }
.empty-state { padding: 72px 28px; text-align: center; }
.empty-mark {
  display: inline-block;
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
  border-radius: 20px;
  background: var(--primary);
}
.empty-state h2 { margin: 0 0 8px; font-family: Fraunces, Georgia, serif; font-weight: 520; }
.empty-state p { margin: 0; color: var(--muted); }

.product-detail {
  display: grid;
  grid-template-columns: minmax(260px, 460px) 1fr;
  gap: 28px;
  padding: 18px;
  margin-top: 28px;
}
.product-detail .card-media { border-radius: 18px; min-height: 320px; }
.gallery-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 320px;
  overflow: hidden;
  border-radius: 18px;
  background: var(--primary-soft);
  touch-action: pan-y;
}
.gallery-track {
  position: absolute;
  inset: 0;
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.45s ease;
}
.gallery-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.92);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(48, 36, 24, 0.16);
  cursor: pointer;
  transform: translateY(-50%);
}
.gallery-nav svg { width: 20px; height: 20px; }
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
.product-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.product-thumb {
  width: 72px;
  height: 72px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: white;
  overflow: hidden;
  cursor: pointer;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-thumb.is-selected { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 35%, white); }
.detail-copy { padding: 18px 12px; }
.detail-description { margin-top: 18px; font-size: 1.05rem; }
.stock { color: var(--primary); font-weight: 600; }
.back-link {
  display: inline-flex;
  margin-top: 22px;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-weight: 600;
}

.menu-section { margin-bottom: 28px; }
.menu-section h2 {
  margin: 0 0 12px;
  font-family: Fraunces, Georgia, serif;
  font-size: 2rem;
  font-weight: 520;
}
.menu-list { display: grid; gap: 12px; }
.menu-row {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px;
}
.menu-row .card-media,
.menu-row .product-image,
.menu-row .product-image.placeholder {
  width: 92px;
  height: 92px;
  border-radius: 16px;
}
.menu-row .product-price { margin: 0; }
.menu-row-media { display: block; }
.menu-row-copy { min-width: 0; }
.menu-row-buy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.table-form {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.table-form h2 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.5rem;
  font-weight: 520;
}
.table-form p { margin: 0; color: var(--muted); }
.table-form label { display: grid; gap: 6px; font-weight: 600; }
.table-form select {
  max-width: 280px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  background: white;
  color: var(--ink);
}
.table-form button {
  justify-self: start;
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--primary);
  color: white;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.cart-list { display: grid; gap: 12px; }
.cart-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.cart-line h2 {
  margin: 0 0 4px;
  font-size: 1.12rem;
  font-weight: 600;
}
.cart-line .product-price { margin: 0; font-size: 1.05rem; }
.cart-qty,
.cart-line-total {
  margin: 0;
  font-weight: 600;
}
.cart-line-total span,
.cart-total span {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.cart-line form { margin: 0; }
.cart-line form button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.cart-line form button:hover { background: var(--primary-soft); }
.cart-total {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 10px;
  margin: 8px 0 0;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.6rem;
}
.order-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.order-filter-copy { min-width: 180px; }
.order-filter-copy p { margin: 0; color: var(--muted); }
.order-filter-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}
.order-filter label {
  display: grid;
  gap: 6px;
  min-width: 180px;
}
.order-filter label span {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.date-field { position: relative; display: grid; gap: 6px; min-width: 190px; }
.date-field > span {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.date-trigger {
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  background: white;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.date-trigger::after {
  content: "";
  float: right;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  background: currentColor;
  opacity: 0.55;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 2h2v2h6V2h2v2h3v18H4V4h3zm11 8H6v8h12z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.date-field.is-open .date-trigger { border-color: color-mix(in srgb, var(--primary) 45%, white); }
.date-popover {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  width: 300px;
  padding: 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 50px rgba(48, 36, 24, 0.16);
}
.date-popover[hidden] { display: none; }
.date-head, .date-week, .date-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.date-head { grid-template-columns: 36px 1fr 36px; align-items: center; margin-bottom: 10px; }
.date-head strong {
  text-align: center;
  font-family: Fraunces, Georgia, serif;
  font-weight: 520;
  font-size: 1.05rem;
}
.date-head button, .date-today {
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.date-head button {
  width: 36px;
  height: 36px;
  border-radius: 12px;
}
.date-head button:hover, .date-today:hover { background: var(--primary-soft); }
.date-week { margin-bottom: 4px; }
.date-week span, .date-grid button {
  height: 34px;
  display: grid;
  place-items: center;
  font-size: 0.82rem;
}
.date-week span { color: var(--muted); font-weight: 600; }
.date-grid button {
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.date-grid button:hover { background: var(--primary-soft); }
.date-grid button.is-outside { color: color-mix(in srgb, var(--muted) 70%, white); }
.date-grid button.is-today { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 40%, white); }
.date-grid button.is-selected { background: var(--primary); color: white; }
.date-today { width: 100%; height: 36px; margin-top: 8px; border-radius: 12px; }
.order-filter-submit {
  height: 48px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: var(--primary);
  color: white;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.order-card { align-items: start; }
.order-items {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
}
.order-items li + li { margin-top: 4px; }
.place-order {
  justify-self: end;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--primary);
  color: white;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.store-footer { padding: 0 0 28px; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.powered-by {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 600;
}

.powered-by img {
  width: 22px;
  height: auto;
  display: block;
}

.powered-by:hover { color: var(--ink); }

@media (max-width: 760px) {
  .header-inner { flex-direction: column; align-items: stretch; padding: 14px 0; }
  .header-tools { flex-direction: column; align-items: stretch; margin-left: 0; }
  .header-actions { justify-content: flex-start; flex-wrap: wrap; }
  .account-panels, .product-detail, .menu-row, .cart-line { grid-template-columns: 1fr; }
  .menu-row .product-image, .menu-row .product-image.placeholder { width: 100%; height: 180px; }
  .menu-row-media { width: 100%; }
  .menu-row-buy, .cart-line form { align-items: flex-start; }
  .order-filter, .order-filter-fields { align-items: stretch; }
  .date-field, .order-filter-submit { width: 100%; }
  .date-popover { width: min(300px, calc(100vw - 56px)); }
}
