/* =============================================================================
   OBAOBAL eshop — built from the mockup web_v1.svg
   One sheet of paper the size of a phone screen. The logo and the rules under
   it stay put, the middle scrolls when it has to, the buttons stay at the bottom.
   ============================================================================= */

:root {
  --paper: #f5f2ec;
  --ink: #141414;
  --red: #d40000;            /* logo and the red rule */
  --btn-green: #87dc87;
  --btn-red: #c7534a;
  --btn-yellow: #dcd887;
  --link: #0004ff;
  --ink-soft: rgba(20, 20, 20, 0.62);
  --font: 'Courier Prime', 'Courier New', Courier, monospace;
  /* layout: the paper is at most 430px wide; side backplates hang over its edges when there is room */
  --paper-w: min(100vw, 430px);
  --over: clamp(0px, calc((100vw - var(--paper-w)) / 2), 130px);
  --pad: 25px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; display: flex; flex-direction: column; overflow: hidden;
  background: #e8e5de; color: var(--ink);
  font: 400 17px/1.35 var(--font);
}
h1, h2, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
button, input { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- demo strip (not part of the shop) ---------- */
.demo {
  flex: none; position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 14px;
  padding: 5px 12px; background: var(--ink); color: var(--paper); font-size: 12.5px;
}
.demo b { letter-spacing: 0.08em; margin-right: 6px; }
.demo__tools summary { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.demo__panel {
  position: absolute; z-index: 60; right: 8px; top: 100%; width: min(310px, calc(100vw - 16px));
  display: grid; gap: 9px; padding: 12px; background: var(--paper); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 10px;
}
.demo__check { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.textlink { background: none; border: 0; padding: 2px 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; text-align: left; }

/* ---------- the sheet ---------- */
.desk { flex: 1; min-height: 0; display: flex; justify-content: center; align-items: center; }
.paper {
  position: relative; width: var(--paper-w); height: 100%; max-height: 900px;
  display: flex; flex-direction: column;
  background: var(--paper) url("../assets/paper.jpg") center top / 900px auto;
}
.head { flex: none; padding: 22px var(--pad) 0; }
.logo { display: block; line-height: 0; }
.logo svg { width: 100%; height: auto; display: block; transition: width 0.25s ease; }
.paper.is-scrolled .logo svg { width: 50%; }
.head .rule { transition: margin-top 0.25s ease; }
.paper.is-scrolled .head .rule { margin-top: 10px; }
.paper.is-scrolled .head { padding-top: 12px; }
.logo path { fill: var(--red); }
.rule { height: 2.5px; background: var(--ink); border-radius: 2px; }
.head .rule { margin-top: 17px; }
.rule--double { height: 9px; background: none; border-top: 2.5px solid var(--ink); border-bottom: 1.2px solid var(--ink); border-radius: 0; }
.rule--red { background: var(--red); }

.body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 var(--pad); -webkit-overflow-scrolling: touch; }
.foot { flex: none; padding: 0 var(--pad); }
.legal { flex: none; padding: 8px var(--pad) 6px; font-size: 11px; line-height: 1.4; }
.legal__links { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; padding-top: 5px; }
.legal__seller { color: var(--ink-soft); }
.lang { margin-left: auto; display: inline-flex; }
.lang button { background: none; border: 0; padding: 3px 4px; cursor: pointer; color: var(--ink-soft); }
.lang button[aria-pressed="true"] { color: var(--ink); font-weight: 700; text-decoration: underline; }

/* ---------- buttons, badges, ticks ---------- */
.btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 52px; padding: 6px 14px;
  background: var(--btn-green); color: var(--ink); border: 2.5px solid var(--ink); border-radius: 11px;
  font-size: 19px; line-height: 1.1; text-align: center; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 0.08s;
}
.btn--red { background: var(--btn-red); }
.btn--yellow { background: var(--btn-yellow); }
.btn--start { justify-content: flex-start; }
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn:disabled { cursor: not-allowed; background: transparent; color: var(--ink-soft); border-style: dashed; }
.btn svg { flex: none; }
.badge {
  position: absolute; right: -13px; top: -24px; z-index: 2; width: 50px; height: 50px; border-radius: 50%;
  display: grid; place-items: center; background: var(--btn-yellow); border: 2.5px solid var(--ink);
  font-size: 15.5px; line-height: 1; white-space: nowrap; pointer-events: none;
  transition: transform 0.3s, opacity 0.3s;
}
.badge--wide { font-size: 13px; }
.tick {
  position: absolute; right: -11px; top: -13px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--btn-green) no-repeat center / 62% url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 13l5 6L20 5' fill='none' stroke='%23141414' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  border: 2px solid var(--ink); pointer-events: none;
  animation: pop 0.28s;
}
@keyframes pop { from { transform: scale(0); } 70% { transform: scale(1.2); } }

/* ---------- which parts each screen shows ---------- */
.chips, .carousel { display: none; }
.paper[data-screen="picker"] .body { display: flex; flex-direction: column; overflow: visible; padding: 0; }
.paper[data-screen="picker"] .chips { display: flex; }
.paper[data-screen="picker"] .carousel { display: block; }
.paper[data-screen="picker"] .view { display: none; }

/* ---------- screen titles ---------- */
.title { padding: 12px 6px 12px 30px; font-size: 20px; font-weight: 400; }
.view > .rule { margin: 0; }

/* ---------- front page ---------- */
.promo { display: none; }
.paper[data-screen="model"] .promo { display: grid; gap: 30px; padding: 16px 0 26px; }
.paper[data-screen="model"] .view { display: none; }
.promo__block { display: grid; gap: 4px; position: relative; }
/* small arrow beside the first animation: there is more below */
.promo__more { position: absolute; right: -4px; bottom: 6px; width: 44px; height: 52px; display: grid; place-items: center;
  background: none; border: 0; color: var(--red); cursor: pointer; transition: opacity .3s; animation: promo-nudge 1.8s ease-in-out infinite; }
.paper.is-scrolled .promo__more { opacity: 0; pointer-events: none; }
@keyframes promo-nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(7px); } }
@media (prefers-reduced-motion: reduce) { .promo__more { animation: none; } }
.promo__title { font-size: 19.5px; font-weight: 400; line-height: 1.2; text-wrap: balance; }
.promo__sub { font-size: 14.5px; line-height: 1.3; color: #4d4d4d; }
.promo__stage { position: relative; margin-top: 10px; user-select: none; -webkit-user-select: none; }
.promo__stage--wallet { height: 340px; cursor: pointer; }
.promo__stage--models { height: 200px; }
.promo__stage--colors { height: 270px; }
.promo__gl, .promo__stage .carousel__gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.promo__flat { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.promo__flat svg { height: 92%; width: auto; }
.promo__side { height: 100%; transform: rotate(90deg); display: flex; align-items: center; }
.promo__side svg { height: 150%; }
.promo__stage .carousel__flat { position: absolute; inset: 0; }

/* ---------- which phone (bottom of the front page) ---------- */
.model { display: grid; gap: 7px; padding: 6px 0 9px; }
.model__q { text-align: center; font-size: 16px; }
.model__status { min-height: 16px; }
.model__status .hint, .model__status .box { font-size: 12.5px; line-height: 1.25; }
.model__status .box { padding: 7px 10px; }
.model .btn { font-size: 18px; min-height: 44px; }
.fill { position: relative; }
.fill input {
  width: 100%; min-height: 44px; padding: 6px 12px; background: rgba(255, 255, 255, 0.55);
  border: 2.5px solid var(--ink); border-radius: 11px; font-size: 17px; text-transform: uppercase;
  -webkit-appearance: none; appearance: none;
}
.fill input::placeholder { color: var(--ink-soft); text-transform: none; opacity: 1; }
/* suggestions open upwards, over the scrolling part */
.suggest {
  position: absolute; left: 0; right: 0; bottom: calc(100% + 6px); z-index: 10; display: grid;
  background: var(--paper) url("../assets/paper.jpg") center / 900px auto; border: 2.5px solid var(--ink); border-radius: 11px; overflow: hidden;
}
.suggest:empty { display: none; }
.suggest button {
  width: 100%; padding: 11px 12px; min-height: 44px; background: none; border: 0; border-bottom: 1.2px solid var(--ink);
  text-align: left; cursor: pointer; font-size: 17px;
}
.suggest button:last-child { border-bottom: 0; }
.suggest button b { font-weight: 700; }
.hint { color: var(--ink-soft); font-size: 15px; }
.box { padding: 12px 14px; border: 2.5px solid var(--ink); border-radius: 11px; background: rgba(255, 255, 255, 0.55); font-size: 15.5px; display: grid; gap: 8px; }
.box--alert { border-color: var(--red); }

/* ---------- picker ---------- */
.chips { align-items: center; justify-content: center; gap: 21px; padding: 20px var(--pad) 0; min-height: 62px; flex: none; }
.chip {
  position: relative; flex: none; width: 36px; height: 29px; padding: 0; background: var(--c); border: 2.2px solid var(--ink); border-radius: 7px;
  cursor: pointer; transition: transform 0.3s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.chip::before { content: ''; position: absolute; inset: -10px -8px; }   /* bigger target for thumbs */
.chip.is-current { transform: scale(1.36); border-width: 2px; }
.chip .tick { width: 19px; height: 19px; right: -9px; top: -10px; border-width: 1.6px; }
.chip.is-current .tick { transform: scale(0.76); }
.carousel {
  position: relative; flex: 1; min-height: 190px;
  width: calc(100% + 2 * var(--over)); margin-left: calc(-1 * var(--over));
  touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none;
}
.carousel:active { cursor: grabbing; }
.carousel__gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.carousel__flat { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 4%; overflow: hidden; }
.carousel__flat-item { flex: none; height: 62%; aspect-ratio: 1 / 2; }
.carousel__flat-item.is-centre { height: 84%; }
.carousel__flat-item svg { width: 100%; height: 100%; display: block; }
.carousel__flat-item.is-tap { animation: flat-turn 0.6s; }
@keyframes flat-turn { 50% { transform: scaleX(0.08); } }

.pick { display: grid; gap: 14px; padding-bottom: 14px; }
.pick__label { text-align: center; font-size: 19px; }
.pick__actions { display: grid; grid-template-columns: 1fr 0fr; gap: 0; transition: grid-template-columns 0.38s ease, gap 0.38s ease; }
.pick__actions.has-next { grid-template-columns: 1.08fr 1fr; gap: 10px; }
.pick__next { position: relative; min-width: 0; }
.pick__next .btn { overflow: hidden; padding-inline: 0; border-width: 0; opacity: 0; transition: opacity 0.25s; }
.pick__actions.has-next .pick__next .btn { padding-inline: 14px; border-width: 2.5px; opacity: 1; }
.pick__next .badge { transform: scale(0); opacity: 0; }
.pick__actions.has-next .pick__next .badge { transform: scale(1); opacity: 1; transition-delay: 0.2s; }
.pick__note { text-align: center; font-size: 15.5px; line-height: 1.3; }
.pick__remove { display: block; margin: 2px auto 0; font-size: 13.5px; color: var(--ink-soft); }

/* ---------- summary ---------- */
.items { display: grid; gap: 16px; padding: 18px 0; }
.item { display: grid; grid-template-columns: 62px 1fr auto; gap: 16px; align-items: center; min-height: 96px; }
.item img { width: 62px; height: 118px; object-fit: contain; display: block; }
.item__text { font-size: 18px; line-height: 1.3; }
.item__price { display: block; margin-top: 6px; }
.item--line { min-height: 0; grid-template-columns: 1fr auto; font-size: 16px; }
.ship { display: grid; gap: 12px; padding: 0 0 16px; }
.ship__q { padding: 10px 6px 0 30px; font-size: 16.5px; }
.ship__countries { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ship__countries .opt { justify-content: center; min-height: 54px; font-size: 18px; }
.opt {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 50px; padding: 6px 12px;
  background: rgba(255, 255, 255, 0.55); border: 2.5px solid var(--ink); border-radius: 11px; font-size: 17px; text-align: left; cursor: pointer;
}
.opt span:last-of-type { white-space: nowrap; }
.opt[aria-pressed="true"] { background: rgba(255, 255, 255, 0.9); box-shadow: inset 0 0 0 1.5px var(--ink); }
.opt:disabled { cursor: not-allowed; border-style: dashed; color: var(--ink-soft); background: transparent; }
.nw { white-space: nowrap; }
.opt__point { margin: -6px 4px 0; font-size: 14.5px; }
.sum { padding: 6px 0 12px; text-align: center; font-size: 24px; }
.sum small { display: block; font-size: 13.5px; color: var(--ink-soft); }
.two { display: grid; grid-template-columns: 1.06fr 1fr; gap: 10px; padding-bottom: 14px; }
.two .btn, .one .btn { font-size: 18px; }
.one { padding-bottom: 14px; display: grid; gap: 12px; }
.one .btn--big { min-height: 56px; font-size: 21px; }
.btnwrap { position: relative; min-width: 0; }
.payrow { display: grid; grid-template-columns: 58px 1fr; gap: 10px; }
.payrow .btn--big { font-size: 19px; padding-inline: 12px; }
.btn--icon { padding: 0; min-height: 56px; }
.btn--icon svg { transform: scaleX(-1); }

/* ---------- Z-Box list (demo stand-in for the Packeta map) ---------- */
.zbox { display: grid; gap: 8px; }
.zbox button { width: 100%; padding: 9px 12px; background: none; border: 1.6px solid var(--ink); border-radius: 9px; text-align: left; cursor: pointer; font-size: 15px; }

/* ---------- delivery details ---------- */
.form { display: grid; gap: 15px; padding: 26px 22px 20px; }
.line { display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 6px; border-bottom: 1.4px solid var(--ink); }
.line label { font-size: 15.5px; padding-bottom: 2px; white-space: nowrap; }
.line input { width: 100%; min-width: 0; padding: 6px 2px 2px; border: 0; border-radius: 0; background: transparent; font-size: 17px; -webkit-appearance: none; appearance: none; }
.line input:focus-visible { outline: none; background: rgba(255, 255, 255, 0.6); }
.line:focus-within { border-bottom-width: 2.6px; }
.line.is-bad { border-bottom-color: var(--red); }
.error { color: var(--red); font-size: 13.5px; margin-top: -11px; }
.fixed { font-size: 15.5px; }
.consent { position: relative; display: block; margin-top: 10px; cursor: pointer; }
.consent input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.consent__box { display: block; padding: 9px 14px; border: 2.5px solid var(--ink); border-radius: 11px; text-align: center; font-size: 13.5px; line-height: 1.35; background: rgba(255, 255, 255, 0.55); }
.consent input:focus-visible + .consent__box { outline: 3px solid var(--ink); outline-offset: 2px; }
.consent.is-bad .consent__box { border-color: var(--red); }
.consent .tick { display: none; }
.consent input:checked ~ .tick { display: block; }
.terms { display: block; text-align: center; color: var(--link); font-size: 13.5px; }

/* ---------- thank-you ---------- */
.thanks { display: grid; gap: 18px; padding: 26px 4px 18px; }
.thanks p { font-size: 18.5px; line-height: 1.35; }
.thanks__env { width: 78%; height: auto; margin: 4px auto 0; display: block; color: #1a1816; }
.thanks__seal { position: relative; min-height: 190px; display: flex; align-items: center; }
.thanks__seal svg { position: absolute; right: 0; top: 50%; width: 190px; height: 190px; transform: translateY(-50%) rotate(-9deg); color: var(--red); }
.thanks__seal p { position: relative; font-size: 20px; }
.thanks__seal small { display: block; font-size: 15px; }
.thanks__status { font-size: 14.5px !important; color: var(--ink-soft); }

/* ---------- blank pages (terms, privacy) and the demo payment ---------- */
.blank { min-height: 40vh; }
.sheet { display: grid; gap: 14px; padding: 22px 4px; }
.sheet .big { font-size: 22px; }

/* ---------- the page rolling up ---------- */
.roll { position: fixed; z-index: 50; pointer-events: auto; }
.roll__sheet { position: absolute; inset: 0; }
.roll__sheet > .paper { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; }
.roll__bar {
  position: absolute; left: -3px; right: -3px; bottom: 0; height: 22px; border-radius: 10px / 50%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.75) 0%, rgba(255, 255, 255, 0) 30%, rgba(60, 50, 30, 0.2) 78%, rgba(40, 32, 18, 0.42) 100%),
    var(--paper) url("../assets/paper.jpg") center / 900px auto;
  box-shadow: 0 5px 0 rgba(20, 20, 20, 0.16), inset 0 0 0 1px rgba(20, 20, 20, 0.28);
}

@media (min-height: 760px) { .head { padding-top: 26px; } }
@media (max-height: 640px) {
  .head { padding-top: 12px; } .head .rule { margin-top: 10px; }
  .chips { padding-top: 12px; min-height: 48px; }
  .pick { gap: 9px; padding-bottom: 8px; } .btn { min-height: 46px; }
  .legal { padding-top: 8px; padding-bottom: 6px; } .legal__seller { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* summary: a cross beside every line, a phone name above its lines when there are more phones */
.item { position: relative; }
.item__x { align-self: center; width: 34px; height: 34px; border: 0; background: none; color: var(--red);
  font-size: 26px; line-height: 1; cursor: pointer; border-radius: 50%; }
.item__x:hover, .item__x:focus-visible { background: rgba(212, 0, 0, 0.08); }
.item--phone { display: block; min-height: 0; padding: 10px 0 0; font-size: 14px; letter-spacing: .04em; color: var(--ink-soft); }
.another { text-align: center; padding: 10px 0 2px; font-size: 15px; }
