:root {
  --bg: #f5f2ec;
  --surface: #ffffff;
  --surface-soft: #fff8ef;
  --text: #201b17;
  --muted: #7c736c;
  --line: #ece4da;
  --accent: #ff8418;
  --accent-dark: #dd6200;
  --green: #168a55;
  --danger: #d94141;
  --shadow: 0 18px 50px rgba(62, 43, 24, .14);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 85% 0, rgba(255, 164, 71, .18), transparent 32rem),
    var(--bg);
  font: 15px/1.4 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.app-shell { width: min(100%, 820px); margin: 0 auto; padding: 0 16px 120px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: max(12px, env(safe-area-inset-top)) 0 12px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(18px);
}
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: linear-gradient(145deg, #ffad3e, var(--accent-dark));
  box-shadow: 0 8px 20px rgba(230, 103, 0, .25);
  font-size: 20px;
  font-weight: 900;
}
.brand-copy { flex: 1; }
.brand-copy h1 { margin: -2px 0 0; font-size: 20px; line-height: 1.2; }
.eyebrow { color: var(--accent-dark); font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.icon-button {
  position: relative;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  cursor: pointer;
}
.icon-button b {
  position: absolute;
  right: -3px;
  top: -4px;
  min-width: 18px;
  padding: 1px 5px;
  border: 2px solid var(--bg);
  border-radius: 20px;
  color: white;
  background: var(--accent-dark);
  font-size: 10px;
}
.hero {
  position: relative;
  display: flex;
  min-height: 180px;
  align-items: center;
  overflow: hidden;
  margin: 8px 0 18px;
  padding: 25px;
  border-radius: 28px;
  color: white;
  background: linear-gradient(125deg, #22201e 0%, #43301e 55%, #bd5600 100%);
  box-shadow: var(--shadow);
}
.hero > div:first-child { position: relative; z-index: 2; width: min(74%, 480px); }
.hero h2 { margin: 8px 0 7px; font-size: clamp(27px, 7vw, 42px); line-height: 1.03; letter-spacing: -.04em; }
.hero p { margin: 0; color: rgba(255,255,255,.74); }
.hero-badge { padding: 6px 9px; border: 1px solid rgba(255,255,255,.18); border-radius: 20px; background: rgba(255,255,255,.1); font-size: 11px; font-weight: 700; }
.mango-orbit {
  position: absolute;
  right: -34px;
  display: grid;
  width: 170px;
  height: 170px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  background: rgba(255,255,255,.06);
}
.mango-orbit::before { content: ""; position: absolute; inset: 20px; border: 1px dashed rgba(255,255,255,.2); border-radius: inherit; }
.mango-orbit span { transform: rotate(-10deg); font-size: 70px; filter: drop-shadow(0 12px 15px rgba(0,0,0,.25)); }
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 8px 25px rgba(62,43,24,.05);
}
.search-box > span { color: var(--muted); font-size: 25px; transform: rotate(-15deg); }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--text); background: transparent; }
.clear-search { border: 0; color: var(--muted); background: none; font-size: 24px; cursor: pointer; }
.category-strip { display: flex; gap: 8px; overflow-x: auto; margin: 15px -16px 3px; padding: 0 16px 8px; scrollbar-width: none; }
.category-strip::-webkit-scrollbar { display: none; }
.category-chip { flex: 0 0 auto; padding: 9px 13px; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); background: var(--surface); font-size: 13px; font-weight: 700; cursor: pointer; }
.category-chip.active { border-color: var(--accent); color: #713100; background: #fff0de; box-shadow: inset 0 0 0 1px rgba(255,132,24,.12); }
.category-chip small { margin-left: 5px; opacity: .65; }
.catalog-section { margin-top: 19px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 12px; }
.section-heading h2 { margin: 1px 0 0; font-size: 24px; letter-spacing: -.03em; }
.product-counter { color: var(--muted); font-size: 13px; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.product-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 8px 22px rgba(53,37,22,.06); cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.product-card:active { transform: scale(.98); }
.product-photo { position: relative; aspect-ratio: 1/1; overflow: hidden; background: linear-gradient(145deg, #f9f7f3, #ece7df); }
.product-photo img { width: 100%; height: 100%; object-fit: contain; padding: 8px; transition: transform .25s ease; }
.product-card:hover .product-photo img { transform: scale(1.04); }
.photo-badge { position: absolute; right: 8px; top: 8px; padding: 4px 7px; border-radius: 12px; color: white; background: rgba(28,25,22,.68); backdrop-filter: blur(8px); font-size: 10px; font-weight: 800; }
.sold-out { position: absolute; inset: 0; display: grid; place-items: center; color: white; background: rgba(31,28,26,.55); font-weight: 800; }
.product-body { padding: 12px; }
.product-category { color: var(--accent-dark); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.product-card h3 { min-height: 38px; margin: 5px 0 9px; font-size: 14px; line-height: 1.28; }
.product-footer { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.product-price { font-size: 16px; }
.quick-add { width: 34px; height: 34px; border: 0; border-radius: 12px; color: white; background: var(--accent); font-size: 21px; cursor: pointer; }
.quick-add:disabled { color: var(--muted); background: #eee9e3; cursor: default; }
.load-more { width: 100%; margin-top: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 16px; color: var(--accent-dark); background: var(--surface); font-weight: 800; cursor: pointer; }
.empty-state, .cart-empty { padding: 45px 20px; text-align: center; color: var(--muted); }
.empty-state span, .cart-empty span { font-size: 42px; }
.empty-state h3, .cart-empty h3 { margin: 10px 0 4px; color: var(--text); }
.empty-state p, .cart-empty p { margin: 0; }
.cart-dock {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  display: grid;
  width: min(calc(100% - 28px), 580px);
  min-height: 64px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  padding: 10px 15px;
  border: 0;
  border-radius: 21px;
  color: white;
  background: #25211e;
  box-shadow: 0 18px 45px rgba(27,19,13,.3);
  transform: translateX(-50%);
  text-align: left;
  cursor: pointer;
}
.cart-dock-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 14px; background: var(--accent); }
.cart-dock b, .cart-dock small { display: block; }
.cart-dock small { color: rgba(255,255,255,.58); }
.cart-dock strong { font-size: 17px; }
.overlay { position: fixed; z-index: 40; inset: 0; background: rgba(25,20,17,.5); backdrop-filter: blur(3px); }
.sheet {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: 0;
  width: min(100%, 620px);
  max-height: 94dvh;
  overflow-y: auto;
  border-radius: 28px 28px 0 0;
  background: var(--surface);
  box-shadow: 0 -20px 55px rgba(32,22,15,.22);
  transform: translateX(-50%);
  animation: sheet-in .24s ease-out;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}
@keyframes sheet-in { from { transform: translate(-50%, 30px); opacity: 0; } }
.sheet-handle { position: sticky; z-index: 3; top: 7px; width: 42px; height: 5px; margin: 7px auto -12px; border-radius: 8px; background: #d8d1c9; }
.sheet-close { position: absolute; z-index: 4; right: 14px; top: 16px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(30,25,21,.72); color: white; font-size: 24px; cursor: pointer; }
.gallery { position: relative; display: grid; height: min(55vh, 430px); place-items: center; overflow: hidden; background: linear-gradient(145deg, #faf8f5, #eee8df); }
.gallery img { width: 100%; height: 100%; object-fit: contain; padding: 28px; }
.gallery-nav { position: absolute; z-index: 2; top: 50%; width: 40px; height: 40px; border: 0; border-radius: 50%; color: white; background: rgba(35,30,26,.58); font-size: 27px; transform: translateY(-50%); cursor: pointer; }
.gallery-prev { left: 12px; } .gallery-next { right: 12px; }
.gallery-count { position: absolute; right: 14px; bottom: 12px; padding: 5px 9px; border-radius: 20px; color: white; background: rgba(35,30,26,.64); font-size: 11px; font-weight: 800; }
.sheet-content { padding: 20px 18px 0; }
.stock-pill { display: inline-block; padding: 5px 9px; border-radius: 20px; color: var(--green); background: #e9f8f0; font-size: 11px; font-weight: 800; }
.stock-pill.out { color: var(--danger); background: #fff0f0; }
.sheet-content h2, .cart-header h2 { margin: 8px 0 4px; font-size: 25px; line-height: 1.15; }
.product-meta { display: flex; align-items: center; justify-content: space-between; margin: 9px 0 20px; color: var(--muted); }
.product-meta strong { color: var(--text); font-size: 21px; }
.quantity-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; padding: 13px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface-soft); }
.quantity-row span, .quantity-row small { display: block; }.quantity-row span { font-weight: 800; }.quantity-row small { color: var(--muted); font-size: 11px; }
.stepper { display: grid; grid-template-columns: 38px 42px 38px; align-items: center; text-align: center; }
.stepper button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 12px; color: var(--accent-dark); background: white; font-size: 21px; cursor: pointer; }
.primary-button { display: flex; width: 100%; min-height: 54px; align-items: center; justify-content: space-between; gap: 10px; padding: 0 18px; border: 0; border-radius: 17px; color: white; background: linear-gradient(135deg, var(--accent), var(--accent-dark)); box-shadow: 0 12px 25px rgba(223,99,0,.23); font-weight: 800; cursor: pointer; }
.primary-button:disabled { opacity: .45; box-shadow: none; cursor: default; }
.cart-sheet { padding: 25px 18px max(18px, env(safe-area-inset-bottom)); }
.cart-header { display: flex; align-items: end; justify-content: space-between; margin: 10px 0 16px; }
.cart-header h2 { margin-top: 2px; }.cart-header span { color: var(--muted); }
.cart-list { display: grid; gap: 10px; }
.cart-item { display: grid; grid-template-columns: 68px minmax(0,1fr) auto; gap: 11px; align-items: center; padding: 9px; border: 1px solid var(--line); border-radius: 17px; }
.cart-item img { width: 68px; height: 68px; object-fit: contain; border-radius: 12px; background: #f5f1eb; }
.cart-item h3 { overflow: hidden; margin: 0 0 5px; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.cart-item-price { font-size: 13px; font-weight: 800; }
.cart-item .stepper { grid-template-columns: 30px 30px 30px; }.cart-item .stepper button { width: 30px; height: 30px; border-radius: 9px; font-size: 17px; }
.remove-item { grid-column: 3; border: 0; color: var(--danger); background: none; font-size: 18px; cursor: pointer; }
.checkout-panel { margin-top: 17px; padding: 15px; border-radius: 20px; background: #292521; color: white; }
.payment-row { display: flex; justify-content: space-between; padding: 5px 2px; color: rgba(255,255,255,.68); }.payment-row b { color: white; }
.total-row { margin: 8px 0 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.12); color: white; font-size: 18px; }
.checkout-note { margin: 10px 4px 0; color: rgba(255,255,255,.48); font-size: 10px; text-align: center; }
.toast { position: fixed; z-index: 80; left: 50%; bottom: 95px; width: min(calc(100% - 40px), 420px); padding: 13px 16px; border-radius: 14px; color: white; background: #26221f; box-shadow: var(--shadow); transform: translateX(-50%); text-align: center; animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }
.hidden { display: none !important; }
body.sheet-open { overflow: hidden; }

@media (min-width: 660px) {
  .app-shell { padding-inline: 24px; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { min-height: 220px; padding: 34px; }
}

@media (prefers-color-scheme: dark) {
  :root { --bg: #171513; --surface: #24211e; --surface-soft: #2c2722; --text: #f8f3ec; --muted: #a99e94; --line: #39332e; --shadow: 0 18px 50px rgba(0,0,0,.28); }
  .product-photo, .gallery { background: linear-gradient(145deg, #2b2825, #1c1a18); }
  .stepper button { background: #342e29; }.quick-add:disabled { background: #3b3631; }
}
