:root {
  --btn-bg: #000;
  --btn-text: #fff;
  --accent: #e2231a;
  --ink: #141b2e;
  --muted: #6b7280;
  --surface: #fff;
  --sheet-radius: 28px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: #0c0c0f;
}

/* Desktop: center a phone frame. Mobile: fill screen. */
.stage {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 0;
}

.phone {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  overflow: hidden;
  background: #000;
}

@media (min-width: 480px) {
  .stage { padding: 24px; background: radial-gradient(120% 80% at 50% 0%, #1b1b22 0%, #0c0c0f 70%); }
  .phone {
    height: min(900px, 92dvh);
    border-radius: 44px;
    box-shadow: 0 40px 90px -20px rgba(0,0,0,.7), 0 0 0 11px #1c1c20, 0 0 0 13px #2c2c32;
  }
}

/* ---------- screens ---------- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s var(--ease);
  overflow: hidden;
}
.screen.active { opacity: 1; pointer-events: auto; }

/* full-bleed media background screens */
.media-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.media-screen { background: #111; }
.media-screen::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(0,0,0,.05) 40%, rgba(0,0,0,.25) 100%);
  pointer-events: none;
}
/* fallback when no splash media is supplied */
.media-bg.solid { background: linear-gradient(160deg, var(--accent) 0%, var(--ink) 130%); }

/* ---------- bottom sheet ---------- */
.sheet {
  position: relative;
  z-index: 2;
  margin-top: auto;
  background: var(--surface);
  border-radius: var(--sheet-radius) var(--sheet-radius) 0 0;
  padding: 14px 22px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -18px 50px -20px rgba(0,0,0,.35);
  animation: sheetUp .45s var(--ease) both;
}
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.grabber { width: 44px; height: 5px; border-radius: 99px; background: #d7d9e0; margin: 0 auto 16px; }

/* ---------- splash ---------- */
.splash-logo { width: 84px; height: 84px; border-radius: 50%; object-fit: contain; background: #fff; padding: 12px; margin: 4px auto 14px; display: block; border: 1px solid #eee; box-shadow: 0 6px 18px -8px rgba(0,0,0,.3); }

/* brand logo overlaid on the hero image, above the sheet */
.hero-logo {
  position: absolute; z-index: 4; top: max(26px, env(safe-area-inset-top)); left: 0; right: 0;
  display: flex; justify-content: center; pointer-events: none; padding: 0 24px;
}
.hero-logo img {
  width: min(210px, 56%); height: auto; display: block;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,.18));
}

.splash-title { font-size: 26px; font-weight: 700; text-align: center; letter-spacing: -.02em; }
.splash-sub { text-align: center; color: var(--muted); margin-top: 4px; font-size: 15px; }
.divider { height: 1px; background: #ececf1; margin: 18px 0; }

/* ---------- buttons ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border: none; cursor: pointer;
  background: var(--btn-bg); color: var(--btn-text);
  font-family: inherit; font-size: 16px; font-weight: 600;
  padding: 17px; border-radius: 99px;
  transition: transform .15s var(--ease), opacity .2s, filter .2s;
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-outline { background: transparent; color: var(--ink); border: 1px solid #e1e3ea; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; min-height: 56px;
  position: relative; z-index: 3;
}
.topbar .title { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.topbar .right { margin-left: auto; color: var(--muted); font-size: 14px; }
.iconbtn {
  width: 40px; height: 40px; display: grid; place-items: center;
  background: transparent; border: none; cursor: pointer; color: var(--ink); border-radius: 50%;
  transition: background .2s;
}
.iconbtn:active { background: #f0f0f4; }
.iconbtn svg { width: 24px; height: 24px; }

/* cart badge floating */
.cart-fab {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(20,22,28,.62); backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
  display: grid; place-items: center; border: none; cursor: pointer; color: #fff;
}
.cart-fab svg { width: 22px; height: 22px; }
.cart-fab .count {
  position: absolute; top: -4px; right: -4px; min-width: 19px; height: 19px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  border-radius: 99px; display: grid; place-items: center; padding: 0 5px;
}

/* ---------- product list (carousel) ---------- */
.list-head { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 4px; }
.list-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.carousel {
  display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 16px 2px 8px; margin: 0 -22px; padding-left: 22px; padding-right: 22px;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.card {
  flex: 0 0 78%; scroll-snap-align: center;
  border: 1px solid #eee; border-radius: 18px; overflow: hidden; cursor: pointer;
  background: #fff; transition: transform .2s var(--ease);
}
.card:active { transform: scale(.985); }
.card .img { aspect-ratio: 1; background: #f6f5f3 center/cover no-repeat; }
.card .meta { padding: 14px 16px 16px; }
.card .name { font-weight: 700; font-size: 15px; line-height: 1.3; }
.card .price { color: var(--muted); margin-top: 4px; font-size: 14px; }
.dots { display: flex; gap: 6px; justify-content: center; padding: 6px 0 14px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #d7d9e0; transition: background .25s, width .25s; }
.dot.on { background: var(--ink); width: 18px; border-radius: 99px; }

/* ---------- category filter chips ---------- */
.chips {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 12px 2px 4px; margin: 0 -22px; padding-left: 22px; padding-right: 22px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; border: 1px solid #e1e3ea; background: #fff; color: var(--ink);
  font-family: inherit; font-size: 13px; font-weight: 600; padding: 9px 16px;
  border-radius: 99px; cursor: pointer; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s, transform .12s var(--ease);
}
.chip:active { transform: scale(.97); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- categories screen ---------- */
.cat-list { flex: 1; overflow-y: auto; padding: 10px 22px 22px; }
.cat-card {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 12px; margin-bottom: 12px; border: 1px solid #eceef2; border-radius: 18px;
  background: #fff; cursor: pointer; color: inherit; font-family: inherit;
  transition: background .2s, border-color .2s, transform .12s var(--ease);
}
.cat-card:active { transform: scale(.99); background: #f7f7f9; }
.cat-card .cat-img { width: 72px; height: 72px; border-radius: 14px; background: #f6f5f3 center/cover no-repeat; flex: 0 0 auto; }
.cat-card .cat-meta { flex: 1; min-width: 0; }
.cat-card .cat-name { font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.cat-card .cat-tag { font-size: 13px; color: var(--muted); margin-top: 3px; }
.cat-card .chev { margin-left: auto; color: var(--muted); display: grid; place-items: center; }
.cat-card .chev svg { width: 18px; height: 18px; }

/* ---------- lookbook screen ---------- */
.look-grid {
  flex: 1; overflow-y: auto; padding: 14px 18px 8px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start;
}
.look-tile { position: relative; border-radius: 16px; overflow: hidden; background: #f6f5f3; }
.look-tile .look-img { width: 100%; aspect-ratio: 1; background: #f6f5f3 center/cover no-repeat; }
.look-tile figcaption {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 12px 10px;
  color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .01em;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.55) 100%);
}

/* ---------- PDP ---------- */
.pdp-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; padding-right: 30px; }
.pdp-price { color: var(--muted); margin-top: 2px; font-size: 16px; }
.pdp-desc { color: #4b5161; font-size: 14px; line-height: 1.55; margin-top: 14px; }
.pdp-desc.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.readmore { background: none; border: none; color: var(--accent); font-family: inherit; font-weight: 600; font-size: 14px; padding: 8px 0; cursor: pointer; }
.pdp-head { display: flex; align-items: flex-start; gap: 10px; }
.pdp-head .x { margin-left: auto; }

/* ---------- cart ---------- */
.cart-body { flex: 1; overflow-y: auto; padding: 8px 18px; }
.cart-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; padding: 40px; }
.cart-empty .circle { width: 150px; height: 150px; border-radius: 50%; background: #f4f3f1; display: grid; place-items: center; }
.cart-empty .circle svg { width: 70px; height: 70px; color: #c8cad2; }
.cart-empty h3 { font-size: 26px; font-weight: 700; }
.cart-item { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid #f0f0f3; }
.cart-item .thumb { width: 72px; height: 72px; border-radius: 12px; background: #f6f5f3 center/cover no-repeat; flex: 0 0 auto; }
.cart-item .info { flex: 1; min-width: 0; }
.cart-item .nm { font-weight: 600; font-size: 14px; }
.cart-item .pr { color: var(--ink); font-weight: 700; margin-top: 4px; }
.cart-item .rm { color: var(--muted); font-size: 12px; background: none; border: none; cursor: pointer; padding: 4px 0; }
.stepper { display: inline-flex; align-items: center; gap: 0; border: 1px solid #e3e4ea; border-radius: 99px; margin-top: 8px; }
.stepper button { width: 30px; height: 30px; border: none; background: none; font-size: 18px; cursor: pointer; color: var(--ink); }
.stepper span { min-width: 26px; text-align: center; font-weight: 600; font-size: 14px; }
.cart-foot { border-top: 1px solid #eee; padding: 16px 22px calc(18px + env(safe-area-inset-bottom)); }
.subtotal { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.subtotal .lbl { font-size: 14px; color: var(--muted); }
.subtotal .amt { font-size: 26px; font-weight: 700; }
.subtotal .amt small { font-size: 12px; color: var(--muted); font-weight: 400; }

/* ---------- lead form ---------- */
.form { flex: 1; overflow-y: auto; padding: 8px 22px 22px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 7px; }
.field input {
  width: 100%; padding: 15px 16px; border: 1px solid #e3e4ea; border-radius: 14px;
  font-family: inherit; font-size: 16px; color: var(--ink); background: #fafafb;
  transition: border-color .2s, background .2s;
}
.field input:focus { outline: none; border-color: var(--ink); background: #fff; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.consent { font-size: 12px; color: var(--muted); line-height: 1.5; margin-top: -4px; }
.lead-error { color: #dc2626; font-size: 13px; min-height: 16px; margin: -4px 0 8px; }

/* ---------- loader ---------- */
.loader { position: absolute; inset: 0; display: grid; place-items: center; background: #000; z-index: 50; }
.spinner { width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader.hide { opacity: 0; pointer-events: none; transition: opacity .4s; }

/* ---------- select retailer ---------- */
.retailer-list { flex: 1; overflow-y: auto; padding: 10px 22px; }
.retailer { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border: 1px solid #eceef2; border-radius: 14px; margin-bottom: 10px; text-decoration: none; color: inherit; cursor: pointer; transition: background .2s, border-color .2s, transform .12s var(--ease); }
.retailer:active { transform: scale(.99); background: #f7f7f9; }
.retailer .r-nm { font-weight: 600; font-size: 15px; }
.retailer .r-note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.retailer .chev { margin-left: auto; color: var(--muted); display: grid; place-items: center; }
.retailer .chev svg { width: 18px; height: 18px; }

.mt-auto { margin-top: auto; }
.stack > * + * { margin-top: 10px; }
