:root {
  --bg: #f3e8ed;
  --card: #fff8f6;
  --ink: #2b2029;
  --ink-2: #594657;
  --muted: #927f8e;
  --line: #e2cad6;
  --rose: #c98fa5;
  --rose-soft: #f1d8e2;
  --purple: #6d4d7d;
  --purple-2: #8a6a99;
  --purple-soft: #eadff0;
  --butter: #dfc678;
  --shadow: 0 18px 50px rgba(86, 56, 78, .14);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font-family: Manrope, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; }
body { overscroll-behavior: none; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(circle at 86% 8%, rgba(201, 143, 165, .28), transparent 24rem), linear-gradient(180deg, #f8eef3 0%, var(--bg) 42%, #efe2ea 100%);
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  height: calc(54px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 14px 0;
  border-bottom: 1px solid rgba(226, 202, 214, .86);
  background: rgba(243, 232, 237, .88);
  backdrop-filter: blur(18px);
}

.brand { justify-self: center; font-family: "Instrument Serif", Georgia, serif; font-size: 26px; font-style: italic; line-height: 1; }
.brand span { display: inline-block; width: 6px; height: 6px; margin: 0 1px 7px; border-radius: 50%; background: var(--rose); }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--ink-2); background: transparent; }

.view {
  height: calc(100vh - 54px - env(safe-area-inset-top));
  height: calc(100dvh - 54px - env(safe-area-inset-top));
  overflow: auto;
  padding: 14px 18px calc(98px + env(safe-area-inset-bottom));
  scrollbar-width: none;
}

.view::-webkit-scrollbar, .rail::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.hero { padding: 6px 2px 18px; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.serif { font-family: "Instrument Serif", Georgia, serif; font-size: 36px; line-height: .98; letter-spacing: 0; }
.serif em { color: var(--purple); font-style: italic; }

.quick-grid { display: grid; grid-template-columns: 1.22fr 1fr 1fr; gap: 9px; margin-bottom: 24px; }
.quick-card { min-height: 104px; padding: 14px; display: flex; flex-direction: column; justify-content: space-between; border: 0; border-radius: 18px; color: var(--fg); background: var(--bgc); box-shadow: 0 10px 28px rgba(76, 47, 70, .08); text-align: left; }
.quick-card strong { display: block; margin-top: 2px; font-size: 16px; line-height: 1.1; }
.quick-card small { display: block; color: currentColor; opacity: .7; }

.section-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin: 0 2px 12px; }
.section-head h2 { margin: 4px 0 0; font-family: "Instrument Serif", Georgia, serif; font-size: 24px; line-height: 1; font-weight: 400; }
.link-btn { border: 0; background: transparent; color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.rail { display: flex; gap: 14px; margin: 0 -18px 24px; padding: 0 18px; overflow-x: auto; scrollbar-width: none; }

.product-card { flex: 0 0 164px; }
.product-card.grid { flex: initial; }
.product-art { position: relative; height: 164px; margin-bottom: 10px; border-radius: 16px; overflow: hidden; display: grid; place-items: center; background: linear-gradient(140deg, rgba(255, 255, 255, .34), transparent 42%), repeating-linear-gradient(135deg, rgba(109, 77, 125, .08) 0, rgba(109, 77, 125, .08) 6px, transparent 6px, transparent 12px), var(--tone); }
.pack { width: 74px; height: 100px; display: grid; place-items: center; border-radius: 18px 18px 14px 14px; background: rgba(255, 255, 255, .82); color: var(--purple); font-family: "Instrument Serif", Georgia, serif; font-size: 35px; box-shadow: var(--shadow); }
.product-img { width: 100%; height: 100%; object-fit: contain; padding: 18px; filter: drop-shadow(0 14px 24px rgba(86, 56, 78, .18)); }
.heart, .add { position: absolute; right: 10px; top: 10px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 50%; color: var(--ink-2); background: rgba(255, 255, 255, .88); }
.add { top: auto; bottom: 10px; color: #fff; background: var(--purple); }
.pill { position: absolute; left: 10px; top: 10px; padding: 5px 9px; border-radius: 999px; background: rgba(255, 255, 255, .9); color: var(--ink); font-size: 10px; font-weight: 700; }
.product-title { margin: 0 0 3px; font-weight: 700; line-height: 1.24; }
.subtle { color: var(--muted); font-size: 12px; }
.price { display: flex; gap: 7px; align-items: baseline; margin-top: 7px; font-weight: 800; }
.old { color: var(--muted); font-size: 12px; font-weight: 500; text-decoration: line-through; }

.banner { position: relative; margin-bottom: 24px; padding: 22px; overflow: hidden; border-radius: 22px; color: #fff7f2; background: linear-gradient(135deg, #51325f, var(--purple)); }
.banner:before, .banner:after { content: ""; position: absolute; border-radius: 50%; opacity: .55; }
.banner:before { width: 150px; height: 150px; right: -42px; top: -46px; background: var(--rose); }
.banner:after { width: 96px; height: 96px; right: 52px; bottom: -45px; background: var(--butter); }
.banner > * { position: relative; }
.banner h2 { max-width: 250px; margin: 9px 0; font-family: "Instrument Serif", Georgia, serif; font-size: 27px; font-weight: 400; line-height: 1; }

.search { height: 46px; display: flex; align-items: center; gap: 10px; margin-bottom: 14px; padding: 0 14px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255, 248, 246, .88); }
.search input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--ink); background: transparent; }
.chips { display: flex; gap: 8px; margin: 0 -18px 16px; padding: 0 18px; overflow-x: auto; }
.chip { height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); background: rgba(255, 248, 246, .82); white-space: nowrap; }
.chip.active { border-color: var(--purple); color: #fff; background: var(--purple); }

.size-grid, .stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-bottom: 18px; }
.size { padding: 9px 0; border: 1px solid var(--line); border-radius: 13px; text-align: center; background: var(--card); }
.size.active { border-color: var(--ink); color: #fff; background: var(--ink); }
.size strong { display: block; }
.size span { color: inherit; opacity: .7; font-size: 10px; }
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.panel { border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 248, 246, .9); box-shadow: 0 12px 38px rgba(86, 56, 78, .08); }
.cart-row, .order-row, .menu-row { display: flex; align-items: center; gap: 14px; padding: 15px; border-bottom: 1px solid var(--line); }
.cart-row:last-child, .order-row:last-child, .menu-row:last-child { border-bottom: 0; }
.thumb { width: 70px; height: 70px; flex: 0 0 70px; display: grid; place-items: center; border-radius: 15px; color: var(--purple); background: var(--purple-soft); }
.qty { display: inline-flex; align-items: center; gap: 4px; padding: 2px; border-radius: 999px; background: var(--rose-soft); }
.qty button { width: 27px; height: 27px; border: 0; border-radius: 50%; background: transparent; }
.qty button:last-child { color: #fff; background: var(--purple); }
.summary { display: grid; gap: 9px; margin-top: 18px; padding: 17px; }
.summary-row { display: flex; justify-content: space-between; color: var(--ink-2); }
.total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; padding-top: 13px; border-top: 1px solid var(--line); }
.total strong { font-family: "Instrument Serif", Georgia, serif; font-size: 30px; font-weight: 400; }
.primary { width: 100%; height: 54px; margin-top: 16px; border: 0; border-radius: 999px; color: #fff; background: var(--purple); font-weight: 800; }
.secondary { height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: transparent; font-weight: 700; }

.progress { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); margin: 18px 0 12px; }
.progress:before, .progress:after { content: ""; position: absolute; left: 10%; right: 10%; top: 8px; height: 2px; background: var(--line); }
.progress:after { right: 38%; background: var(--purple); }
.step { position: relative; z-index: 1; text-align: center; font-size: 10px; color: var(--muted); }
.step:before { content: ""; display: block; width: 16px; height: 16px; margin: 0 auto 8px; border: 2px solid var(--line); border-radius: 50%; background: var(--card); }
.step.done { color: var(--ink); font-weight: 700; }
.step.done:before { border-color: var(--purple); background: var(--purple); }

.profile-card { display: flex; align-items: center; gap: 15px; padding: 18px; margin-bottom: 16px; }
.avatar { width: 58px; height: 58px; flex: 0 0 58px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg, var(--rose), var(--purple-2)); font-family: "Instrument Serif", Georgia, serif; font-size: 30px; }
.stats-grid { grid-template-columns: repeat(3, 1fr); margin-bottom: 16px; }
.stat { padding: 14px 10px; border-radius: 15px; background: rgba(255, 248, 246, .72); }
.stat strong { display: block; font-family: "Instrument Serif", Georgia, serif; font-size: 24px; font-weight: 400; }
.menu-row .icon { width: 38px; height: 38px; flex: 0 0 38px; padding: 9px; border-radius: 12px; color: var(--purple); background: var(--purple-soft); }

.tabbar { position: absolute; right: 0; bottom: 0; left: 0; z-index: 6; height: calc(78px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 10px 8px calc(18px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(226, 202, 214, .92); background: rgba(243, 232, 237, .92); backdrop-filter: blur(22px); }
.tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; border: 0; color: var(--muted); background: transparent; font-size: 10px; font-weight: 700; }
.tab.active { color: var(--purple); }
.badge { position: absolute; top: 1px; right: calc(50% - 23px); min-width: 17px; padding: 1px 5px; border-radius: 999px; color: #fff; background: var(--rose); font-size: 9px; line-height: 1.45; }

.icon { width: 22px; height: 22px; display: inline-block; background: currentColor; mask: var(--mask) center / contain no-repeat; -webkit-mask: var(--mask) center / contain no-repeat; }
.icon-home { --mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3.5 10.5 12 4l8.5 6.5V20h-5v-6h-7v6h-5z'/%3E%3C/svg%3E"); }
.icon-bag { --mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 8h14l-1 13H6zm4 0a3 3 0 0 1 6 0h-2a1 1 0 0 0-2 0z'/%3E%3C/svg%3E"); }
.icon-cart { --mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 4h3l2 11h10l2-8H8l.4 2h9l-1 4H9.7L7.8 2H3zm7 15.5A1.5 1.5 0 1 1 7 19.5a1.5 1.5 0 0 1 3 0m9 0a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0'/%3E%3C/svg%3E"); }
.icon-box { --mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m12 3 9 4v10l-9 4-9-4V7zm0 2.2L6.3 7.7 12 10.2l5.7-2.5zm-7 4V16l6 2.7V12zm14 0L13 12v6.7l6-2.7z'/%3E%3C/svg%3E"); }
.icon-user { --mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8m0 2c-4.4 0-8 2.4-8 6h16c0-3.6-3.6-6-8-6'/%3E%3C/svg%3E"); }
.icon-close { --mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='m6.4 5 12.6 12.6-1.4 1.4L5 6.4zm11.2 0L19 6.4 6.4 19 5 17.6z'/%3E%3C/svg%3E"); }
.icon-plus { --mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 5h2v6h6v2h-6v6h-2v-6H5v-2h6z'/%3E%3C/svg%3E"); }
.icon-search { --mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 4a6.5 6.5 0 0 1 5.1 10.5l4 4-1.4 1.4-4-4A6.5 6.5 0 1 1 10.5 4m0 2a4.5 4.5 0 1 0 0 9 4.5 4.5 0 0 0 0-9'/%3E%3C/svg%3E"); }
.icon-heart { --mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 21S4 16 4 9.8A4.8 4.8 0 0 1 12 6a4.8 4.8 0 0 1 8 3.8C20 16 12 21 12 21'/%3E%3C/svg%3E"); }
.icon-gift { --mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4 9h16v4H4zm2 5h5v7H6zm7 0h5v7h-5zM8.5 3C10 3 11 4.3 12 6c1-1.7 2-3 3.5-3A2.5 2.5 0 0 1 18 5.5C18 7 16.8 8 15 8H9C7.2 8 6 7 6 5.5A2.5 2.5 0 0 1 8.5 3'/%3E%3C/svg%3E"); }

@media (min-width: 520px) {
  body { display: grid; place-items: center; min-height: 100vh; background: #e7d8e1; }
  .app-shell { width: 430px; max-width: 100vw; min-height: 820px; max-height: 100vh; border-inline: 1px solid rgba(226, 202, 214, .9); box-shadow: var(--shadow); }
}
