:root {
  color-scheme: light;
  --ink: #241f21;
  --muted: #6d6265;
  --line: #e7ded9;
  --brand: #c92f2f;
  --brand-dark: #992525;
  --accent: #147c64;
  --paper: #fffaf6;
  --surface: #ffffff;
  --warm: #f5e7dc;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  padding-bottom: 88px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(280px, auto) minmax(104px, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(255, 250, 246, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.topbar > div:first-child {
  min-width: 0;
  justify-self: start;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 4vw, 2.1rem);
}

.brand-logo {
  display: block;
  width: auto;
  height: 42px;
  max-width: min(220px, 54vw);
  object-fit: contain;
}

.header-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  justify-self: center;
  max-width: min(560px, 54vw);
  min-width: 0;
}

.header-link,
.location-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 6px 10px 6px 8px;
  font-size: 0.88rem;
  font-weight: 850;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(88, 47, 29, 0.04);
}

.header-link:hover,
.location-menu summary:hover {
  border-color: #d8c9c1;
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(88, 47, 29, 0.08);
}

.header-icon {
  display: grid;
  width: 24px;
  min-width: 24px;
  height: 24px;
  place-items: center;
}

.header-icon svg {
  display: block;
  width: 24px;
  height: 24px;
}

.whatsapp-link .header-icon {
  color: #25d366;
}

.location-menu {
  position: relative;
}

.location-menu summary {
  cursor: pointer;
  list-style: none;
}

.location-menu summary::-webkit-details-marker {
  display: none;
}

.location-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 8;
  display: grid;
  gap: 8px;
  width: min(320px, 86vw);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
  box-shadow: 0 16px 36px rgba(36, 31, 33, 0.18);
}

.location-dropdown a {
  display: grid;
  gap: 2px;
  border-radius: 8px;
  color: var(--ink);
  padding: 9px;
  text-decoration: none;
}

.location-dropdown a:hover {
  background: #f6eee9;
}

.location-dropdown strong {
  color: var(--accent);
  font-size: 0.9rem;
}

.location-dropdown span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

main {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.cart-toggle,
.sticky-total button,
.send-button,
.buy-row button,
.confirmation button {
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: white;
  font-weight: 800;
}

.cart-toggle {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
  padding: 10px 12px;
}

.cart-toggle strong {
  display: grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: white;
  color: var(--brand);
}

.notice,
.state {
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid #ecd1bc;
  border-radius: 8px;
  background: #fff3e6;
  color: #5b3822;
  font-weight: 700;
  line-height: 1.4;
}

.promo-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.promo-card {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 94px;
  align-content: center;
  overflow: hidden;
  border: 1px solid #f0c9bc;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff8ef, #fff);
  padding: 14px;
  box-shadow: 0 8px 20px rgba(88, 47, 29, 0.06);
}

.promo-card-image {
  aspect-ratio: 3 / 2;
  min-height: 0;
  padding: 0;
}

.promo-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.promo-card-image .promo-fallback {
  display: none;
}

.promo-card-image.promo-image-error {
  aspect-ratio: auto;
  min-height: 94px;
  padding: 14px;
}

.promo-card-image.promo-image-error .promo-fallback {
  display: grid;
  gap: 5px;
}

.promo-board strong {
  color: var(--brand);
  font-size: 1rem;
}

.promo-board span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.35;
}

.search-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.search-panel label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.search-panel input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 12px 14px;
  box-shadow: 0 8px 20px rgba(88, 47, 29, 0.06);
}

.search-panel input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(20, 124, 100, 0.16);
}

.categories {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 14px;
}

.categories button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 9px 13px;
  color: var(--muted);
  font-weight: 800;
}

.categories button.active {
  border-color: var(--accent);
  background: #e7f4ef;
  color: #0f5e4c;
}

.promo-strip {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.promo-strip p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #e9f6ef;
  color: #0f5e4c;
  font-weight: 800;
}

.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.empty-catalog {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  line-height: 1.35;
}

.empty-catalog strong {
  color: var(--ink);
}

.product-card {
  display: grid;
  grid-template-rows: 190px 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(88, 47, 29, 0.08);
}

.product-card.just-added {
  border-color: #95cfb8;
  box-shadow: 0 12px 28px rgba(20, 124, 100, 0.14);
}

.media {
  background: var(--warm);
}

.media img,
.placeholder {
  width: 100%;
  height: 100%;
}

.media img {
  object-fit: cover;
}

.media .product-logo-fallback {
  object-fit: contain;
  padding: 34px;
}

.placeholder {
  display: grid;
  place-items: center;
  color: var(--brand);
  font-weight: 900;
  font-size: 1.25rem;
}

.product-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
}

.category-label {
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.product-body h2 {
  margin-bottom: 8px;
  font-size: 1.08rem;
}

.description {
  color: var(--muted);
  line-height: 1.4;
}

.summary-block {
  position: relative;
  margin-bottom: 10px;
}

.summary-block p {
  margin-bottom: 0;
}

.summary-block.has-more .clamp-text {
  padding-right: 68px;
}

.clamp-text {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.cooking-tips {
  margin-bottom: 0;
  border-left: 3px solid var(--accent);
  padding-left: 10px;
  color: #365247;
  font-size: 0.92rem;
  line-height: 1.4;
  font-weight: 500;
}

.cooking-tips strong {
  color: var(--accent);
  font-weight: 900;
}

.see-more {
  position: absolute;
  right: 0;
  bottom: 0;
  border: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--surface) 22%);
  color: var(--brand-dark);
  padding: 0 0 0 18px;
  font-weight: 900;
  text-decoration: underline;
}

.video-link {
  color: var(--brand-dark);
  font-weight: 800;
}

.buy-row {
  display: grid;
  grid-template-columns: 1fr 82px;
  gap: 10px;
  align-items: end;
}

.buy-row strong {
  grid-column: 1 / -1;
  font-size: 1.05rem;
}

.buy-row label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.buy-row small,
.cart-line small {
  color: #8b8082;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.25;
}

.local-only-note {
  display: block;
  margin-top: 3px;
  color: #8a3b22;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 800;
}

.buy-row input,
.cart-line input,
.customer-form input,
.customer-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 10px;
  color: var(--ink);
}

.buy-row button {
  min-height: 42px;
}

.product-card.just-added .buy-row button {
  background: var(--accent);
}

.added-message {
  margin: -2px 0 0;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 900;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  background: rgba(36, 31, 33, 0.38);
}

.drawer.open {
  display: block;
}

.drawer-panel {
  margin-left: auto;
  width: min(440px, 100%);
  height: 100%;
  overflow-y: auto;
  background: var(--paper);
  padding: 18px;
  box-shadow: -10px 0 30px rgba(36, 31, 33, 0.16);
}

.drawer-header,
.cart-line,
.totals div,
.sticky-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.icon-button,
.cart-line button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  font-weight: 900;
}

.cart-lines {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.cart-line {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.cart-line div {
  display: grid;
  gap: 2px;
}

.cart-line span {
  color: var(--muted);
  font-size: 0.9rem;
}

.cart-line input {
  max-width: 82px;
}

.cart-line.gift {
  border-color: #b7decf;
  background: #edf8f2;
}

.cart-line.suspicious {
  border-color: #d03a35;
  background: #fff5f3;
}

.cart-line em {
  color: #b22d2a;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
}

.empty,
.weight-warning {
  color: var(--muted);
  line-height: 1.4;
}

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

.totals .total {
  font-size: 1.18rem;
}

.delivery-status {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff8ef;
  color: #795338;
  font-weight: 850;
  line-height: 1.35;
}

.delivery-status.free {
  background: #eef8f1;
  color: #2f6b46;
}

.customer-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.customer-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.customer-form select {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 800;
}

.send-button {
  min-height: 50px;
  font-size: 1rem;
}

.sticky-total {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 10;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 250, 246, 0.98);
}

.sticky-total div {
  display: grid;
  gap: 2px;
}

.sticky-total span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.visit-counter {
  color: #9a8f91;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
}

.sticky-total strong {
  font-size: 1.2rem;
}

.sticky-total button {
  min-width: 140px;
  min-height: 46px;
}

.confirmation,
.quantity-guard {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(36, 31, 33, 0.52);
}

.confirmation[hidden],
.quantity-guard[hidden] {
  display: none;
}

.confirmation > div,
.quantity-guard > div {
  width: min(440px, 100%);
  border-radius: 8px;
  background: white;
  padding: 24px;
}

.confirmation p,
.quantity-guard p {
  color: var(--muted);
  line-height: 1.5;
}

.confirmation button,
.quantity-guard button {
  min-height: 44px;
  padding: 0 16px;
}

.quantity-guard {
  z-index: 42;
}

.quantity-guard ul {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 0;
  list-style: none;
}

.quantity-guard li {
  display: grid;
  gap: 4px;
  border: 1px solid #f0c4bd;
  border-radius: 8px;
  padding: 12px;
  background: #fff8f5;
}

.quantity-guard li span {
  color: var(--muted);
  line-height: 1.35;
}

.quantity-guard-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.secondary-button {
  border-color: var(--line);
  background: white;
  color: var(--ink);
}

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 35;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(36, 31, 33, 0.52);
}

.product-modal[hidden] {
  display: none;
}

.product-modal-card {
  width: min(920px, 100%);
  max-height: min(88vh, 760px);
  overflow-y: auto;
  border-radius: 8px;
  background: var(--paper);
  padding: 18px;
  box-shadow: 0 22px 52px rgba(36, 31, 33, 0.24);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.detail-media {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--warm);
  aspect-ratio: 4 / 3;
}

.detail-media img,
.detail-media .placeholder {
  width: 100%;
  height: 100%;
}

.detail-media img {
  object-fit: cover;
}

.detail-media .product-logo-fallback {
  object-fit: contain;
  padding: 42px;
}

.detail-copy {
  display: grid;
  gap: 14px;
}

.detail-price {
  color: var(--brand);
  font-size: 1.25rem;
}

.detail-copy h3 {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.92rem;
  text-transform: uppercase;
}

.detail-copy p {
  color: var(--muted);
  line-height: 1.48;
}

.cooking-methods {
  display: grid;
  gap: 10px;
}

.cooking-methods article {
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: #f2faf6;
  padding: 10px 12px;
}

.cooking-methods h4 {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.95rem;
}

.cooking-methods p {
  margin-bottom: 0;
}

.detail-buy {
  grid-template-columns: 110px 150px;
}

@media (max-width: 640px) {
  .topbar {
    grid-template-columns: minmax(78px, auto) 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
  }

  .brand-logo {
    height: 34px;
    max-width: 128px;
  }

  .eyebrow {
    display: none;
  }

  .header-links {
    justify-content: center;
    gap: 4px;
    max-width: none;
  }

  .header-link,
  .location-menu summary {
    min-width: 36px;
    min-height: 36px;
    justify-content: center;
    padding: 6px;
  }

  .header-icon,
  .header-icon svg {
    width: 23px;
    height: 23px;
  }

  .header-link-text {
    display: none;
  }

  .location-dropdown {
    position: fixed;
    top: 74px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100dvh - 92px);
    overflow-y: auto;
    transform: none;
  }

  .location-dropdown a {
    min-width: 0;
  }

  .location-dropdown strong,
  .location-dropdown span {
    overflow-wrap: anywhere;
  }

  .cart-toggle span {
    display: none;
  }

  main {
    padding: 12px;
  }

  .promo-board {
    grid-template-columns: 1fr;
  }

  .promo-board article {
    min-height: auto;
  }

  .catalog {
    grid-template-columns: 1fr;
  }

  .product-card {
    grid-template-rows: 170px 1fr;
  }

  .drawer {
    align-items: end;
  }

  .drawer.open {
    display: flex;
  }

  .drawer-panel {
    width: 100%;
    height: min(88vh, 760px);
    margin-left: 0;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -10px 28px rgba(36, 31, 33, 0.16);
  }

  .cart-line {
    align-items: start;
    display: grid;
    grid-template-columns: 1fr 78px 36px;
  }

  .product-modal {
    align-items: end;
    padding: 12px;
  }

  .product-modal-card {
    max-height: 88vh;
    border-radius: 14px 14px 0 0;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-media {
    aspect-ratio: 16 / 10;
  }

  .detail-buy {
    grid-template-columns: 1fr 1fr;
  }
}
