/*
 * The HGA storefront's own rules: what Yamu's pages lack, styled with their
 * custom properties (--red, --ink, --line-2…), loaded after their stylesheets in
 * layouts/hga_storefront. Their files under hga_storefront/css/ stay exactly
 * as Yamu wrote them (test/config/hga_storefront_assets_test.rb), so a fix to
 * how one of their elements looks goes here, never there. Our own classes are
 * sf- (storefront), so none can meet one of theirs.
 */

/* Stripe's card field, where Yamu's page has card inputs: the same box as
   their .f input, and the states Stripe sets on it. */
.sf-card {
  display: flex;
  align-items: center;
  height: 50px;
  padding: 0 156px 0 14px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  transition: border-color .15s, box-shadow .15s;
}
.sf-card > * { width: 100%; }
.sf-card.StripeElement--focus { border-color: var(--text); box-shadow: 0 0 0 3px var(--line); }
.sf-card.StripeElement--invalid { border-color: var(--red); box-shadow: 0 0 0 3px rgba(230, 36, 41, .12); }

/* Why a POST was refused, and a known email's note, just above Pay. */
.sf-refusal,
.sf-alert {
  border-left: 4px solid var(--red);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--red-text);
}
.sf-refusal ul { display: grid; gap: 4px; }

/* Why Pay is shut: a disabled button gives no feedback on click. Gone once
   the terms box is ticked. */
.sf-terms-hint { margin-top: -6px; font-size: 13px; color: var(--red-text); text-align: center; }
.co-place:has(#pass-terms:checked) .sf-terms-hint { display: none; }

/* Yamu's .btn has no disabled look, so a shut Pay read as live. */
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; transform: none; }

/* A signed-in buyer: who is paying, and their saved ways to pay. */
.sf-buyer { display: grid; gap: 2px; font-size: 15px; }
.sf-buyer span { color: var(--text-2); }
.sf-method {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
}
.sf-method:has(input:checked) { border-color: var(--text); }
.sf-method > span { display: grid; gap: 2px; font-size: 15px; }
.sf-method > span > span { font-size: 13px; color: var(--text-2); }
.sf-method input { accent-color: var(--red); width: 18px; height: 18px; flex-shrink: 0; }
.sf-method .sf-method-warning-error { color: var(--red-text); }
.sf-method-new:hover { border-color: var(--text); }
.sf-fund { font-size: 14px; color: var(--text); text-decoration-color: var(--red); text-underline-offset: 3px; }

/* A notice the page arrived with (a card added, a sign-in), over the top of
   the page. flash_controller fades it after five seconds or a click: it adds
   .hidden, which Yamu's CSS doesn't define, then removes the element. */
.sf-flash {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: grid;
  gap: 6px;
  max-width: min(92vw, 480px);
  padding: 12px 16px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: opacity .3s;
}
.sf-flash.hidden { opacity: 0; }
.sf-flash-alert { color: var(--red-text); }

/* The product page's 3D poly slab is a drawing of the case, not a photograph
   of it, and the line under it says so. Yamu's page has no such line. It sits
   after the gallery's two stages and shows only while the poly one does, and
   never over a photo (.is-photo), where the stages are hidden by class. */
.sf-render-note {
  display: none;
  max-width: 36ch;
  margin: 0;
  padding: 0 12px;
  text-align: center;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .62);
}
.sh-gal:not(.is-photo) .stage-in[data-housing="poly"]:not([hidden]) ~ .sf-render-note { display: block; }

/* "Behind the glass": each marquee slab is a button that opens the lightbox
   (hga-lightbox). The marquee pauses on hover and on keyboard focus, as Yamu's
   does, but not on the focus a click leaves behind, and while the lightbox is
   open. */
.jmarq-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.jmarq-open:focus-visible { outline: 2px solid #fff; outline-offset: 4px; border-radius: 12px; }
.jmarq:focus-within:not(:hover):not(:has(:focus-visible)) .jmarq-track { animation-play-state: running; }
.jmarq-lightbox:has(dialog[open]) .jmarq-track { animation-play-state: paused; }

/* The dialog fills the window, so a click anywhere off the slab lands on the
   dialog itself, which the controller reads as the backdrop. */
.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(5, 5, 5, .92);
  color: #fff;
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; gap: clamp(8px, 2vw, 28px); }
.lightbox figure { display: grid; justify-items: center; gap: 14px; margin: 0; }
.lightbox img { display: block; width: auto; height: auto; max-width: min(88vw, 1100px); max-height: 82vh; }
.lightbox figcaption { font-size: 15px; font-weight: 600; letter-spacing: .01em; color: rgba(255, 255, 255, .82); }
.lightbox-close, .lightbox-step {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
}
.lightbox-close { position: absolute; top: 18px; right: 18px; font-size: 26px; line-height: 1; }
.lightbox-close:hover, .lightbox-step:hover { background: rgba(255, 255, 255, .18); }
.lightbox-step svg { width: 18px; height: 18px; }
@media (max-width: 640px) {
  .lightbox[open] { flex-wrap: wrap; align-content: center; }
  .lightbox figure { order: -1; width: 100%; }
  .lightbox img { max-width: 94vw; max-height: 70vh; }
}

/* hybridgrading.com/verify: the record and the "no record" answer, in the dark
   theme's tokens. The lookup above them is Yamu's own hero (.phero, .lookup). */
.sf-note { margin-top: 10px; color: rgba(255, 255, 255, .5); }
.sf-cert {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 28px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  background: var(--surface);
}
.sf-cert-noimg { grid-template-columns: 1fr; }
.sf-cert-img { display: flex; align-items: center; justify-content: center; padding: 26px; background: var(--ink-2); }
.sf-cert-img img { width: 100%; max-width: 240px; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .6)); }
.sf-cert-body { min-width: 0; padding: 26px 26px 26px 0; }
.sf-cert-noimg .sf-cert-body { padding: 26px; }
.sf-cert-ok {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--surface-3);
  color: var(--text);
  font-family: var(--mono, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.sf-cert-ok i { display: inline-block; flex: none; width: 8px; height: 8px; background: var(--red); }
.sf-cert-name { margin: 14px 0 4px; font-size: 28px; line-height: 1.05; text-transform: uppercase; color: var(--text); }
.sf-cert-meta { font-family: var(--mono, monospace); font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.sf-cert-grade {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 22px;
  align-items: center;
  margin: 20px 0;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.sf-cert-big { font-size: 72px; font-weight: 800; font-style: italic; line-height: 1; color: var(--red-text); }
.sf-cert-big small {
  display: block;
  font-family: var(--mono, monospace);
  font-size: 10px;
  font-style: normal;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.sf-cert-sg { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.sf-cert-sg div { border: 1px solid var(--line); padding: 8px 10px; }
.sf-cert-sg b { display: block; font-size: 20px; font-weight: 800; line-height: 1; color: var(--text); }
.sf-cert-sg span, .sf-cert-kv span {
  font-family: var(--mono, monospace);
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.sf-cert-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; font-size: 14px; }
.sf-cert-kv b { display: block; font-weight: 500; color: var(--text); }
.sf-cert-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
@media (max-width: 860px) {
  .sf-cert { grid-template-columns: 1fr; }
  .sf-cert-body { padding: 0 22px 22px; }
  .sf-cert-sg { grid-template-columns: repeat(3, 1fr); }
}

/* "No record found": a result card like .sf-cert, in a neutral line instead of
   the verified red. */
.sf-noresult { max-width: 640px; padding: 20px 22px; border: 1px solid var(--line); border-top: 4px solid var(--line-2); background: var(--surface); }
.sf-noresult .eb { color: var(--muted); }
.sf-noresult-line { margin: 8px 0 6px; font-size: 18px; font-weight: 700; line-height: 1.2; text-transform: uppercase; color: var(--text); }
.sf-noresult-cert { display: inline-block; max-width: 100%; font-family: var(--mono, monospace); letter-spacing: .04em; overflow-wrap: anywhere; }
