/* Public checkout storefront.

   Loaded AFTER widgets/landing/static/style.css (pulled in by the shared
   landing/_head.html partial), so the palette, fonts, buttons, header and
   footer all come from the marketing site — this file only adds the
   storefront's own furniture: tabs, product cards and the condition sheet.
   Red stays banned as decoration; "not allowed" reads muted, not lossy. */

:root {
  --ok: #3fb950;
  --card-glow: 0 18px 46px rgba(0, 0, 0, .45);
}

#page { padding-top: 1rem; padding-bottom: 4rem; }
.hidden { display: none !important; }

/* --- payment result banner ------------------------------------------------ */
.banner {
  margin-top: 1.4rem; border: 1px solid rgba(63, 185, 80, .45);
  color: var(--ok); background: rgba(63, 185, 80, .08);
  border-radius: 12px; padding: .9rem 1.2rem; font-weight: 500;
  animation: ck-drop .35s ease both;
}
.banner.warn {
  border-color: rgba(212, 175, 55, .5); color: var(--gold-soft);
  background: rgba(212, 175, 55, .08);
}
@keyframes ck-drop {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

/* --- hero ----------------------------------------------------------------- */
.hero { text-align: center; padding: clamp(2.2rem, 5vw, 3.6rem) 0 1.6rem; position: relative; }
.hero::before {
  content: ""; position: absolute; inset: -20% 0 auto; height: 320px; z-index: -1;
  pointer-events: none;
  background: radial-gradient(620px 260px at 50% 0, rgba(47, 129, 247, .16), transparent 70%);
}
.hero-kick {
  display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--blue-hi); margin-bottom: .7rem;
  padding: 5px 14px; border-radius: 999px; border: 1px solid var(--border-hi);
  background: rgba(47, 129, 247, .08);
}
.hero h1 {
  margin: 0 0 .5rem; font-size: clamp(1.7rem, 4.2vw, 2.6rem); line-height: 1.15;
  letter-spacing: -.01em;
}
.hero p { margin: 0 auto; color: var(--silver); max-width: 620px; }

/* --- category tabs -------------------------------------------------------- */
.tabs {
  display: flex; gap: .4rem; justify-content: center; flex-wrap: wrap;
  margin-top: .6rem; padding: 5px; border-radius: 999px;
  border: 1px solid var(--border); background: rgba(255, 255, 255, .02);
  width: fit-content; margin-inline: auto; max-width: 100%;
}
.tabs button {
  position: relative; background: transparent; border: 0; color: var(--silver);
  border-radius: 999px; padding: 10px 22px; font: inherit; font-size: .92rem;
  font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}
.tabs button:hover { color: var(--text); background: rgba(255, 255, 255, .04); }
.tabs button.on {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), #1863dc);
  box-shadow: 0 6px 20px rgba(47, 129, 247, .38);
}
.tabs button.on:active { transform: scale(.97); }
.tabs .empty { color: var(--muted); padding: 10px 18px; }
.cat-subtitle {
  text-align: center; color: var(--muted); margin: 1rem 0 0; min-height: 1.3em;
  transition: opacity .2s ease;
}
.cat-subtitle.swapping { opacity: 0; }

/* --- product grid --------------------------------------------------------- */
/* Tracks are capped and the row is centred, so a category holding one or two
   products reads as a deliberate line-up instead of a stray card on the left. */
.pillars {
  display: grid; gap: 1.2rem; margin-top: 2rem; align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(295px, 355px));
  justify-content: center;
}
.pillar {
  position: relative; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--panel-hi), var(--panel));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 1.35rem 1.25rem;
  /* switching category re-renders the grid: each card rises into place, and
     --i staggers them left-to-right so the swap reads as one movement */
  opacity: 0; transform: translateY(14px) scale(.985);
  transition: opacity .38s ease, transform .38s cubic-bezier(.2, .7, .3, 1),
              border-color .18s ease, box-shadow .25s ease;
  transition-delay: calc(var(--i, 0) * 55ms);
}
.pillar.in { opacity: 1; transform: none; }
.pillar:hover {
  border-color: var(--border-hi); box-shadow: var(--card-glow);
  transform: translateY(-3px); transition-delay: 0s;
}
.pillar.featured { border-color: rgba(47, 129, 247, .45); }
.pillar.featured::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit;
  pointer-events: none; box-shadow: inset 0 0 0 1px rgba(47, 129, 247, .18);
}

/* --- badge ---------------------------------------------------------------- */
.pillar .badge {
  position: absolute; top: -13px; right: 18px; z-index: 2;
  display: inline-flex; align-items: center; gap: .35rem;
  padding: 5px 14px; border-radius: 999px; overflow: hidden;
  font-size: .68rem; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: #fff;
  background: linear-gradient(135deg, var(--blue), #1863dc);
  box-shadow: 0 6px 20px rgba(47, 129, 247, .5),
              0 0 0 4px rgba(47, 129, 247, .1);
}
/* a slow light sweep so the badge catches the eye without blinking at it */
.pillar .badge::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: translateX(-160%);
  animation: ck-sheen 4.5s ease-in-out infinite;
}
@keyframes ck-sheen {
  0%, 62% { transform: translateX(-160%); }
  88%, 100% { transform: translateX(320%); }
}
.pillar.bundle .badge {
  color: #1a1400;
  background: linear-gradient(135deg, var(--gold), var(--gold-soft));
  box-shadow: 0 6px 20px rgba(212, 175, 55, .45),
              0 0 0 4px rgba(212, 175, 55, .1);
}

/* --- card head ------------------------------------------------------------ */
.pillar .size {
  font-size: 1.85rem; font-weight: 800; color: var(--gold);
  font-variant-numeric: tabular-nums; line-height: 1.1;
  font-family: "Oswald", inherit; letter-spacing: .01em;
}
.pillar .ttl { font-weight: 600; margin-top: .3rem; }
.pillar .sub { color: var(--muted); font-size: .84rem; min-height: 1.1em; }

.pillar ul {
  list-style: none; margin: 1rem 0; padding: .9rem 0 0;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: .5rem; font-size: .88rem;
}
.pillar ul li { display: flex; justify-content: space-between; gap: 1rem; }
.pillar ul li span { color: var(--muted); }
.pillar ul li b { font-weight: 600; }
.pillar ul li b.ok { color: var(--ok); }

/* --- condition sheet (Details) -------------------------------------------- */
.pillar .sub + .det-btn { margin-top: 1rem; }
.det-btn {
  appearance: none; width: 100%; margin-bottom: .9rem;
  background: rgba(255, 255, 255, .03); border: 1px solid var(--border);
  color: var(--silver); border-radius: 10px; padding: 9px 12px;
  font: inherit; font-size: .84rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: .45rem;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.det-btn:hover { border-color: var(--border-hi); color: var(--text); }
.det-btn .caret { transition: transform .25s ease; font-size: .7em; }
.det-btn[aria-expanded="true"] { color: var(--text); border-color: var(--border-hi); }
.det-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }
/* 0fr → 1fr animates to the panel's natural height without a magic max-height */
.det-wrap {
  display: grid; grid-template-rows: 0fr; margin-bottom: 0;
  transition: grid-template-rows .3s ease, margin-bottom .3s ease;
}
.det-wrap.open { grid-template-rows: 1fr; margin-bottom: .9rem; }
.det-inner { overflow: hidden; }
.det-t {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; color: var(--muted); padding: .2rem 0 .6rem;
}
.det-rows { display: flex; flex-direction: column; }
.det-rows > div {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; font-size: .84rem; padding: 7px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .045);
}
.det-rows > div:last-child { border-bottom: 0; }
.det-rows dt, .det-rows .dl { color: var(--muted); }
.det-rows .dv { font-weight: 600; text-align: right; }
.det-rows .dv.ok { color: var(--ok); }
.det-rows .dv.no { color: var(--silver); opacity: .75; }
.det-rows .dv.muted { color: var(--muted); font-weight: 500; }

/* --- the chain: the card's funded face ------------------------------------
   The card turns instead of growing. Content is swapped at the half-turn
   (see flip() in script.js), so the two faces need no matching height and a
   long condition sheet on the back cannot stretch the row on the front. */
.pillar { transform-style: preserve-3d; }
.pillar.flipping { transform: rotateY(90deg); transition: transform .17s ease-in; }
.pillar.flipping:hover { transform: rotateY(90deg); }
.pillar.flipped { border-color: rgba(212, 175, 55, .42); }
.pillar.flipped:hover { border-color: rgba(212, 175, 55, .6); }
.chain-btn {
  appearance: none; width: 100%; margin: 0 0 .9rem; display: flex;
  align-items: center; justify-content: space-between; gap: .5rem;
  background: rgba(47, 129, 247, .07); color: var(--text);
  border: 1px dashed rgba(47, 129, 247, .45); border-radius: 10px;
  padding: 9px 12px; font: inherit; font-size: .84rem; font-weight: 600;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.chain-btn:hover { background: rgba(47, 129, 247, .13); border-color: var(--blue); }
.chain-btn .caret { font-size: .8em; color: var(--blue); }
.chain-btn.back {
  margin: auto 0 0; background: transparent; color: var(--silver);
  border-style: solid; border-color: var(--border); justify-content: center;
}
.chain-btn.back:hover { border-color: var(--border-hi); color: var(--text); }
.pillar-back { display: flex; flex-direction: column; flex: 1; }
.pillar-back .kick {
  font-size: .68rem; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold-soft, var(--muted));
  margin-bottom: .35rem;
}
.pillar-back .ttl { margin-bottom: .2rem; }

/* --- add-ons -------------------------------------------------------------- */
.addons {
  border-top: 1px solid var(--border); padding-top: .9rem; margin-bottom: 1rem;
  display: flex; flex-direction: column; gap: .55rem;
}
.addons .addons-t {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .12em; color: var(--muted);
}
.addon {
  display: flex; align-items: flex-start; gap: .6rem; font-size: .87rem;
  cursor: pointer; padding: 7px 9px; margin: 0 -9px; border-radius: 9px;
  transition: background .15s ease;
}
.addon:hover { background: rgba(255, 255, 255, .035); }
.addon input { margin-top: 3px; accent-color: var(--blue); }
.addon .ad-p { margin-left: auto; white-space: nowrap; font-weight: 600; }
.addon small { display: block; color: var(--muted); }

/* --- price + buy ---------------------------------------------------------- */
.pillar .price-row {
  display: flex; align-items: baseline; gap: .6rem; margin-top: auto;
  padding-top: .3rem;
}
.pillar .price {
  font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.pillar .compare { color: var(--muted); text-decoration: line-through; font-size: .95rem; }
/* the balance an add-on adds, next to the price — empty until one is ticked,
   and hidden while empty so it costs no width in the row */
.pillar .size-bump {
  margin-left: auto; white-space: nowrap; font-size: .82rem; font-weight: 600;
  color: var(--gold); font-variant-numeric: tabular-nums;
}
.pillar .size-bump:empty { display: none; }
.buy {
  display: block; width: 100%; text-align: center; margin-top: .9rem;
  background: linear-gradient(135deg, var(--blue), #1863dc);
  border: 0; color: #fff; font: inherit; font-weight: 700; font-size: .98rem;
  border-radius: 999px; padding: 13px 0; cursor: pointer;
  box-shadow: 0 8px 24px rgba(47, 129, 247, .32);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.buy:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(47, 129, 247, .45); }
.buy:active { transform: translateY(0); }
.buy[disabled] { opacity: .6; cursor: wait; box-shadow: none; transform: none; }

/* --- bundles -------------------------------------------------------------- */
.pillar.bundle { border-color: rgba(212, 175, 55, .32); }
.pillar.bundle:hover { border-color: rgba(212, 175, 55, .55); }
.pillar.bundle .ttl { font-size: 1.15rem; }
.pillar.bundle .desc {
  color: var(--silver); font-size: .9rem; white-space: pre-line; margin-top: .45rem;
}
.pillar.bundle .contains {
  border-top: 1px solid var(--border); margin-top: .9rem; padding-top: .9rem;
  font-size: .88rem; display: flex; flex-direction: column; gap: .45rem;
}
.pillar.bundle .contains b { color: var(--gold); }

.empty { grid-column: 1/-1; text-align: center; color: var(--muted); padding: 3rem 0; }
.foot-note {
  margin-top: 2.6rem; padding-top: 1.3rem; border-top: 1px solid var(--border);
  color: var(--muted); font-size: .82rem; text-align: center;
}

@media (max-width: 640px) {
  .pillars { grid-template-columns: 1fr; }
  .tabs { width: 100%; justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; }
  .tabs button { padding: 9px 16px; }
}

/* Motion is decoration here — the page must be equally usable without it. */
@media (prefers-reduced-motion: reduce) {
  .pillar { opacity: 1; transform: none; transition: border-color .18s ease; }
  .pillar:hover { transform: none; }
  .pillar .badge::after { animation: none; }
  .banner { animation: none; }
  .buy:hover { transform: none; }
  .det-wrap { transition: none; }
}

/* Credit the buyer already holds. Stated before the choice, not after: the
   money is applied automatically, so discovering it at the card form would
   read as a surprise rather than a benefit. */
.credit-banner { display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap;
                 margin: 0 0 1.4rem; padding: .8rem 1.1rem; border-radius: 12px;
                 border: 1px solid rgba(46,160,67,.35);
                 background: rgba(46,160,67,.08); font-size: .95rem; }
.credit-banner.hidden { display: none; }
.credit-banner .cb-amt { font-weight: 700; font-size: 1.15rem; }
.credit-banner small { flex-basis: 100%; opacity: .75; font-size: .82rem; }

/* --- the chain's price ---------------------------------------------------
   A Pass&Pay funded phase costs money of its own. The chip rides the flip
   button so the front face never implies the sticker price is the last one;
   the row states it plainly on the funded face. */
.chain-btn > span:first-child { margin-right: auto; text-align: left; }
.chain-btn .chain-cost {
  font-size: .78rem; font-weight: 700; color: var(--gold, var(--muted));
  white-space: nowrap;
}
.pillar-back .next-cost {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: .6rem; margin: .1rem 0 .7rem; padding: 7px 10px;
  border: 1px solid var(--border); border-radius: 9px;
  background: rgba(255, 255, 255, .03);
}
.pillar-back .next-cost span {
  font-size: .74rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}
.pillar-back .next-cost b {
  font-size: 1rem; font-weight: 800; color: var(--gold, var(--text));
}
