:root {
  --paper: #f3ecdf;
  --ink: #241c16;
  --muted: #5c5146;
  --line: #e0d3c2;
  --clay: #8d2f22;
  --clay-dark: #732518;
  --pine: #1d3a32;
  --card: #17342c;
  --gold: #e1c27a;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, #f8e6d4, transparent 55%),
    var(--paper);
  font-family: "Segoe UI", sans-serif;
  border-top: 8px solid var(--clay);
}
body.locked { overflow: hidden; }
button, input { font: inherit; }
img { display: block; max-width: 100%; }

.top, .foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 22px 7vw;
}
.top { border-bottom: 1px solid var(--line); }
.mark {
  margin: 0;
  color: inherit;
  text-decoration: none;
  font-family: Georgia, "Palatino Linotype", serif;
  letter-spacing: 0.18em;
  font-size: 14px;
}
.where, .foot, .per, .eyebrow {
  margin: 0;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
}
.stage, .top, .foot { width: 100%; min-width: 0; max-width: 100%; }
.stage { flex: 1; padding: 28px 7vw 48px; }
.status { color: var(--muted); }

.product {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 36px;
  max-width: 1080px;
  margin: 0 auto;
  align-items: center;
}
.product > * { min-width: 0; }
.photo {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 1;
  border-radius: 28px;
  overflow: hidden;
  background: #e7d5bf;
  box-shadow: 0 24px 50px rgba(36, 28, 22, 0.08);
}
.photo img { width: 100%; height: 100%; object-fit: cover; }
.badge {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.92);
  color: var(--pine);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.eyebrow { margin-bottom: 8px; }
h1 {
  margin: 0 0 14px;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: clamp(34px, 8vw, 68px);
  font-weight: 600;
  line-height: 0.96;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}
#desc {
  margin: 0 0 18px;
  max-width: 38ch;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.price {
  margin: 0;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: clamp(36px, 5vw, 56px);
  letter-spacing: -0.03em;
}
.per { margin-top: 4px; }
.qty, .total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 16px;
}
.stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}
.stepper button, .ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 12px;
  cursor: pointer;
}
.stepper button {
  width: 44px;
  height: 44px;
  font-size: 20px;
}
.stepper span { min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.total-row strong { font-size: 20px; }
.buy, .ghost { width: 100%; margin-top: 18px; padding: 16px 18px; font-size: 17px; font-weight: 600; cursor: pointer; }
.pay-actions .buy, .pay-actions .ghost { margin-top: 0; }
.buy {
  border: 0;
  border-radius: 14px;
  background: var(--clay);
  color: #fff8f3;
}
@media (hover: hover) {
  .buy:hover { background: var(--clay-dark); }
}
button:disabled { opacity: 0.45; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }

.foot { border-top: 1px solid var(--line); }
.foot a { color: var(--ink); }

.overlay {
  position: fixed;
  z-index: 40;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(36, 28, 22, 0.46);
}
.sheet {
  width: 100%;
  max-height: 92vh;
  overflow: auto;
  padding: 18px 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0;
  background: #fffaf4;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.2);
}
@supports (height: 100dvh) {
  .sheet { max-height: 92dvh; }
}
.sheet h2 { margin: 6px 0 0; font-family: Georgia, "Palatino Linotype", serif; font-size: 28px; font-weight: 600; }
.pay-amount {
  margin: 8px 0 0;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: 40px;
  letter-spacing: -0.03em;
}
.pay-summary, .pay-lead, .pay-note, .pay-empty, .copy-status { color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.pay-summary { margin: 4px 0 0; }
.pay-lead { margin: 8px 0 14px; }
.bank-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 190px;
  padding: 20px;
  border-radius: 18px;
  color: #f6f1e7;
  background:
    radial-gradient(120px 80px at 100% 0%, rgba(255, 255, 255, 0.16), transparent 60%),
    linear-gradient(160deg, #2c5a4a, var(--card));
}
.bank-card-top, .bank-holder { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.bank-card-top span:first-child,
.bank-holder strong { min-width: 0; overflow-wrap: anywhere; }
.bank-card-top span:first-child { letter-spacing: 0.08em; text-transform: uppercase; font-size: 13px; }
.chip { width: 42px; height: 32px; flex: none; border-radius: 6px; background: linear-gradient(135deg, #f0d48a, #b8893e); }
.bank-kind {
  margin: 16px 0 0;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
}
.bank-number {
  margin: 6px 0 18px;
  font-size: clamp(18px, 4.4vw, 26px);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.bank-holder { display: block; margin: 0; font-size: 14px; }
.bank-holder strong { display: block; margin-top: 2px; overflow-wrap: break-word; }
.bank-holder span { display: block; opacity: 0.7; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.pay-note, .pay-empty { margin: 14px 0 0; }
.pay-actions { display: grid; gap: 8px; }
.ghost { margin-top: 0; background: transparent; }
.copy-status { min-height: 1.2em; margin: 8px 0 0; }

@media (max-width: 799px) {
  .photo { aspect-ratio: 16 / 9; max-height: 32vh; border-radius: 20px; }
  .product { gap: 20px; }
  .product, .info, .qty { min-width: 0; }
  h1 { margin-bottom: 8px; }
  #desc { margin-bottom: 10px; }
  .qty, .total-row { margin-top: 14px; padding-top: 12px; }
  .stage { padding: 16px 16px 28px; }
  .top, .foot { padding: 14px 16px; }
  .top {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding-top: max(14px, env(safe-area-inset-top));
  }
  .foot { padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .mark { letter-spacing: 0.12em; font-size: 13px; }
  .where, .foot { letter-spacing: 0.06em; font-size: 11px; }
  #desc { font-size: 16px; }
  .price { font-size: 40px; }
  .bank-number { font-size: 18px; letter-spacing: 0.04em; }
  .bank-number.is-clabe { font-size: 16px; letter-spacing: 0.01em; }
  .bank-holder strong { font-size: 13px; }
  .pay-amount { font-size: 34px; }
}

@media (min-width: 800px) {
  .product { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 56px; }
  .overlay { align-items: center; padding: 24px; }
  .sheet {
    width: min(440px, 100%);
    border-radius: 24px;
    padding: 22px 22px 18px;
  }
}

@media (min-width: 1200px) {
  .product { gap: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
