/* ==========================================================================
   云集相册 — 移动端优先相册商城
   设计基调：暖中性底色 + 单一砖红强调色；只动 transform / opacity
   ========================================================================== */

:root {
  --bg: #f3f1ec;
  --surface: #fffdfa;
  --surface-2: #f7f4ef;
  --ink: #1c1a17;
  --ink-2: #5f5b55;
  --ink-3: #918b83;
  --line: #e7e3dc;
  --line-2: #d6d2c9;

  --accent: #b23a2f;
  --accent-ink: #8f2d24;
  --accent-soft: #fbecea;

  --dark: #141311;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-pill: 999px;

  --shadow-1: 0 1px 2px rgba(28, 24, 20, .05), 0 4px 14px rgba(28, 24, 20, .05);
  --shadow-2: 0 8px 28px rgba(28, 24, 20, .12);

  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-out: cubic-bezier(.22, .61, .36, 1);

  --appbar-h: 108px;
  --tabbar-h: 56px;
  --fab-size: 54px;

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
          "Noto Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input { font: inherit; }

/* 关键：组件自带的 display 会盖掉 [hidden] 的 display:none，
   导致透明弹层仍铺满屏幕并拦截点击与输入 */
[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
  transition: top .18s var(--ease-out);
}
.skip-link:focus { top: 12px; }

:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ---------------------------------------------------------------- appbar */

.appbar {
  position: sticky; top: 0; z-index: 60;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}

.appbar__inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
}

.appbar__back {
  flex: none; margin-right: -2px;
}

.brand { display: flex; align-items: center; gap: 8px; flex: none; }
.brand__mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--ink); color: #fff;
}
.brand__text { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }

.search {
  position: relative; flex: 1 1 auto; min-width: 0; display: flex; align-items: center;
}
.search__icon {
  position: absolute; left: 12px; color: var(--ink-3); pointer-events: none;
}
.search__input {
  width: 100%; height: 38px;
  padding: 0 34px 0 34px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill);
  background: #f5f5f5; color: var(--ink);
  font-size: 14px;
  transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out), background .2s var(--ease-out);
}
.search__input::placeholder { color: #999; }
.search__input:focus {
  outline: none; border-color: var(--ink-3);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(28, 24, 20, .06);
}
.search__input::-webkit-search-cancel-button { display: none; }
.search__clear {
  position: absolute; right: 8px; width: 22px; height: 22px;
  display: grid; place-items: center; border-radius: 50%;
  color: #fff; background: var(--ink-3);
}

.appbar__actions {
  display: flex; align-items: center; gap: 2px; flex: none;
}
.appbar__actions .iconbtn {
  width: 38px; height: 38px;
  color: var(--ink-2);
}
.appbar__actions .iconbtn[hidden] { display: none; }
/* 移动端：购物车 / 用户 / 登录收进「批量管理」，保持顶栏简洁 */
.appbar__actions .appbar__desk { display: none; }

.iconbtn {
  position: relative; width: 40px; height: 40px;
  display: grid; place-items: center; border-radius: 50%;
  color: var(--ink-2);
  transition: background .16s var(--ease-out), transform .16s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.iconbtn:hover { background: rgba(28, 24, 20, .06); }
.iconbtn:active { transform: scale(.92); }
.iconbtn[aria-pressed="true"] { background: var(--ink); color: #fff; }

.badge {
  position: absolute; top: 2px; right: 0;
  min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: var(--r-pill); background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600; line-height: 17px; text-align: center;
}
.badge.pop { animation: pop .34s var(--ease); }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.35); } 100% { transform: scale(1); } }

.desknav { display: none; }

/* ---------------------------------------------------------------- catbar */

.catbar {
  max-width: 1400px; margin: 0 auto;
  padding: 0 10px 8px;
  overflow: hidden;
}
.catbar__scroll {
  display: flex; gap: 8px;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.catbar__scroll::-webkit-scrollbar { display: none; }

.chip {
  flex: none; scroll-snap-align: start;
  height: 32px; padding: 0 14px;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink-2);
  font-size: 13.5px; white-space: nowrap;
  transition: transform .14s var(--ease-out), background .16s var(--ease-out),
              border-color .16s var(--ease-out), color .16s var(--ease-out);
}
.chip:active { transform: scale(.96); }
.chip[aria-selected="true"] {
  background: var(--ink); color: #fff; border-color: var(--ink);
}
.chip__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.chip[aria-selected="true"] .chip__dot { background: #fff; }

/* ------------------------------------------------------------------ main */

main { max-width: 1400px; margin: 0 auto; padding: 10px; }
.view { animation: fade .28s var(--ease-out); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 4px 0 12px;
}
.section-head h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.section-head .more { font-size: 13px; color: var(--ink-3); }
.section-head--slim { margin: 0 0 10px; }
.section-head--slim h2 { font-size: 14.5px; font-weight: 600; }

/* --------------------------------------------------------------- banners */

.banner {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  height: 132px; margin-bottom: 16px; isolation: isolate;
}
.banner img { width: 100%; height: 100%; object-fit: cover; }
.banner__copy {
  position: absolute; inset: 0; padding: 18px 20px;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  color: #fff;
  background: linear-gradient(100deg, rgba(20, 19, 17, .48), rgba(20, 19, 17, .04) 62%);
  text-shadow: 0 1px 8px rgba(20, 19, 17, .28);
}
.banner__copy strong { font-size: 19px; font-weight: 600; letter-spacing: -.01em; }
.banner__copy span { font-size: 12.5px; opacity: .92; }

/* ----------------------------------------------------------------- grid */

.album {
  display: grid; gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.album.is-flow {
  display: block;
  columns: 2; column-gap: 8px;
}
.album.is-flow .card { break-inside: avoid; margin-bottom: 8px; }

.card {
  position: relative; border-radius: var(--r-sm); overflow: hidden;
  background: var(--surface); box-shadow: 0 1px 3px rgba(28, 24, 20, .06);
  border: 1px solid var(--line);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease);
  contain: layout style paint;
  animation: rise .46s var(--ease) both;
  animation-delay: min(calc(var(--i, 0) * 26ms), 380ms);
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card:active { transform: scale(.985); }

.card__media {
  position: relative; display: block; width: 100%;
  aspect-ratio: 1 / 1; overflow: hidden; background: var(--surface-2);
}
.album.is-flow .card__media { aspect-ratio: auto; }
.album.is-flow .card__media img { height: auto; }
.card__media img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.02);
  transition: opacity .4s var(--ease-out), transform .5s var(--ease-out);
}
.card__media img.is-loaded { opacity: 1; transform: none; }

.card__tag {
  position: absolute; left: 8px; top: 8px;
  padding: 2px 7px; border-radius: var(--r-sm);
  background: rgba(20, 19, 17, .62); color: #fff;
  font-size: 11px; letter-spacing: .02em;
  backdrop-filter: blur(6px);
}
.card__share {
  position: absolute; right: 6px; top: 6px;
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 50%; color: var(--ink-2);
  background: rgba(255, 255, 255, .86); backdrop-filter: blur(6px);
  box-shadow: 0 1px 4px rgba(28, 24, 20, .12);
  transition: transform .14s var(--ease-out), background .16s var(--ease-out), color .16s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.card__share:active { transform: scale(.9); background: #fff; color: var(--ink); }
.card__ops {
  position: absolute; right: 6px; top: 6px; z-index: 2;
  display: flex; align-items: center; gap: 5px;
}
.card__ops .card__share { position: static; right: auto; top: auto; }
.card__ops .card__del { position: static; right: auto; top: auto; }
.card__fav {
  position: absolute; right: 8px; top: 8px;
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 50%; color: #fff;
  background: rgba(20, 19, 17, .42); backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(-4px);
  transition: opacity .18s var(--ease-out), transform .18s var(--ease-out);
}
.card:hover .card__fav, .card__fav[aria-pressed="true"] { opacity: 1; transform: none; }
.card__fav[aria-pressed="true"] { color: var(--accent); background: #fff; }

.card__body { padding: 8px 9px 10px; }
.card__title {
  margin: 0 0 6px; font-size: 13px; font-weight: 500; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.6em; line-height: 1.35;
}
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.card__cart {
  width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 50%; color: var(--ink-2);
  transition: background .14s var(--ease-out), color .14s var(--ease-out), transform .14s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.card__cart:active { transform: scale(.9); background: var(--accent-soft); color: var(--accent); }
.price { color: var(--accent); font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.price small { font-size: 11px; font-weight: 500; margin-right: 1px; }
.price--s { font-size: 14px; }
.muted { color: var(--ink-3); font-size: 12px; }
.strike { color: var(--ink-3); font-size: 12px; text-decoration: line-through; }

/* skeleton */
.sk { border-radius: var(--r-md); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-1); }
.sk__media { aspect-ratio: 1/1; background: var(--surface-2); }
.sk__line { height: 11px; margin: 10px; border-radius: 6px; background: var(--surface-2); }
.sk__line--s { width: 52%; }
.sk, .sk__media, .sk__line {
  background-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(28,24,20,.055) 50%, rgba(0,0,0,0) 100%);
  background-size: 220% 100%;
  animation: shimmer 1.25s linear infinite;
}
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* empty / error */
.state {
  padding: 56px 20px; text-align: center; color: var(--ink-3);
}
.state__icon { width: 52px; height: 52px; margin: 0 auto 14px; display: grid; place-items: center;
  border-radius: 50%; background: var(--surface-2); color: var(--ink-3); }
.state h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.state p { margin: 0 0 16px; font-size: 13.5px; }

/* ----------------------------------------------------------------- cart */

.list { display: grid; gap: 10px; }

.row {
  display: grid; grid-template-columns: 20px 78px 1fr; gap: 12px; align-items: center;
  padding: 12px; background: var(--surface); border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
}
.row__pick {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--line-2); display: grid; place-items: center;
  color: transparent; transition: all .16s var(--ease-out);
}
.row__pick[aria-checked="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.row__img { width: 78px; aspect-ratio: 1/1; border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.row__img img { width: 100%; height: 100%; object-fit: cover; }
.row__main { min-width: 0; }
.row__title { margin: 0 0 2px; font-size: 14px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row__spec { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.row__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.stepper { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line-2); border-radius: var(--r-pill); overflow: hidden; }
.stepper button { width: 28px; height: 28px; display: grid; place-items: center; color: var(--ink-2); transition: background .14s var(--ease-out); }
.stepper button:hover { background: var(--surface-2); }
.stepper button:disabled { color: var(--line-2); cursor: not-allowed; }
.stepper span { min-width: 30px; text-align: center; font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- checkout */

.panel {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1); padding: 16px; margin-bottom: 12px;
}
.panel__head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.panel__head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.panel__head .muted { margin-left: auto; }

.field { margin-bottom: 12px; }
.field > label { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 5px; }
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-2);
  border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink);
  transition: border-color .18s var(--ease-out), background .18s var(--ease-out);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: var(--ink-3); background: var(--surface);
}
.field textarea { resize: vertical; min-height: 68px; }
.field__err { display: block; margin-top: 5px; font-size: 12px; color: var(--accent); }
.field.is-invalid input { border-color: var(--accent); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.addr {
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2); cursor: pointer;
}
.addr.is-active { border-color: var(--ink); background: var(--surface); }
.addr__name { font-size: 14px; font-weight: 500; }
.addr__detail { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }

.payline { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.payline:first-of-type { border-top: 0; }
.payline__label { flex: 1; font-size: 14px; }
.payline__value { font-variant-numeric: tabular-nums; }
.payline--total .payline__value { font-size: 19px; font-weight: 600; color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; padding: 0 20px; border-radius: var(--r-pill);
  font-size: 15px; font-weight: 500;
  transition: transform .16s var(--ease-out), background .18s var(--ease-out), opacity .18s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-ink); }
.btn--dark { background: var(--ink); color: #fff; }
.btn--outline { border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); }
.btn--ghost { background: var(--surface-2); color: var(--ink-2); }
.btn--block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.bar {
  position: sticky; bottom: 0; z-index: 40;
  margin: 0 -14px -14px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.bar__sum { flex: 1; min-width: 0; }
.bar__sum b { font-size: 19px; color: var(--accent); font-variant-numeric: tabular-nums; }
.bar__sum span { display: block; font-size: 12px; color: var(--ink-3); }

/* ---------------------------------------------------------------- order */

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; }
.tabs::-webkit-scrollbar { display: none; }

.ocard { padding: 12px; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-1); }
.ocard__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ocard__no { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.status { font-size: 12.5px; font-weight: 600; }
.status--0, .status--1 { color: var(--accent); }
.status--2 { color: #8a6a1f; }
.status--3 { color: var(--ink-3); }
.status--4 { color: var(--ink-3); }
.ocard__goods { display: grid; gap: 10px; }
.ogood { display: grid; grid-template-columns: 60px 1fr auto; gap: 10px; align-items: center; }
.ogood img { width: 60px; height: 60px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-2); }
.ogood__t { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ogood__s { font-size: 12px; color: var(--ink-3); }
.ogood__p { font-size: 13.5px; text-align: right; }
.ocard__foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.ocard__total { margin-right: auto; font-size: 13px; color: var(--ink-2); }

.mini {
  height: 32px; padding: 0 14px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); font-size: 13px; color: var(--ink-2);
  transition: transform .14s var(--ease-out), background .16s var(--ease-out);
}
.mini:active { transform: scale(.95); }
.mini--solid { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ------------------------------------------------------------------- me */

.mehead {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 16px; border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--shadow-1); margin-bottom: 12px;
}
.avatar {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-size: 20px; font-weight: 600; flex: none;
}
.mehead h2 { margin: 0 0 2px; font-size: 17px; font-weight: 600; }
.mehead p { margin: 0; font-size: 13px; color: var(--ink-3); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: 12px;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 14px 6px; }
.stat { text-align: center; }
.stat b { display: block; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--ink-3); }

.entry {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 16px; background: var(--surface); color: var(--ink);
  border-bottom: 1px solid var(--line); text-align: left;
  transition: background .16s var(--ease-out);
}
.entry:first-child { border-radius: var(--r-lg) var(--r-lg) 0 0; }
.entry:last-child { border-bottom: 0; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.entry:hover { background: var(--surface-2); }
.entry svg { color: var(--ink-3); flex: none; }
.entry span { flex: 1; font-size: 14.5px; }
.entry i { font-style: normal; color: var(--ink-3); font-size: 13px; }
.entrylist { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; margin-bottom: 12px; }

/* --------------------------------------------------------------- viewer */

.viewer {
  position: fixed; inset: 0; z-index: 120;
  background: var(--dark); color: #fff;
  display: flex; flex-direction: column;
  opacity: 0; transform: scale(.985);
  transition: opacity .22s var(--ease-out), transform .22s var(--ease-out);
}
.viewer.is-open { opacity: 1; transform: none; }

.viewer__stage { flex: 1; position: relative; overflow: hidden; touch-action: pan-y; }
.viewer__track { display: flex; height: 100%; will-change: transform; }
.viewer__slide {
  flex: 0 0 100%; height: 100%; display: grid; place-items: center;
  padding: 0 12px; overflow: hidden;
}
.viewer__slide img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  transition: transform .28s var(--ease);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.viewer__slide img.is-zoomed { transform: scale(2); cursor: zoom-out; }

.viewer__close {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px;
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .12); color: #fff; backdrop-filter: blur(8px);
}
.viewer__counter {
  position: absolute; top: calc(20px + env(safe-area-inset-top)); left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px; border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .12); backdrop-filter: blur(8px);
  font-size: 12.5px; font-variant-numeric: tabular-nums;
}
.viewer__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .1); color: #fff; backdrop-filter: blur(8px);
}
.viewer__nav--prev { left: 10px; }
.viewer__nav--next { right: 10px; }
.viewer__nav:disabled { opacity: .25; }

.viewer__bar {
  flex: none; padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(20, 19, 17, .96), rgba(20, 19, 17, .72));
}
.viewer__meta { margin-bottom: 10px; }
.viewer__title { margin: 0 0 2px; font-size: 15px; font-weight: 500; }
.viewer__sub { margin: 0; display: flex; align-items: baseline; gap: 10px; }
.viewer__sub .price { color: #ff8b7e; }
.viewer__sub .sku { font-size: 12px; color: rgba(255, 255, 255, .5); }
.viewer__ops { display: flex; gap: 8px; }

.opbtn {
  flex: 1; height: 42px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  background: rgba(255, 255, 255, .12); color: #fff; font-size: 13.5px;
  transition: transform .14s var(--ease-out), background .16s var(--ease-out);
}
.opbtn:active { transform: scale(.95); }
.opbtn[aria-pressed="true"] { background: rgba(255, 139, 126, .22); color: #ff9c90; }
.opbtn--ghost { flex: 0 0 auto; width: 74px; }
.opbtn--primary { flex: 1.5; background: var(--accent); color: #fff; }
.opbtn--primary:hover { background: var(--accent-ink); }

/* ---------------------------------------------------------------- sheet */

.sheet { position: fixed; inset: 0; z-index: 130; display: flex; align-items: flex-end; }
.sheet__mask { position: absolute; inset: 0; background: rgba(20, 19, 17, .42); opacity: 0; transition: opacity .22s var(--ease-out); }
.sheet.is-open .sheet__mask { opacity: 1; }
.sheet__panel {
  position: relative; width: 100%; max-height: 82dvh; overflow-y: auto;
  background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-2);
  transform: translateY(100%);
  transition: transform .3s var(--ease);
}
.sheet.is-open .sheet__panel { transform: none; }

.sheet__handle { width: 38px; height: 4px; border-radius: 2px; background: var(--line-2); margin: -6px auto 14px; }
.sheet__title { margin: 0 0 14px; font-size: 16px; font-weight: 600; }

.choose { display: grid; grid-template-columns: 84px 1fr; gap: 12px; margin-bottom: 16px; }
.choose img { width: 84px; height: 84px; border-radius: var(--r-sm); object-fit: cover; background: var(--surface-2); }
.choose__p { font-size: 18px; font-weight: 600; color: var(--accent); }
.choose__s { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; }

.specs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.spec {
  padding: 7px 14px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: var(--surface-2);
  font-size: 13.5px; color: var(--ink-2);
  transition: transform .14s var(--ease-out), background .16s var(--ease-out), border-color .16s;
}
.spec:active { transform: scale(.95); }
.spec[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.spec:disabled { opacity: .35; text-decoration: line-through; }

.sharebox {
  background: var(--surface-2); border-radius: var(--r-md); padding: 12px;
  font-size: 13px; color: var(--ink-2); line-height: 1.65; margin-bottom: 14px;
  white-space: pre-wrap; word-break: break-all;
}

/* ---------------------------------------------------------------- toast */

.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px); z-index: 200;
  max-width: 82vw; padding: 10px 18px; border-radius: var(--r-pill);
  background: rgba(20, 19, 17, .92); color: #fff; font-size: 13.5px;
  text-align: center; opacity: 0;
  transition: opacity .2s var(--ease-out), transform .24s var(--ease);
}
.toast.is-open { opacity: 1; transform: translate(-50%, 0); }

/* -------------------------------------------------------------- tabbar */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a, .tabbar button {
  position: relative; display: flex; flex-direction: row;
  align-items: center; justify-content: center; gap: 6px;
  color: var(--ink-2); font-size: 14px;
  transition: color .16s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.tabbar a[aria-current="page"], .tabbar button.is-on { color: var(--ink); font-weight: 600; }
.tabbar a[aria-current="page"] svg, .tabbar button.is-on svg { transform: translateY(-1px); }
.tabbar svg { transition: transform .18s var(--ease); flex: none; }
.tabbar a + a::before, .tabbar button + button::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 1px; height: 20px; background: var(--line);
}
.tabbar button:active { opacity: .6; }
.tabbar .dot {
  position: absolute; top: 9px; right: calc(50% - 18px);
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
}

/* ------------------------------------------------------------- fab */
.fab {
  position: fixed; z-index: 95;
  right: 16px; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom));
  width: var(--fab-size); height: var(--fab-size);
  display: grid; place-items: center;
  border-radius: 50%; background: var(--accent); color: #fff;
  box-shadow: 0 6px 20px rgba(178, 58, 47, .38);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.fab:active { transform: scale(.92); }
.fab:hover { box-shadow: 0 8px 26px rgba(178, 58, 47, .48); }

/* --------------------------------------------------------- breakpoints */

@media (min-width: 640px) {
  .album { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .album.is-flow { columns: 3; column-gap: 12px; }
  .album.is-flow .card { margin-bottom: 12px; }
  .banner { height: 168px; }
  .row { grid-template-columns: 20px 92px 1fr; }
  .row__img { width: 92px; }
}

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  main { padding: 18px 22px 40px; }
  .appbar__inner { padding: 12px 22px; }
  .catbar { padding: 0 22px 12px; }
  .album { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .album.is-flow { columns: 4; column-gap: 14px; }
  .album.is-flow .card { margin-bottom: 14px; }
  .banner { height: 210px; }
  .banner__copy strong { font-size: 24px; }
  .card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
  .card:hover .card__media img { transform: scale(1.04); }
  .desknav { display: flex; gap: 2px; margin-left: 4px; }
  .desknav a {
    padding: 8px 14px; border-radius: var(--r-pill); font-size: 14px; color: var(--ink-2);
    transition: background .16s var(--ease-out), color .16s var(--ease-out);
  }
  .desknav a:hover { background: rgba(28, 24, 20, .06); }
  .desknav a[aria-current="page"] { background: var(--ink); color: #fff; }
  .appbar__actions .appbar__desk.iconbtn { display: grid; }
  .appbar__actions .appbar__desk.btn,
  .appbar__actions .appbar__desk.userchip { display: inline-flex; }
  .tabbar { display: none; }
  .fab { display: none; }
  .viewer__nav { width: 44px; height: 44px; }
  .bar { margin: 0 0 0; border-radius: var(--r-lg); border: 1px solid var(--line);
         position: sticky; bottom: 18px; }
  .checkout-grid { display: grid; grid-template-columns: 1.35fr .9fr; gap: 16px; align-items: start; }
  .toast { bottom: 32px; }
}

@media (min-width: 1240px) {
  .album { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .album.is-flow { columns: 5; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .card:hover { transform: none; }
}
