/* Customer page */
body { padding-bottom: 96px; }
.toast { bottom: calc(92px + env(safe-area-inset-bottom)); } /* above the cart bar */
.hero { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 8; margin-top: 4px; border: 1px solid var(--line); }
.hero img { width: 100%; height: 100%; object-fit: cover; object-position: 0% 40%; }
.lead { margin: 10px 2px 0; font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--goldLight); }
.lead span { display: block; font-family: var(--sans); font-style: normal; font-size: 13.5px; color: var(--muted); }
.hero .over { position: absolute; inset: auto 0 0 0; padding: 40px 14px 12px; background: linear-gradient(transparent, rgba(0,0,0,.72)); }
.hero .over b { display: block; font-family: var(--serif); font-size: 19px; font-style: italic; font-weight: 600; color: #fff; }
.hero .over span { font-size: 13px; color: rgba(255,255,255,.85); }
.where { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.where .chip { cursor: pointer; }
.catbar { position: sticky; top: 0; z-index: 10; padding: 10px 0; margin: 6px -16px 0; padding-left: 16px; padding-right: 16px;
  background: linear-gradient(180deg, var(--black) 70%, transparent); }
.items { display: grid; gap: 10px; }
@media (min-width: 720px) { .items { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1040px) { .items { grid-template-columns: 1fr 1fr 1fr; } }
.item { display: grid; grid-template-columns: 104px 1fr; gap: 12px; padding: 10px; cursor: pointer; text-align: left; width: 100%; color: inherit; }
.item .photo { width: 104px; height: 112px; border-radius: 10px; }
.item h3 { margin: 2px 0 4px; font-family: var(--serif); font-size: 16.5px; line-height: 1.2; }
.item p { margin: 0; font-size: 12.8px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 8px; }
.item .prices { display: flex; flex-wrap: wrap; gap: 6px; }
.item .pz { display: inline-flex; flex-direction: column; line-height: 1.15; padding: 4px 9px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(0,0,0,.18); font-weight: 700; color: var(--sun);
  font-variant-numeric: tabular-nums; font-size: 13.5px; }
.item .pz small { color: var(--muted); font-weight: 600; font-size: 11px; letter-spacing: .04em; }
:root[data-light] .item .pz { background: #fff; }
.item .add { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; line-height: 1; color: #fff;
  background: linear-gradient(135deg, var(--flame), var(--crimson), var(--deepRed)); border: 1px solid var(--gold45); flex: none; }
.item .incart { font-size: 12px; color: var(--leaf); font-weight: 700; }
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.6) 30%); }
.cartbar .btn { width: min(560px, 100%); margin: 0 auto; display: flex; justify-content: space-between; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.sheet .bigphoto { width: 100%; aspect-ratio: 1 / .85; border-radius: 12px; margin-bottom: 12px; }
.sizes { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.size { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.2); text-align: left; min-height: 56px; }
.size b { display: block; font-size: 15px; }
.size span { color: var(--sun); font-weight: 700; font-variant-numeric: tabular-nums; }
.size.on { border-color: var(--sun); background: var(--sun16); box-shadow: inset 0 0 0 1px var(--sun); }
.line { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.line .n { font-weight: 600; }
.line .s { font-size: 12.5px; color: var(--muted); }
.totalrow { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0 4px; }
.totalrow .money { font-size: 26px; }
.bignum { font-size: 64px; line-height: 1; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 16px 0 8px; }
.step { text-align: center; font-size: 12px; color: var(--muted); }
.step i { display: block; height: 6px; border-radius: 6px; background: rgba(255,255,255,.12); margin-bottom: 6px; }
.step.done i { background: linear-gradient(90deg, var(--amber), var(--sun)); }
.step.done { color: var(--fg); }
.ready { text-align: center; padding: 18px 14px; border-radius: 16px; border: 1px solid rgba(255,255,255,.35);
  background: linear-gradient(135deg, #b7e36b, var(--leaf), #4f7a12); color: #0f1f04; animation: pulse 1.6s ease-in-out 3; }
.ready b { display: block; font-family: var(--serif); font-size: 28px; }
@keyframes pulse { 50% { transform: scale(1.03); } }
.ig { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 0 8px; }
.ig b { color: var(--sun); }

/* ---- Welcome / idle screen ---------------------------------------------------------------- */
.welcome { position: fixed; inset: 0; z-index: 60; overflow: hidden auto; display: flex; flex-direction: column; align-items: center;
  background: var(--black) linear-gradient(180deg, var(--bgTop) 0%, var(--bgUpper) 40%, var(--black) 80%, var(--bgBottom) 100%);
  padding: 0 0 calc(14px + env(safe-area-inset-bottom)); animation: fade .35s ease; }
.welcome.out { animation: wout .35s ease forwards; }
@keyframes wout { to { opacity: 0; transform: scale(1.03); } }
/* Hero: product photo behind, owner portrait in front fading into it, name on a dark fade. */
.w-hero { position: relative; width: 100%; height: 44dvh; min-height: 300px; flex: none; overflow: hidden; background: #0b0506; }
.w-hero .cover { position: absolute; top: 0; left: 0; width: 72%; height: 100%; object-fit: cover; object-position: 80% 40%;
  -webkit-mask-image: linear-gradient(270deg, transparent 0%, #000 34%); mask-image: linear-gradient(270deg, transparent 0%, #000 34%); }
.w-hero .owner { position: absolute; right: 0; top: 0; height: 100%; width: 66%; object-fit: cover; object-position: 50% 12%;
  -webkit-mask-image: linear-gradient(270deg, #000 58%, transparent 100%); mask-image: linear-gradient(270deg, #000 58%, transparent 100%); }
.w-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 38%, rgba(0,0,0,.55) 62%, var(--black) 100%); }
.w-name { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 2; text-align: center; padding: 0 16px; }
.w-name .title { font-size: clamp(38px, 10.5vw, 84px); letter-spacing: .02em; filter: drop-shadow(0 4px 14px rgba(0,0,0,.7)); }
.w-name .by { font-family: var(--serif); font-style: italic; color: #fff; font-size: clamp(17px, 4.4vw, 30px); text-shadow: 0 2px 12px rgba(0,0,0,.7); }
.w-tag { margin: 6px 16px 0; text-align: center; color: var(--muted); font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; }

/* 3D carousel, turning right -> left */
.carousel { width: 100%; height: clamp(170px, 25dvh, 280px); flex: none; perspective: 1000px; overflow: hidden;
  display: grid; place-items: center; --n: 12; --w: clamp(96px, 23vw, 150px); --r: calc(var(--w) * 2.05); }
.ring { position: relative; width: var(--w); height: calc(var(--w) * 1.28); transform-style: preserve-3d;
  transform: translateZ(calc(var(--r) * -1)); animation: ring 36s linear infinite; }
@keyframes ring { from { transform: translateZ(calc(var(--r) * -1)) rotateY(0deg); } to { transform: translateZ(calc(var(--r) * -1)) rotateY(-360deg); } }
.ring .c { position: absolute; inset: 0; border-radius: 14px; overflow: hidden; backface-visibility: hidden;
  transform: rotateY(calc(var(--i) * 360deg / var(--n))) translateZ(var(--r));
  border: 1px solid var(--gold45); box-shadow: 0 12px 26px rgba(0,0,0,.45); background: var(--cardTop); }
.ring .c img { width: 100%; height: 76%; object-fit: cover; object-position: 50% 5%; }
.ring .c span { height: 24%; padding: 3px 7px; font-size: clamp(10px, 2.5vw, 13px); line-height: 1.15; font-weight: 600;
  text-align: center; display: grid; place-items: center; background: linear-gradient(180deg, var(--cardTop), var(--cardBottom)); }
.w-go { margin: 4px 16px 0; width: min(420px, calc(100% - 32px)); min-height: 60px; font-size: 20px; border-radius: 16px; flex: none;
  box-shadow: 0 12px 34px var(--flame28); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.035); } }
.w-ig { display: flex; align-items: center; gap: 12px; margin: 14px 16px 0; padding: 10px 14px; border-radius: 16px; flex: none;
  border: 1px solid var(--line); background: rgba(0,0,0,.22); max-width: 420px; }
.w-ig .qr { width: 92px; height: 92px; flex: none; background: #fff; border-radius: 10px; padding: 5px; }
.w-ig .qr svg { width: 100%; height: 100%; display: block; }
.w-ig b { display: block; color: var(--sun); font-size: 18px; margin-top: 2px; }
.w-ig small { color: var(--muted); font-size: 13px; }

/* Tablet / TV in landscape: picture on the left full height, the rest on the right. */
@media (min-width: 820px) and (orientation: landscape) {
  .welcome { display: grid; grid-template-columns: 50% 50%; grid-template-rows: 1fr auto auto auto auto 1fr;
    justify-items: center; padding: 0; overflow: hidden; }
  .w-hero { grid-column: 2; grid-row: 1 / -1; height: 100dvh; min-height: 0; }
  .w-hero .owner { width: 70%; } .w-hero .cover { width: 70%; }
  .w-hero::after { background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.55) 72%, var(--black) 100%),
    linear-gradient(270deg, transparent 80%, var(--black) 100%); }
  .w-name { bottom: 4dvh; }
  .w-name .title { font-size: clamp(48px, 6vw, 96px); }
  .w-tag { grid-column: 1; grid-row: 2; }
  .carousel { grid-column: 1; grid-row: 3; height: 44dvh; --w: clamp(120px, 12vw, 200px); }
  .w-go { grid-column: 1; grid-row: 4; }
  .w-ig { grid-column: 1; grid-row: 5; }
}
@media (prefers-reduced-motion: reduce) { .ring, .w-go { animation: none !important; } }

:root[data-light] .cartbar { background: linear-gradient(180deg, transparent, rgba(255,247,249,.92) 30%); }
:root[data-light] .lead { color: var(--deepRed); }
:root[data-light] .w-name .by { color: var(--fg); text-shadow: none; }
:root[data-light] .w-name .title { filter: drop-shadow(0 2px 10px rgba(255,255,255,.8)); }
:root[data-light] .w-ig { background: #fff; }
:root[data-light] .w-tag { color: var(--deepRed); }
