:root {
  color-scheme: light;
  --bg: #fff;
  --surface: #fff;
  --muted: #f5f6f7;
  --line: #eceff2;
  --text: #202326;
  --soft: #697079;
  --accent: #e74232;
  --accent-soft: #fff0ed;
  --shadow: 0 18px 48px rgba(24, 28, 32, .14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 64px;
  padding: 8px;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

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

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
}

.brand strong,
.brand span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand strong {
  font-size: 16px;
  font-weight: 650;
}

.brand span {
  color: var(--soft);
  font-size: 13px;
  margin-top: 1px;
}

.actions {
  display: flex;
  gap: 4px;
}

.icon-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.cart-badge {
  position: absolute;
  top: 6px;
  right: 5px;
  display: none;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 750;
  line-height: 18px;
}

.cart-badge.visible {
  display: block;
}

.icon-button:hover {
  background: var(--muted);
}

.icon-button svg,
.search-box svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

main {
  max-width: 1040px;
  margin: 0 auto;
}

.search-panel {
  display: none;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.search-panel.open {
  display: grid;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--muted);
  color: var(--soft);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.price-filter {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.price-chip,
.category-tab {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: #fff;
  color: var(--soft);
  white-space: nowrap;
  cursor: pointer;
}

.price-chip.active,
.category-tab.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.categories {
  position: sticky;
  top: 64px;
  z-index: 15;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 16px;
  background: rgba(255, 255, 255, .95);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.categories::-webkit-scrollbar,
.price-filter::-webkit-scrollbar {
  display: none;
}

.menu {
  display: grid;
  gap: 0;
  padding: 4px 0 28px;
}

.category-section {
  scroll-margin-top: 124px;
}

.category-title {
  margin: 0;
  padding: 20px 16px 8px;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 750;
}

.product {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  width: 100%;
  min-height: 136px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.product-main {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.product:hover {
  background: #fafafa;
}

.product-info {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.product-name {
  font-size: 16px;
  line-height: 1.35;
  font-weight: 520;
  color: #2c3034;
}

.product-desc {
  display: -webkit-box;
  margin-top: 6px;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.option-preview {
  display: block;
  -webkit-line-clamp: unset;
}

.product-price {
  margin-top: auto;
  padding-top: 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.ask-price {
  color: #5b626b;
}

.product-image {
  width: 160px;
  min-width: 160px;
  height: 112px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--muted);
}

.empty {
  padding: 54px 20px;
  color: var(--soft);
  text-align: center;
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  align-items: end;
  background: rgba(21, 24, 27, .42);
}

.drawer.open {
  display: flex;
}

.drawer-card {
  position: relative;
  width: 100%;
  max-height: 88vh;
  overflow: auto;
  border-radius: 16px 16px 0 0;
  background: #fff;
  box-shadow: var(--shadow);
}

.drawer-card .close {
  position: sticky;
  float: right;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: rgba(255, 255, 255, .92);
}

.drawer-card img {
  width: 100%;
  height: min(50vh, 420px);
  object-fit: cover;
  background: var(--muted);
}

.drawer-content {
  padding: 18px 18px 28px;
}

.drawer-content h2 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.2;
}

.drawer-content p {
  margin: 0 0 18px;
  color: var(--soft);
  line-height: 1.5;
}

.drawer-content strong {
  font-size: 20px;
}

.drawer-options {
  display: grid;
  gap: 8px;
  margin: 14px 0;
}

.drawer-quantity {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(231, 66, 50, .22);
}

.drawer-quantity[hidden] {
  display: none;
}

.drawer-quantity button {
  height: 48px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 24px;
  cursor: pointer;
}

.drawer-quantity strong {
  color: #fff;
  font-size: 18px;
  text-align: center;
}

.option-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
}

.option-row.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.option-row input {
  accent-color: var(--accent);
}

.option-row span {
  min-width: 0;
  line-height: 1.25;
}

.option-row strong {
  color: var(--accent);
  font-size: 15px;
  white-space: nowrap;
}

.add-button,
.primary-action,
.whatsapp-action {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
}

.add-button {
  grid-column: 2;
  justify-self: end;
  font-size: 13px;
  height: 34px;
  padding: 0 12px;
  box-shadow: 0 8px 18px rgba(231, 66, 50, .22);
}

.quantity {
  grid-column: 2;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 34px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(231, 66, 50, .22);
}

.quantity button {
  width: 34px;
  height: 34px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.quantity span {
  min-width: 22px;
  text-align: center;
  font-weight: 800;
}

.primary-action {
  width: 100%;
  height: 48px;
  margin-top: 18px;
}

.primary-action[disabled],
.whatsapp-action[disabled] {
  cursor: not-allowed;
  opacity: .55;
}

.basket-bar {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 35;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  border: 0;
  border-radius: 8px;
  padding: 0 18px;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.basket-bar[hidden] {
  display: none;
}

.cart-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: end;
  background: rgba(21, 24, 27, .42);
}

.cart-panel.open {
  display: flex;
}

.cart-sheet {
  width: 100%;
  max-height: 92vh;
  overflow: auto;
  border-radius: 16px 16px 0 0;
  background: #fff;
  box-shadow: var(--shadow);
}

.cart-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(12px);
}

.cart-head h2 {
  margin: 0;
  font-size: 22px;
}

.cart-items {
  padding: 8px 16px;
}

.cart-empty {
  margin: 28px 0;
  color: var(--soft);
  text-align: center;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item strong {
  display: block;
  font-size: 15px;
}

.cart-item span {
  color: #ffffff;
  font-size: 13px;
}

.cart-item em {
  display: block;
  margin-top: 3px;
  color: var(--soft);
  font-size: 13px;
  font-style: normal;
}

.cart-item .quantity {
  position: static;
  box-shadow: none;
}

.form-row {
  display: grid;
  gap: 6px;
  padding: 10px 16px 0;
  color: var(--soft);
  font-size: 13px;
}

.form-row input,
.form-row textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  outline: 0;
  resize: vertical;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  padding: 18px 16px;
  font-size: 18px;
}

.whatsapp-action {
  width: calc(100% - 32px);
  height: 50px;
  margin: 0 16px 20px;
  background: #128c4a;
}

@media (min-width: 700px) {
  .search-panel.open {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 8px;
    padding-inline: 12px;
  }

  .category-section {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 8px;
  }

  .category-title {
    grid-column: 1 / -1;
  }

  .product {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 8px;
  }

  .drawer {
    align-items: center;
    justify-content: center;
    padding: 24px;
  }

  .drawer-card {
    max-width: 560px;
    border-radius: 12px;
  }

  .basket-bar {
    left: 50%;
    right: auto;
    width: min(520px, calc(100% - 32px));
    transform: translateX(-50%);
  }

  .cart-panel {
    align-items: center;
    justify-content: center;
    padding: 24px;
  }

  .cart-sheet {
    max-width: 520px;
    border-radius: 12px;
  }
}

@media (max-width: 430px) {
  .product {
    min-height: 124px;
  }

  .product-image {
    width: 132px;
    min-width: 132px;
    height: 96px;
  }
}
