:root {
  --bg: #1d3161;
  --bg-deep: #0e1b42;
  --card: #102050;
  --cream: #fdeeb8;
  --cream-2: #f7e3a1;
  --maroon: #6b1212;
  --price: #f3dd9b;
  --text: #ffffff;
  --muted: #cfd7ea;
  --line: rgba(4, 10, 32, .38);
  --radius: 16px;
  --gutter: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* the page never zooms: no pinch / double-tap zoom, no font auto-inflation on rotate */
html { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.4 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 var(--gutter) 120px; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 0 14px;
}
.brand { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.info-btn { color: #fff; display: grid; place-items: center; width: 30px; height: 30px; }
.lang { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 12px;
  border-radius: 999px; background: #fff; color: #111; font-weight: 600;
}
.lang-btn svg { color: #111; }
.lang-menu {
  position: absolute; right: 0; top: 46px; z-index: 40; min-width: 92px; padding: 4px 0;
  background: #fff; border-radius: 6px; box-shadow: 0 8px 28px rgba(0,0,0,.35); overflow: hidden;
}
.lang-menu button { display: block; width: 100%; padding: 10px 20px; color: #111; font-size: 17px; text-align: center; }
.lang-menu button.on { background: #3b82f6; color: #fff; }

/* ---------- banners ---------- */
.banners {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  margin: 0 calc(-1 * var(--gutter)) 16px; padding: 0 var(--gutter);
  scrollbar-width: none;
}
.banners::-webkit-scrollbar { display: none; }
.banner {
  flex: 0 0 min(82%, 420px); aspect-ratio: 19 / 10; scroll-snap-align: start;
  border-radius: var(--radius); overflow: hidden; background: var(--card);
}
.banner img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- search ---------- */
.search {
  display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px;
  border: 1.5px solid rgba(255,255,255,.75); border-radius: 12px; background: var(--bg-deep);
  color: #aab4cc; margin-bottom: 16px;
}
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font-size: 17px; color: #fff; }
.search input::placeholder { color: #9aa6c2; }
.search:focus-within { border-color: var(--cream); }

.notice {
  margin: 0 0 16px; padding: 12px 16px; border-radius: 12px;
  background: rgba(253, 238, 184, .12); border: 1px solid rgba(253, 238, 184, .35); color: var(--cream);
  font-weight: 500;
}

/* ---------- section cards ---------- */
.sections {
  display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--gutter)) 18px; padding: 0 var(--gutter);
}
.sections::-webkit-scrollbar { display: none; }
.sec {
  flex: 0 0 132px; display: flex; flex-direction: column; text-align: left;
  border-radius: 14px; background: var(--card); padding: 5px 5px 12px; min-height: 160px;
  transition: background .2s, color .2s;
}
.sec-img {
  aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #1b2d5e;
  display: grid; place-items: center;
}
.sec-img img { width: 100%; height: 100%; object-fit: cover; }
.sec-img svg { width: 46px; height: 46px; color: var(--cream); opacity: .9; }
.sec span { padding: 10px 8px 0; font-size: 15px; line-height: 1.2; font-weight: 500; color: #e9edf7; }
.sec.on { background: var(--cream); }
.sec.on span { color: var(--maroon); }
.sec.on .sec-img { background: #f0d98f; }
.sec.on .sec-img svg { color: var(--maroon); }

/* ---------- category pills ---------- */
.cats {
  position: sticky; top: 0; z-index: 20;
  display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(-1 * var(--gutter)); padding: 10px var(--gutter);
  background: var(--bg);
}
.cats.stuck { box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.cats::-webkit-scrollbar { display: none; }
.pill {
  flex: 0 0 auto; height: 46px; padding: 0 20px; border-radius: 999px;
  background: var(--bg-deep); color: #e7ebf6; font-size: 17px; white-space: nowrap;
  transition: background .2s, color .2s;
}
.pill.on { background: var(--cream); color: var(--maroon); }

/* ---------- list ---------- */
.cat-title { margin: 26px 0 8px; font-size: 30px; font-weight: 800; letter-spacing: -.01em; scroll-margin-top: 76px; }
.item {
  display: flex; gap: 16px; padding: 16px 0; border-bottom: 1.5px solid var(--line);
}
.thumb {
  flex: 0 0 auto; width: 132px; height: 132px; border-radius: 14px; overflow: hidden; background: #22386c; cursor: zoom-in;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.body h3 { margin: 0 0 6px; font-size: 18px; font-weight: 700; line-height: 1.25; cursor: pointer; }
.body h3 .star { color: #f6c445; margin-right: 4px; }
.desc { margin: 0 0 10px; color: var(--muted); font-size: 15px; line-height: 1.4; }
.item.has-img .desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.row { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.price { color: var(--price); font-weight: 700; font-size: 19px; white-space: nowrap; }
.add {
  width: 40px; height: 40px; border-radius: 50%; background: var(--bg-deep); color: #fff;
  display: grid; place-items: center; flex: 0 0 auto; transition: transform .15s;
}
.add:active { transform: scale(.9); }
.stepper {
  display: flex; align-items: center; background: var(--cream); color: var(--maroon);
  border-radius: 999px; height: 40px; font-weight: 700;
}
.stepper button { width: 40px; height: 40px; display: grid; place-items: center; color: var(--maroon); }
.stepper b { min-width: 22px; text-align: center; font-size: 17px; }
.item.sold { opacity: .5; }
.item.sold .thumb { filter: grayscale(.9); }
.sold-tag { font-size: 13px; font-weight: 600; color: var(--cream); border: 1px solid rgba(253,238,184,.5); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }
.empty { padding: 48px 0; text-align: center; color: var(--muted); }

.loading { display: flex; gap: 8px; justify-content: center; padding: 60px 0; }
.loading span { width: 10px; height: 10px; border-radius: 50%; background: var(--cream); animation: blink 1s infinite alternate; }
.loading span:nth-child(2) { animation-delay: .2s; }
.loading span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { from { opacity: .2; } to { opacity: 1; } }

.foot { text-align: center; color: #8d9abb; font-size: 13px; padding: 40px 0 0; }

/* ---------- floating ---------- */
.to-top {
  position: fixed; left: max(16px, env(safe-area-inset-left)); bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 30;
  width: 60px; height: 60px; border-radius: 50%; background: var(--cream); color: var(--maroon);
  display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.3);
}
.cart-bar {
  position: fixed; z-index: 35; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom));
  width: min(calc(100% - 32px), 560px); height: 62px; padding: 0 20px 0 12px;
  display: flex; align-items: center; gap: 12px; border-radius: 18px;
  background: var(--cream); color: var(--maroon); font-weight: 700; font-size: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
  animation: rise .25s ease-out;
}
.cart-bar.bump { animation: bump .3s; }
.cart-ico { position: relative; width: 42px; height: 42px; border-radius: 12px; background: var(--maroon); color: var(--cream); display: grid; place-items: center; }
.cart-ico b { position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; background: #fff; color: var(--maroon); font-size: 13px; display: grid; place-items: center; }
.cart-sum { margin-left: auto; }
@keyframes rise { from { transform: translate(-50%, 30px); opacity: 0; } }
@keyframes bump { 50% { transform: translateX(-50%) scale(1.04); } }

/* ---------- sheet ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(3, 8, 25, .6); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; z-index: 51; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(100%, 640px); max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--bg); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.4);
  animation: up .28s cubic-bezier(.2,.8,.2,1);
}
@keyframes up { from { transform: translate(-50%, 100%); } }
.sheet-grip { width: 44px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.3); margin: 10px auto 0; flex: 0 0 auto; }
.sheet-close { position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; border-radius: 50%; background: var(--bg-deep); display: grid; place-items: center; z-index: 2; }
.sheet-body { overflow-y: auto; padding: 8px 20px calc(24px + env(safe-area-inset-bottom)); overscroll-behavior: contain; }
.sheet h2 { font-size: 26px; font-weight: 800; margin: 12px 48px 16px 0; }

.big-img { margin: 8px -20px 16px; aspect-ratio: 1 / 1; max-height: 56vh; background: #22386c; overflow: hidden; }
.big-img img { width: 100%; height: 100%; object-fit: cover; }
.detail-desc { color: var(--muted); font-size: 16px; line-height: 1.5; margin: 0 0 20px; white-space: pre-line; }
.detail-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.detail-row .price { font-size: 24px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 56px; padding: 0 24px; border-radius: 16px; width: 100%;
  background: var(--cream); color: var(--maroon); font-weight: 700; font-size: 18px;
}
.btn:disabled { opacity: .6; cursor: default; }
.btn.ghost { background: var(--bg-deep); color: #fff; }
.btn.inline { width: auto; height: 48px; }

.cart-line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1.5px solid var(--line); }
.cart-line .mini { width: 52px; height: 52px; border-radius: 10px; overflow: hidden; flex: 0 0 auto; background: #22386c; }
.cart-line .mini img { width: 100%; height: 100%; object-fit: cover; }
.cart-line .nm { flex: 1; min-width: 0; }
.cart-line .nm b { display: block; font-weight: 600; font-size: 16px; }
.cart-line .nm span { color: var(--price); font-weight: 600; font-size: 15px; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 0 8px; font-size: 18px; }
.cart-total b { font-size: 26px; color: var(--price); }
.link-btn { color: var(--muted); text-decoration: underline; font-size: 14px; }

.form { display: grid; gap: 14px; margin-top: 18px; }
.field label { display: block; font-size: 14px; color: var(--muted); margin: 0 0 6px 2px; }
.field input, .field textarea {
  width: 100%; height: 52px; padding: 0 16px; border-radius: 12px; outline: 0;
  border: 1.5px solid rgba(255,255,255,.25); background: var(--bg-deep); color: #fff; font-size: 17px;
}
.field textarea { height: 88px; padding: 12px 16px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--cream); }
.field.err input { border-color: #ff8a8a; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 14px; background: var(--bg-deep); }
.seg button { height: 44px; border-radius: 10px; font-weight: 600; color: #dfe5f3; }
.seg button.on { background: var(--cream); color: var(--maroon); }
.form-err { color: #ffb0b0; font-size: 15px; min-height: 1px; }

.success { text-align: center; padding: 24px 0 8px; }
.success .check { width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 50%; background: var(--cream); color: var(--maroon); display: grid; place-items: center; animation: pop .4s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.success h2 { margin: 0 0 10px; }
.success p { color: var(--muted); margin: 0 0 6px; }
.success .num { font-size: 30px; font-weight: 800; color: var(--price); letter-spacing: .04em; margin: 8px 0 24px; }

.toast {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%);
  bottom: calc(92px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px);
  background: #fff; color: #111; padding: 12px 18px; border-radius: 12px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.35); animation: fade .2s;
}

@media (min-width: 720px) {
  :root { --gutter: 24px; }
  .brand { font-size: 40px; }
  .sec { flex-basis: 150px; }
  .thumb { width: 168px; height: 168px; }
  .body h3 { font-size: 19px; }
  .sheet { bottom: auto; top: 50%; transform: translate(-50%, -50%); border-radius: 22px; max-height: 88vh; animation: fade .2s; }
  .sheet-grip { display: none; }
  .big-img { margin: 0 -20px 16px; border-radius: 22px 22px 0 0; max-height: 50vh; }
}
@media (max-width: 380px) {
  .thumb { width: 104px; height: 104px; }
  .body h3 { font-size: 16px; }
  .price { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- info sheet ---------- */
.info-logo { margin: 8px -20px 8px; background: #133361; display: grid; place-items: center; }
.info-logo img { width: 100%; max-height: 220px; object-fit: contain; }
.info-tag { margin: -10px 0 14px; color: var(--muted); }
.info-list { display: grid; gap: 10px; margin-top: 8px; }
.info-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--bg-deep); color: #fff; text-decoration: none; }
.info-row small { display: block; color: var(--muted); font-size: 13px; }
.info-ico { width: 44px; height: 44px; border-radius: 50%; background: var(--cream); color: var(--maroon); display: grid; place-items: center; flex: 0 0 auto; }

/* ---------- start page ---------- */
.home { min-height: 100vh; min-height: 100dvh; background: var(--bg); }
.home-hero { position: relative; display: grid; place-items: center; padding: 64px 16px 36px; background: var(--bg-deep); }
.home-hero img { width: min(64%, 300px); height: auto; }
.home-lang { position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px; }
.home-lang .lang-btn { height: 34px; padding: 0 10px 0 14px; gap: 4px; font-size: 15px; }
.home-body { max-width: 640px; margin: 0 auto; padding: 24px var(--gutter) 48px; }
.home-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.home-title h1 { margin: 0; font-size: clamp(26px, 7.5vw, 34px); font-weight: 800; letter-spacing: -.01em; }
.home-tag { margin: 6px 0 22px; color: var(--muted); font-size: 17px; }
.home-panel { display: grid; gap: 10px; margin: 0 calc(-1 * var(--gutter)) 18px; padding: 16px var(--gutter); border-radius: 28px; background: rgba(255, 255, 255, .04); }
.home-panel:empty { display: none; }
.home-cta {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 0 16px 0 20px;
  border-radius: 18px; background: var(--cream); color: var(--maroon); font-size: 19px; font-weight: 500; text-align: left;
}
.home-cta .chev, .home-row .chev { margin-left: auto; width: 30px; height: 30px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; }
.home-cta .chev { background: var(--maroon); color: var(--cream); }
.home-row {
  display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; border-radius: 18px;
  background: rgba(255, 255, 255, .06); color: var(--text); text-decoration: none; font-size: 17px; line-height: 1.3;
}
.home-row small { display: block; color: var(--muted); font-size: 13px; margin-bottom: 2px; }
.home-row .ico { flex: 0 0 auto; color: var(--muted); display: grid; place-items: center; }
.home-row .chev { background: rgba(255, 255, 255, .12); color: var(--text); width: 26px; height: 26px; }
.home-row .info-ico { width: 40px; height: 40px; }
.back-btn { width: 32px; height: 32px; border-radius: 50%; background: var(--muted); color: var(--bg); display: grid; place-items: center; flex: 0 0 auto; }
.brand .back-btn { margin-right: 2px; }
.price-tbd { color: var(--muted); font-weight: 500; font-size: 15px; }
.cart-note { margin: -4px 0 8px; color: var(--muted); font-size: 14px; text-align: right; }
