/* Red Coral Universe — official store.
 *
 * Standalone: unlike the Angry Corpses and Big Lettuce storefronts, this store is
 * not a page inside somebody else's website, so there is no parent stylesheet to
 * inherit from. Everything the page needs — reset, nav, footer, type scale — is
 * here alongside the store components.
 *
 * Palette is the Red Coral Universe Brand Kit v1.0 dark set, the same tokens the
 * admin dashboard defines in its own globals.css:
 *   Coral Pink #EE2A76 · True Black #0A0A0A · True White #FFFFFF
 *   Brand Blue #28ACE0 · Champagne Gold #C9A574 · Off White #F5F5F5
 * Dark rather than the dashboard's light/editorial treatment, because shoppers
 * arrive here from redcoraluniverse.com, which is black with a coral accent.
 */

:root {
  color-scheme: dark;

  --page: #0a0a0a;      /* True Black — the brand value, not the kit's #0b0b0c */
  --card: #151517;      /* raised panel */
  --surface: #1c1c1f;   /* inset / input fill */
  --line: #2c2c31;

  --ink: #ffffff;
  --gray-300: #dcdcde;
  --gray-500: #a9a9ae;  /* 7.8:1 on the page — safe for body-size secondary text */

  --coral: #ee2a76;
  --coral-lift: #ff5091; /* the kit's dark-mode coral, used for hover */
  --blue: #28ace0;
  --gold: #c9a574;

  /* Text sitting ON a coral fill is True Black, not white. White on #EE2A76 is
     4.0:1 and misses AA for button-size text; black is 4.5:1 and passes. */
  --on-coral: #0a0a0a;

  --font: "Open Sans", "Avenir Next", "Helvetica Neue", Arial, sans-serif;

  --shell: 1180px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 800; letter-spacing: -0.01em; }
p { margin: 0; }
ul { margin: 0; padding: 0; }
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }

button {
  font-family: inherit;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}

:focus-visible { outline: 2px solid var(--coral); outline-offset: 2px; }

/* The store toggles elements with the `hidden` attribute, and several of them
   are flex/grid containers here — an explicit `display` beats the user-agent
   `[hidden] { display: none }`, so restate it with priority. */
[hidden] { display: none !important; }

.shell { width: 100%; max-width: var(--shell); margin: 0 auto; padding: 0 1.5rem; }

.section { padding: 3rem 0 4.5rem; }

.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--coral);
}

/* ─── NAV ────────────────────────────────────────────────────────────────────── */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 68px;
}

/* The wordmark is white lettering with the coral disc as its O, so it only ever
   sits on a dark ground — which is every page here. */
.nav-logo img { display: block; height: 30px; width: auto; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  list-style: none;
}

.nav-links a {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gray-500);
  transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active { color: var(--ink); }

.nav-cta {
  color: var(--on-coral) !important;
  background: var(--coral);
  border-radius: 999px;
  padding: 8px 16px;
  transition: background 0.2s;
}

.nav-cta:hover { background: var(--coral-lift); }

/* ─── PREVIEW BANNER ─────────────────────────────────────────────────────────── */

.preview-banner {
  position: sticky;
  top: 68px;
  z-index: 99;
  background: var(--coral);
  color: var(--on-coral);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  padding: 8px 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Preview mode persists for the browser session, so it needs an exit. */
.preview-banner button {
  border: 1px solid rgba(10, 10, 10, 0.55);
  border-radius: 999px;
  font: inherit;
  font-size: 11px;
  padding: 3px 12px;
}

.preview-banner button:hover { background: rgba(10, 10, 10, 0.12); }

/* ─── HERO ───────────────────────────────────────────────────────────────────── */

.page-hero {
  padding: 4rem 0 2.5rem;
  border-bottom: 1px solid var(--line);
  /* A coral wash off the top-left corner, echoing the mark. */
  background:
    radial-gradient(60rem 26rem at 12% -12%, rgba(238, 42, 118, 0.16), transparent 70%);
}

.page-hero h1 {
  font-size: clamp(2.4rem, 6vw, 3.75rem);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0.75rem 0;
}

.page-hero p { color: var(--gray-500); max-width: 52ch; }

/* ─── NOTICES ────────────────────────────────────────────────────────────────── */

.notice {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--gray-500);
  border-radius: 10px;
  background: var(--card);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}

.notice strong { font-size: 1.05rem; font-weight: 800; }
.notice span { color: var(--gray-500); font-size: 14px; }

.notice[data-tone="success"] { border-left-color: var(--coral); }
.notice[data-tone="success"] strong { color: var(--coral); }
.notice[data-tone="error"] { border-left-color: #ff6b3d; }
.notice[data-tone="error"] strong { color: #ff6b3d; }
.notice[data-tone="info"] { border-left-color: var(--blue); }

/* ─── STORE LAYOUT ───────────────────────────────────────────────────────────── */

.store-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 2.5rem;
  align-items: start;
}

/* ─── CATALOG ────────────────────────────────────────────────────────────────── */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
}

.product-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s;
}

.product-card:hover { border-color: var(--coral); }

.product-media {
  aspect-ratio: 1 / 1;
  /* `object-fit: cover` means the mockup fills this box, so the colour only
     shows while the image loads, or on the rare product with no mockup at all —
     both of which should read as a dark placeholder, not a white flash. */
  background: var(--surface);
  overflow: hidden;
  position: relative;
  cursor: zoom-in;
}

.product-media:focus-visible { outline: 2px solid var(--coral); outline-offset: -2px; }

.product-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Only hint at the larger view once the shopper is on the image. */
.zoom-hint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(10, 10, 10, 0.85);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.product-media:hover .zoom-hint,
.product-media:focus-visible .zoom-hint { opacity: 1; }

.product-body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.product-title { font-size: 1.05rem; }
.product-desc { color: var(--gray-500); font-size: 13px; line-height: 1.5; }
.product-price { color: var(--coral); font-size: 14px; font-weight: 700; }

.draft-flag {
  align-self: flex-start;
  background: rgba(238, 42, 118, 0.14);
  border: 1px solid var(--coral);
  color: var(--coral);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 10px;
}

.product-controls {
  margin-top: auto;
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* One dropdown per option axis (colour, size) instead of one giant list. */
.option-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.75rem;
}

.qty-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 0.75rem;
  align-items: end;
}

/* ─── FORM CONTROLS ──────────────────────────────────────────────────────────── */

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

select,
input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

select:focus,
input:focus {
  outline: none;
  border-color: var(--coral);
  box-shadow: 0 0 0 3px rgba(238, 42, 118, 0.16);
}

select option { background: #1c1c1f; }

/* ─── BUTTONS ────────────────────────────────────────────────────────────────── */

.button {
  width: 100%;
  background: var(--coral);
  color: var(--on-coral);
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.04em;
  transition: background 0.2s;
}

.button:hover:not(:disabled) { background: var(--coral-lift); }

.button:disabled {
  background: var(--surface);
  color: var(--gray-500);
  cursor: not-allowed;
}

.button.secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}

.button.secondary:hover:not(:disabled) { background: transparent; border-color: var(--coral); }

/* ─── CART ───────────────────────────────────────────────────────────────────── */

.cart {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  position: sticky;
  top: 92px;
}

.cart h2 { font-size: 1.35rem; margin-bottom: 1rem; }

.cart-items { list-style: none; }

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.ci-title { font-size: 14px; font-weight: 600; }
.ci-qtyprice { font-size: 14px; color: var(--coral); text-align: right; white-space: nowrap; }
.ci-variant { font-size: 12px; color: var(--gray-500); }

.ci-remove {
  grid-column: 2;
  justify-self: end;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-500);
  text-decoration: underline;
  padding: 0;
}

.ci-remove:hover { color: #ff6b3d; }

.cart-empty { color: var(--gray-500); font-size: 14px; }

.cart-summary { margin-top: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }

.cart-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 14px;
  color: var(--gray-500);
}

.cart-row.total { color: var(--ink); font-weight: 700; }
.cart-row.total span:last-child { color: var(--coral); }

.hint { color: var(--gray-500); font-size: 12px; }

/* ─── CHECKOUT OVERLAY ───────────────────────────────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(4, 4, 4, 0.84);
  backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}

.overlay.open { display: flex; }

.checkout-panel {
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  margin: auto;
}

.checkout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--line);
}

.checkout-head h2 { font-size: 1.5rem; }

.checkout-close,
.lightbox-close {
  color: var(--gray-500);
  font-size: 1.75rem;
  line-height: 1;
  padding: 0 0.25rem;
}

.checkout-close:hover,
.lightbox-close:hover { color: var(--ink); }

.checkout-body { padding: 1.5rem; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.form-grid .full { grid-column: 1 / -1; }

.checkout-summary {
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.agree {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 13px;
  color: var(--gray-500);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.agree input { width: auto; margin-top: 2px; accent-color: var(--coral); }
.agree a { color: var(--coral); text-decoration: underline; }

.checkout-actions { display: flex; flex-direction: column; gap: 0.75rem; }

/* ─── ADDED-TO-CART CONFIRMATION ─────────────────────────────────────────────── */

/* Above the checkout overlay (200) and the image viewer (300), so it is still
   visible if an item is added while one of those is open. */
.cart-toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 400;
  display: grid;
  gap: 2px;
  max-width: min(320px, calc(100vw - 2.5rem));
  padding: 12px 16px;
  border: 1px solid var(--coral);
  border-radius: 10px;
  background: var(--card);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cart-toast.show { opacity: 1; transform: none; }
.cart-toast strong { font-size: 0.95rem; font-weight: 800; color: var(--coral); }
.cart-toast span { color: var(--gray-500); font-size: 12px; line-height: 1.4; }

@media (prefers-reduced-motion: reduce) {
  .cart-toast { transition: none; }
}

/* ─── ENLARGED MOCKUP VIEWER ─────────────────────────────────────────────────── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(4, 4, 4, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.lightbox.open { display: flex; }

.lightbox-panel {
  width: 100%;
  max-width: 860px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lightbox-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.lightbox-head h2 { font-size: 1.35rem; }
.lightbox-head p { margin-top: 2px; color: var(--gray-500); font-size: 13px; }

/* Separates the variant name from the camera angle without markup in the JS. */
#lightbox-angle:not(:empty)::before { content: " · "; }

.lightbox-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 72vh;
  width: auto;
  object-fit: contain;
  border-radius: 10px;
  background: #ffffff;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.82);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  display: grid;
  place-items: center;
}

.lightbox-nav:hover { border-color: var(--coral); color: var(--coral); }
#lightbox-prev { left: 8px; }
#lightbox-next { right: 8px; }

.lightbox-counter { text-align: center; color: var(--gray-500); font-size: 12px; letter-spacing: 0.1em; }

/* ─── EMPTY / LOADING STATES ─────────────────────────────────────────────────── */

.state {
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: var(--card);
  padding: 3rem 2rem;
  text-align: center;
  color: var(--gray-500);
  font-size: 14px;
}

.state .coming {
  font-size: 1.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

/* ─── WATCH-FREE CTA ─────────────────────────────────────────────────────────── */

.watch-cta {
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(40rem 20rem at 100% 0%, rgba(40, 172, 224, 0.12), transparent 70%),
    var(--card);
  padding: 3rem 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.watch-cta h2 { font-size: clamp(1.6rem, 4vw, 2.25rem); text-transform: uppercase; }
.watch-cta p { color: var(--gray-500); max-width: 56ch; }

.btn-primary {
  display: inline-block;
  margin-top: 0.75rem;
  background: var(--coral);
  color: var(--on-coral);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.04em;
  padding: 13px 28px;
  border-radius: 999px;
  transition: background 0.2s;
}

.btn-primary:hover { background: var(--coral-lift); }

/* ─── POLICY PAGES ───────────────────────────────────────────────────────────── */

.policy { max-width: 720px; }

.policy h2 { font-size: 1.25rem; margin: 2rem 0 0.75rem; }
.policy p, .policy li { color: var(--gray-500); font-size: 15px; line-height: 1.75; }
.policy p { margin-bottom: 1rem; }
.policy strong { color: var(--ink); }
.policy a { color: var(--coral); text-decoration: underline; }
.policy ul { margin: 0 0 1rem 1.25rem; }
.policy li { margin-bottom: 0.5rem; }

.policy-meta { color: var(--gray-500); font-size: 13px; font-style: italic; margin-bottom: 2rem; }

.policy-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding-top: 1.5rem;
}

.policy-nav a {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.policy-nav a:hover { color: var(--coral); }

/* ─── FOOTER ─────────────────────────────────────────────────────────────────── */

.site-footer { border-top: 1px solid var(--line); padding: 3rem 0; }

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  text-align: center;
}

.footer-logo img { display: block; height: 26px; width: auto; opacity: 0.85; }

.store-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}

.store-legal a {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-500);
}

.store-legal a:hover { color: var(--coral); }

.footer-copy { color: var(--gray-500); font-size: 12px; line-height: 1.6; }

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .store-layout { grid-template-columns: 1fr; }
  .cart { position: static; }
}

@media (max-width: 760px) {
  .nav-inner { height: 60px; gap: 1rem; }
  .preview-banner { top: 60px; }
  .nav-links { gap: 1rem; }
  .nav-links li:not(:last-child) { display: none; } /* keep only the Watch CTA */
  .nav-logo img { height: 26px; }
}

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .lightbox-stage img { max-height: 60vh; }
  .lightbox-nav { width: 38px; height: 38px; }
  .cart-toast { left: 1rem; right: 1rem; bottom: 1rem; max-width: none; }
}
