/* =====================================================================
   Vexxed Vanilla - headless store additions (sits on top of base.css)
   ===================================================================== */

/* Digits and price symbols in display text use Barlow Bold: the pixel font's 5 reads as 8. */
@font-face { font-family: "VV Digits"; src: url("/assets/fonts/barlow-700-digits.woff2") format("woff2");
  font-weight: 100 900; font-display: swap; unicode-range: U+24-26, U+2B-2C, U+2E, U+30-39; }

/* anything marked hidden stays hidden, whatever its display rule */
[hidden] { display: none !important; }

/* brand: full wordmark on desktop, shield icon on phones */
.vv-brand-icon { display: none; width: 40px; height: auto; }
.vv-brand img { image-rendering: auto; }
@media (max-width: 860px) {
  .vv-brand-icon { display: block; }
}

/* buttons rendered as <button> inherit the same look */
button.vv-link-more, button.vv-link-remove { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; font-size: var(--t-sm); font-weight: 600; }
button.vv-link-more { color: var(--accent-hi); }
button.vv-link-more:hover { color: #fff; }
.vv-btn[disabled] { opacity: .65; cursor: progress; transform: none; }

/* card art is a <button> that opens details */
button.vv-card-art { border: 0; border-bottom: 2px solid var(--line); padding: 0; width: 100%; cursor: pointer; font: inherit; color: inherit; }
@media (max-width: 640px) { button.vv-card-art { width: 112px; border-bottom: 0; border-right: 2px solid var(--line); } }

/* cart button is a <button> now */
button.vv-cart { border: 0; font: inherit; cursor: pointer; }

/* user chip */
button.vv-user { background: none; border: 0; cursor: pointer; font: inherit; color: var(--fg); padding: 4px; }
.vv-user img { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--accent); }

/* hero logo is smooth art, not pixel art */
.vv-hero-logo { image-rendering: auto; }
.vv-hero-copy .vv-eyebrow { color: var(--gold); }

/* skeleton while the catalogue loads */
.vv-skel { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: vv-skel 1.4s linear infinite; }
@keyframes vv-skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.vv-skel-card { height: 360px; margin: var(--px); }
.vv-skel-cat { height: 140px; margin: var(--px); }

/* ---------- rank cards: perks list + tier strip ---------- */
.vv-card-tier { font-family: var(--f-label); font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--tint, var(--accent-hi)); }
.vv-perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; font-size: var(--t-sm); color: var(--muted); }
.vv-perks li { position: relative; padding-left: 16px; }
.vv-perks li::before { content: ""; position: absolute; left: 1px; top: .58em; width: 6px; height: 6px; background: var(--tint, var(--accent-hi)); }
.vv-perks li strong { color: var(--fg); font-weight: 600; }
.vv-flag-best { right: 10px; left: auto; background: var(--tint, var(--gold)); color: var(--ink); }
.vv-flag-bonus { left: 10px; background: var(--good); color: var(--ink); }

/* quantity stepper on cards and basket lines */
.vv-stepper { display: inline-flex; align-items: stretch; box-shadow: inset 0 0 0 2px var(--line-hi); background: var(--bg); }
.vv-stepper button { width: 34px; min-height: 36px; background: var(--surface-2); color: var(--fg); border: 0; font: 700 18px/1 var(--f-display); cursor: pointer; }
.vv-stepper button:hover { background: var(--accent); }
.vv-stepper button[disabled] { opacity: .4; cursor: not-allowed; background: var(--surface-2); }
.vv-stepper output { min-width: 34px; display: grid; place-items: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- basket drawer ---------- */
.vv-drawer { position: fixed; inset: 0; z-index: 70; }
.vv-drawer[hidden] { display: none; }
.vv-drawer-backdrop { position: absolute; inset: 0; background: rgba(5, 2, 10, .72); animation: vv-fade .15s ease; }
.vv-drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); display: flex; flex-direction: column; background: var(--bg-2);
  box-shadow: -3px 0 0 var(--line-hi), -30px 0 80px rgba(0, 0, 0, .55); animation: vv-slide .2s ease; }
@keyframes vv-slide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes vv-fade { from { opacity: 0; } to { opacity: 1; } }
.vv-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.vv-drawer-head h2 { font-size: var(--t-xl); }
.vv-drawer-x { background: none; border: 0; color: var(--muted); font-size: 30px; line-height: 1; cursor: pointer; }
.vv-drawer-x:hover { color: #fff; }
.vv-drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; display: grid; gap: 18px; align-content: start; }
.vv-drawer-foot { border-top: 1px solid var(--line); padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 12px; background: var(--surface); }
.vv-drawer .vv-summary-user { padding: 0; border: 0; }
.vv-drawer .vv-lines { gap: 12px; }
.vv-drawer .vv-line { grid-template-columns: 48px minmax(0, 1fr) auto; grid-template-areas: "art info x" "art qty price"; gap: 8px 12px; padding: 12px 14px; }
.vv-drawer .vv-line-art { grid-area: art; width: 48px; height: 48px; }
.vv-drawer .vv-line-info { grid-area: info; }
.vv-drawer .vv-line-qty { grid-area: qty; justify-self: start; align-self: center; }
.vv-drawer .vv-line-price { grid-area: price; justify-self: end; align-self: center; }
.vv-drawer .vv-line-x { grid-area: x; justify-self: end; background: none; border: 0; cursor: pointer; }
.vv-drawer .vv-empty { padding: 36px 16px; }
.vv-codes { display: grid; gap: 10px; }
.vv-codes details { background: var(--surface); box-shadow: inset 0 0 0 2px var(--line); }
.vv-codes summary { cursor: pointer; padding: 12px 14px; font-family: var(--f-display); font-weight: 500; list-style: none; display: flex; justify-content: space-between; }
.vv-codes summary::-webkit-details-marker { display: none; }
.vv-codes summary::after { content: "+"; color: var(--accent-hi); }
.vv-codes details[open] summary::after { content: "\2212"; }
.vv-codes .vv-inline-form { padding: 0 14px 14px; }
.vv-codes .vv-applied { padding: 0 14px 14px; }
.vv-total-row { display: flex; justify-content: space-between; align-items: baseline; }
.vv-total-row span { color: var(--muted); }
.vv-total-row strong { font: 700 var(--t-2xl)/1 var(--f-display); color: var(--gold); font-variant-numeric: tabular-nums; }
.vv-total-row small { font: 500 var(--t-sm) var(--f-body); color: var(--muted); }
.vv-secure { display: flex; gap: 8px; align-items: center; justify-content: center; color: var(--faint); font-size: var(--t-xs); text-align: center; }
.vv-secure svg { flex: none; }

/* ---------- login dialog ---------- */
.vv-login-card { margin: 0 auto; }
.vv-login-card .vv-field-error { color: var(--bad); font-size: var(--t-sm); min-height: 1.3em; text-align: left; }
.vv-edition { display: grid; grid-template-columns: 1fr 1fr; gap: 0; width: 100%; box-shadow: inset 0 0 0 2px var(--line-hi); }
.vv-edition button { min-height: 40px; background: transparent; color: var(--muted); border: 0; font: 500 var(--t-md)/1 var(--f-display); cursor: pointer; }
.vv-edition button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.vv-ign-wrap { position: relative; }
.vv-ign-wrap .vv-dotpfx { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--accent-hi); font-weight: 700; pointer-events: none; }
.vv-ign-wrap.is-bedrock input { padding-left: 24px; }
.vv-ign-wrap:not(.is-bedrock) .vv-dotpfx { display: none; }

/* ---------- status / community cards ---------- */
.vv-payments li.vv-muted { display: block; }
.vv-status-card .vv-status { font-size: var(--t-lg); }
.vv-status-card .vv-status strong { color: var(--good); font-family: var(--f-display); font-size: var(--t-xl); }
.vv-status-card .vv-ip-line { font-family: var(--f-label); font-size: var(--t-xs); color: var(--muted); letter-spacing: .04em; }
.vv-status-meta { display: flex; gap: 8px 16px; flex-wrap: wrap; color: var(--faint); font-size: var(--t-xs); }

/* ---------- thank-you banner ---------- */
.vv-thanks { --pb: var(--good); display: flex; gap: 18px; align-items: center; padding: 20px 24px; margin: 24px var(--px) 0;
  background: linear-gradient(120deg, rgba(0, 255, 102, .12), var(--surface) 60%); }
.vv-thanks img { width: 56px; height: 56px; flex: none; }
.vv-thanks h2 { font-size: var(--t-xl); color: var(--good); }
.vv-thanks p { color: var(--muted); }

/* ---------- rules / legal pages ---------- */
.vv-doc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; max-width: 860px; }
.vv-doc-head { display: grid; gap: 10px; }
.vv-doc-head p:not(.vv-eyebrow) { color: var(--muted); font-size: var(--t-lg); max-width: 60ch; }
.vv-rules { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: rule; }
.vv-rules li { --pb: var(--line); display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; align-items: start; padding: 18px 20px; margin: var(--px);
  background: var(--surface); counter-increment: rule;
  box-shadow: 0 -3px 0 0 var(--pb), 0 3px 0 0 var(--pb), -3px 0 0 0 var(--pb), 3px 0 0 0 var(--pb), inset 0 3px 0 0 rgba(255, 255, 255, .05); }
.vv-rules li::before { content: counter(rule, decimal-leading-zero); font: 700 var(--t-2xl)/1 var(--f-display); color: var(--accent-hi); }
.vv-rules h2 { font-size: var(--t-lg); margin-bottom: 4px; }
.vv-rules p { color: var(--muted); }
.vv-rules li:hover { --pb: var(--line-hi); }
.vv-callout { --pb: var(--line-hi); padding: 18px 20px; margin: var(--px); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.vv-callout p { color: var(--muted); }
.vv-doc .vv-prose h2 { font-size: var(--t-xl); margin-top: 1.4em; }
.vv-doc .vv-prose h3 { font-size: var(--t-lg); margin-top: 1.4em; color: var(--accent-hi); }
.vv-doc .vv-prose p, .vv-doc .vv-prose li { color: var(--muted); }

/* ---------- footer: merchant of record ---------- */
.vv-footer-legal { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; align-items: center; padding-top: 18px; border-top: 1px solid var(--line); color: var(--faint); font-size: var(--t-xs); }
.vv-footer-legal p { max-width: 70ch; }
.vv-footer-legal nav { display: flex; gap: 16px; flex-wrap: wrap; }
.vv-footer-legal a { color: var(--muted); }
.vv-footer-brand img { image-rendering: auto; }

/* error state for the catalogue */
.vv-error { --pb: var(--bad); }

@media (max-width: 640px) {
  .vv-rules li { grid-template-columns: 40px minmax(0, 1fr); gap: 12px; padding: 14px 16px; }
  .vv-rules li::before { font-size: var(--t-xl); }
  .vv-thanks { flex-direction: column; align-items: flex-start; }
  .vv-card .vv-perks { display: none; }
}

/* =====================================================================
   Header controls: one size for everything in the menu bar
   ===================================================================== */
:root { --bar-h: 42px; --nav-w: 108px; --ease-out: cubic-bezier(.2, .8, .2, 1); }

/* category links sit directly in the nav row */
.vv-nav [data-nav-cats] { display: contents; }

/* nav links: identical boxes, centred text */
.vv-nav { align-items: center; gap: 8px; }
.vv-nav a {
  display: inline-flex; align-items: center; justify-content: center;
  height: var(--bar-h); min-width: var(--nav-w); padding: 0 16px;
  line-height: 1; white-space: nowrap; transition: background .15s ease, color .15s ease;
}

/* right-hand controls: same height and the same pixel frame */
.vv-account { gap: 12px; }
.vv-account .vv-btn,
.vv-account .vv-cart,
.vv-account .vv-user,
.vv-menu-btn {
  height: var(--bar-h); min-height: var(--bar-h); margin: var(--px); padding-block: 0;
  box-sizing: border-box;
}
.vv-account .vv-btn { min-width: 96px; font-size: var(--t-sm); }
button.vv-user {
  display: inline-flex; align-items: center; gap: 8px; padding: 0 12px 0 7px;
  background: var(--surface-2);
  box-shadow: 0 calc(var(--px) * -1) 0 0 var(--line-hi), 0 var(--px) 0 0 var(--line-hi),
              calc(var(--px) * -1) 0 0 0 var(--line-hi), var(--px) 0 0 0 var(--line-hi);
}
button.vv-user:hover { background: var(--surface); }
.vv-user img { width: 26px; height: 26px; }
.vv-account .vv-cart { padding-inline: 14px; }

.vv-nav-scrim { display: none; }

/* =====================================================================
   Phone / small-tablet menu: animated dropdown panel
   ===================================================================== */
@media (max-width: 860px) {
  .vv-header-in { position: relative; flex-wrap: nowrap; min-height: 64px; gap: 10px; }
  .vv-account { gap: 8px; }
  .vv-account .vv-btn { min-width: 0; padding-inline: 14px; }
  .vv-account .vv-cart { width: var(--bar-h); padding: 0; justify-content: center; }

  /* hamburger: framed like the other controls, morphs into an X */
  .vv-menu-btn {
    display: grid; place-content: center; gap: 4px; width: var(--bar-h); padding: 0; border: 0; cursor: pointer; order: 3;
    background: var(--surface-2); color: var(--fg);
    box-shadow: 0 calc(var(--px) * -1) 0 0 var(--line-hi), 0 var(--px) 0 0 var(--line-hi),
                calc(var(--px) * -1) 0 0 0 var(--line-hi), var(--px) 0 0 0 var(--line-hi);
    transition: background .15s ease;
  }
  .vv-menu-btn > span:not(.vv-sr) { display: block; width: 20px; height: 3px; background: currentColor; transition: transform .28s var(--ease-out), opacity .18s ease; }
  .vv-menu-btn[aria-expanded="true"] { background: var(--accent); }
  .vv-menu-btn[aria-expanded="true"] > span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .vv-menu-btn[aria-expanded="true"] > span:nth-child(2) { opacity: 0; transform: scaleX(.2); }
  .vv-menu-btn[aria-expanded="true"] > span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* the panel: always rendered, revealed top-down */
  .vv-nav, .vv-nav.is-open {
    display: flex; flex-direction: column; align-items: stretch; gap: 10px;
    position: absolute; z-index: 25; top: calc(100% + 1px); left: 0; right: 0;
    padding: 16px var(--gutter) 20px; margin: 0; flex-basis: auto; order: 0;
    background: linear-gradient(180deg, rgba(27, 15, 44, .98), rgba(13, 7, 20, .98));
    border-bottom: 3px solid var(--line-hi);
    box-shadow: 0 30px 60px rgba(0, 0, 0, .55);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    clip-path: inset(0 0 100% 0); opacity: 0; transform: translateY(-6px);
    visibility: hidden; pointer-events: none;
    transition: clip-path .34s var(--ease-out), opacity .22s ease, transform .34s var(--ease-out), visibility 0s linear .34s;
  }
  .vv-nav.is-open {
    clip-path: inset(0 0 -60px 0); opacity: 1; transform: none; visibility: visible; pointer-events: auto;
    transition: clip-path .38s var(--ease-out), opacity .2s ease, transform .38s var(--ease-out), visibility 0s;
  }

  /* menu rows: full-width framed buttons, all the same height */
  .vv-nav a {
    width: auto; min-width: 0; height: 54px; margin: var(--px); padding: 0 18px;
    justify-content: space-between; font-size: var(--t-lg); color: var(--fg);
    background: var(--surface);
    box-shadow: 0 calc(var(--px) * -1) 0 0 var(--line), 0 var(--px) 0 0 var(--line),
                calc(var(--px) * -1) 0 0 0 var(--line), var(--px) 0 0 0 var(--line);
    opacity: 0; transform: translateY(-8px);
    transition: opacity .25s ease, transform .3s var(--ease-out), background .15s ease;
    transition-delay: 0s;
  }
  .vv-nav a::after { content: "\2192"; font-family: var(--f-body); font-weight: 700; color: var(--accent-hi); transition: transform .2s var(--ease-out); }
  .vv-nav a:hover, .vv-nav a:focus-visible { background: var(--surface-2); }
  .vv-nav a:hover::after { transform: translateX(4px); }
  .vv-nav a.is-active {
    background: var(--surface-2); color: #fff;
    box-shadow: 0 calc(var(--px) * -1) 0 0 var(--accent), 0 var(--px) 0 0 var(--accent),
                calc(var(--px) * -1) 0 0 0 var(--accent), var(--px) 0 0 0 var(--accent),
                inset 5px 0 0 0 var(--accent);
  }
  .vv-nav.is-open a { opacity: 1; transform: none; transition-delay: calc(60ms + var(--i, 0) * 45ms); }

  /* dim the page behind the open menu */
  .vv-nav-scrim { display: block; position: fixed; inset: 0; z-index: 15; background: rgba(5, 2, 10, .55); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
  .vv-nav-scrim.is-on { opacity: 1; pointer-events: auto; }
}
@media (max-width: 380px) {
  .vv-account .vv-btn { padding-inline: 10px; font-size: var(--t-xs); }
}
@media (prefers-reduced-motion: reduce) {
  .vv-nav, .vv-nav.is-open, .vv-nav a, .vv-menu-btn > span:not(.vv-sr) { transition: none !important; }
}

/* =====================================================================
   Community tiles: fill the row and match heights (padding unchanged)
   ===================================================================== */
.vv-modules { align-items: stretch; }
.vv-module { display: flex; flex-direction: column; gap: 14px; }
.vv-module > .vv-btn-block { margin-top: auto; }          /* Copy IP sits at the bottom of a tall tile */
.vv-module .vv-payments { flex: 1; align-content: start; }
.vv-payments.is-empty, .vv-module .vv-empty-state { flex: 1; display: grid; place-items: center; align-content: center; text-align: center; gap: 10px; }
.vv-payments.is-empty li, .vv-empty-state { color: var(--muted); }
.vv-empty-state img, .vv-payments.is-empty img { width: 40px; height: 40px; margin: 0 auto 6px; display: block; }

/* home: 1 / 2 / 3 across; an odd tile out spans the full row */
[data-community] { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 620px) {
  [data-community] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  [data-community] > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 960px) {
  [data-community] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  [data-community] > :last-child:nth-child(odd) { grid-column: auto; }
}

/* category pages: beside the grid the sidebar runs its full height;
   below the grid the two tiles split the row evenly */
.vv-aside { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 620px) and (max-width: 1099px) {
  .vv-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .vv-with-aside:has(.vv-aside) { align-items: stretch; }
  .vv-aside { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; align-self: stretch; }
}

/* =====================================================================
   Package tags (bonus / best value / top rank / sale): never overlap
   ===================================================================== */
.vv-flags { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.vv-flags .vv-flag, .vv-card-tags .vv-flag { position: static; white-space: nowrap; }
.vv-card-tags { display: none; flex-wrap: wrap; gap: 6px; }

/* phones: the art box is too narrow for tags, so they move into the card text */
@media (max-width: 640px) {
  .vv-flags { display: none; }
  .vv-card-tags { display: flex; }
}
