/* ─────────────────────────────────────────────────────────────────
   store-theme.css — Unified cinematic dark theme for store pages
   Matches index.html design: red / cyan / purple on #05050b
   Admin pages keep using style.css — no changes there.
───────────────────────────────────────────────────────────────── */

/* ── CSS Variables ── */
:root {
  /* Core brand palette */
  --bg: #05050b;
  --text: #f7f7ff;
  --muted: rgba(255,255,255,.48);
  --red: #ff2b4f;
  --orange: #ff8a00;
  --cyan: #42e8ff;
  --green: #37ff9b;
  --purple: #9b5cff;

  /* Surfaces */
  --glass: rgba(255,255,255,.07);
  --glass2: rgba(255,255,255,.12);
  --border: rgba(255,255,255,.11);

  /* Component tokens */
  --card: rgba(255,255,255,.06);
  --card-solid: #0e1018;
  --input-bg: rgba(255,255,255,.05);
  --header-bg: rgba(5,5,11,.88);
  --page-bg: #05050b;

  /* Gradient accents — brand red/orange/purple */
  --grad-1: #ff2b4f;
  --grad-2: #ff8a00;
  --grad-3: #9b5cff;

  /* Semantic helpers */
  --red-bg: rgba(255,43,79,.1);
  --green-bg: rgba(55,255,155,.1);
  --blue: #42e8ff;
  --blue-bg: rgba(66,232,255,.1);
  --yellow: #f59e0b;
  --yellow-bg: rgba(245,158,11,.12);
  --shadow: 0 2px 16px rgba(0,0,0,.4);
  --shadow-lg: 0 20px 60px rgba(0,0,0,.45);
  --radius: 14px;
  --radius-sm: 8px;

  /* my-* aliases (used by JS-rendered content in my.html) */
  --my-card: var(--card);
  --my-border: var(--border);
  --my-text: var(--text);
  --my-muted: var(--muted);
  --my-page-bg: var(--page-bg);
  --my-shadow: var(--shadow);

  /* st-* aliases for plans.html inline CSS */
  --st-bg: #05050b;
  --st-card: rgba(255,255,255,.07);
  --st-card-solid: #0e1018;
  --st-border: rgba(255,255,255,.11);
  --st-accent: #ff2b4f;
  --st-accent-end: #ff8a00;
  --st-text: #f7f7ff;
  --st-muted: rgba(255,255,255,.48);
  --st-btn: linear-gradient(135deg,#ff2b4f,#ff8a00);
  --st-nav: rgba(5,5,11,.88);
}

/* ── Reset ── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; overflow-x: hidden; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }

/* ── Cinematic body gradient ── */
body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255,43,79,.22), transparent 28%),
    radial-gradient(circle at 70% 20%, rgba(66,232,255,.16), transparent 30%),
    radial-gradient(circle at bottom right, rgba(155,92,255,.24), transparent 32%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
/* Suppress any aurora ::before from legacy style.css */
body::before { display: none !important; }

/* ── Noise film grain (add <div class="st-noise"></div> to body) ── */
.st-noise {
  position: fixed; inset: 0; pointer-events: none; opacity: .13; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.45'/%3E%3C/svg%3E");
}

/* ── Spinner ── */
.spinner {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  animation: spin .7s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Glass card ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.card-sm { padding: .875rem; border-radius: var(--radius-sm); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1.2rem; border-radius: var(--radius-sm); border: none;
  font-size: .9rem; font-weight: 600; transition: all .15s; white-space: nowrap;
  cursor: pointer; font-family: inherit; text-decoration: none; color: var(--text);
}
.btn-primary {
  background: linear-gradient(135deg, var(--red), var(--orange));
  color: #fff; box-shadow: 0 8px 24px rgba(255,43,79,.3);
}
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-secondary {
  background: var(--card); color: var(--text); border: 1.5px solid var(--border);
  backdrop-filter: blur(14px);
}
.btn-secondary:hover { background: var(--glass2); border-color: rgba(255,255,255,.22); }
.btn-green { background: linear-gradient(135deg,#25D366,#128C7E); color: #fff; }
.btn-green:hover { filter: brightness(1.1); }
.btn-red { background: linear-gradient(135deg, var(--red), #c01537); color: #fff; }
.btn-red:hover { filter: brightness(1.1); }
.btn-sm { padding: .35rem .8rem; font-size: .8rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none !important; }

/* ── Form ── */
.form-group { display: flex; flex-direction: column; gap: .3rem; }
.form-label { font-size: .875rem; font-weight: 500; color: var(--text); }
.form-input {
  padding: .6rem .9rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); background: var(--input-bg);
  color: var(--text); font-size: .9rem; transition: border-color .15s; width: 100%; outline: none;
}
.form-input:focus { border-color: var(--red); }
.form-input::placeholder { color: var(--muted); }

/* ── Badge / status ── */
.badge-active, .badge-pending, .badge-expired, .badge-completed, .badge-failed {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem; border-radius: 50px;
  font-size: .72rem; font-weight: 700; border: 1px solid transparent;
}
.badge-active   { color: #10b981; background: rgba(16,185,129,.12); border-color: rgba(16,185,129,.25); }
.badge-pending  { color: var(--yellow); background: var(--yellow-bg); border-color: rgba(245,158,11,.25); }
.badge-expired,
.badge-failed   { color: var(--red); background: var(--red-bg); border-color: rgba(255,43,79,.25); }
.badge-completed{ color: var(--green); background: var(--green-bg); border-color: rgba(55,255,155,.25); }

/* ── Utilities ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); font-size: .875rem; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.gap-4 { gap: 1rem; }
.mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; } .mt-4 { margin-top: 1rem; }
.mb-2 { margin-bottom: .5rem; } .mb-4 { margin-bottom: 1rem; }
.hidden { display: none !important; }

/* ─── Modal (used by /my checkout + auth flows) ────────────────────────────
   These rules used to live only in /public/style.css, which the storefront
   pages don't load — so the checkout modal opened as an unstyled inline div
   and the Buy button appeared to do nothing. */
/* Body scroll-lock + hide the bottom-nav while a modal is open. Bottom-sheet
   modal sits where the .my-bnav usually does (y=754–812 on 375x812), so taps
   on the Cancel button could be ambiguous with the Home / Plans / Orders pills
   underneath even with proper z-index. Easiest fix: just hide the bnav. */
body.modal-open {
  overflow: hidden;
  /* Prevent iOS Safari rubber-band bounce of the page behind the modal */
  touch-action: none;
}
body.modal-open .my-bnav,
body.modal-open .home-bnav,
body.modal-open #bottom-nav { display: none !important; }

.modal-overlay {
  /* Bumped to 10000 so it sits well above every other layer (sticky nav 200,
     drawer overlay 300, drawer 301, anything an admin might set on a future
     widget). Bottom-nav z-index doesn't matter once it's display:none, but
     keeping the headroom is defensive. */
  position: fixed; inset: 0; background: rgba(0,0,0,.72); z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  /* Side padding keeps the modal off the screen edge on desktop and
     prevents pinch-zoom from clipping the rounded corners. Top/bottom
     padding uses safe-area insets so the modal never tucks under a
     notch or the iOS home indicator. */
  padding: max(1rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px))
           max(1rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  /* Hint to the browser that scrolling inside the overlay should not
     trigger pull-to-refresh on the page underneath. */
  overscroll-behavior: contain;
}
.modal {
  background: var(--card-solid, var(--card, #0e1018));
  border-radius: var(--radius, 14px);
  box-shadow: var(--shadow-lg, 0 20px 60px rgba(0,0,0,.45));
  border: 1px solid var(--border, rgba(255,255,255,.11));
  width: 100%;
  /* Width: never larger than 520px (design), never wider than the
     screen minus the overlay padding (guarantees the rounded corners
     are always visible even on a 320px iPhone SE). */
  max-width: min(520px, calc(100vw - 2rem));
  /* Height: prefer dvh (the live visible viewport — collapses when
     mobile browser address bar appears, expands when it hides) and
     fall back to vh for browsers that don't support it. 90% of dvh
     leaves space for the overlay padding above. */
  max-height: 90vh; max-height: 90dvh;
  box-sizing: border-box;
  /* Flex column with the body scrolling so the header and footer stay
     visible — Cancel button can't fall off the bottom of long content. */
  display: flex; flex-direction: column;
  /* Break long unbreakable strings (USDT addresses, raw credentials,
     plan names with no spaces) instead of horizontally overflowing. */
  overflow-wrap: anywhere; word-break: break-word;
  animation: modalIn .2s ease;
  color: var(--text, #f7f7ff);
}
@keyframes modalIn { from { opacity:0; transform: translateY(20px) scale(.97); } to { opacity:1; transform: none; } }
.modal *, .modal *::before, .modal *::after { box-sizing: border-box; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 1.4rem; border-bottom: 1px solid var(--border, rgba(255,255,255,.11));
  flex-shrink: 0; min-width: 0;
}
.modal-header h3 {
  font-size: 1.05rem; font-weight: 700; margin: 0;
  /* Headers truncate cleanly instead of pushing the ✕ icon off the
     right edge if a plan name is unusually long. */
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.modal-body {
  padding: 1.4rem; display: flex; flex-direction: column; gap: .9rem;
  overflow-y: auto;
  /* iOS Safari momentum scroll inside the modal */
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
  /* Lets vertical scroll work but disables horizontal pan-swiping
     that could otherwise drag the page beneath the modal. */
  touch-action: pan-y;
  overscroll-behavior: contain;
}
.modal-footer {
  padding: 1rem 1.4rem;
  border-top: 1px solid var(--border, rgba(255,255,255,.11));
  display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap;
  flex-shrink: 0;
}
.btn-icon { background: none; border: none; color: var(--muted, rgba(255,255,255,.48)); font-size: 1.2rem; padding: .2rem; cursor: pointer; flex-shrink: 0; }
.btn-icon:hover { color: var(--text, #f7f7ff); }
/* Bottom-sheet behaviour on phones: modal hugs the bottom of the
   viewport, rounded only at the top, full width minus a tiny gutter. */
@media (max-width: 560px) {
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100vw;
    max-height: 92vh; max-height: 92dvh;
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
  }
  .modal-body { padding: 1.1rem; }
  .modal-footer { padding: .85rem 1.1rem calc(.85rem + env(safe-area-inset-bottom, 0px)); }
}
/* Tiny phones (older Android, iPhone SE in landscape, etc.) */
@media (max-width: 360px) {
  .modal-body { padding: .9rem; }
  .modal-header { padding: 1rem; }
}

/* ─────────────────────────────────────────────────────────────────
   UNIFIED HEADER — normalizes index.html (<header>), plans.html (.snav)
   and my.html (.my-nav) into ONE consistent brand bar.
   Overrides each page's inline CSS without touching their HTML.
───────────────────────────────────────────────────────────────── */

/* Outer header bar — sticky, blurred, identical across pages */
body > header,
body > nav.snav,
body > .my-wrap > header.my-nav,
body > .my-wrap header.my-nav {
  position: sticky !important;
  top: 0 !important;
  z-index: 200 !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: .85rem clamp(1rem, 4vw, 2rem) !important;
  background: var(--header-bg) !important;
  backdrop-filter: blur(20px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(140%) !important;
  border-bottom: 1px solid var(--border) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: .75rem !important;
}

/* Inner row wrapper for plans.html (.snav-inner) and my.html (.my-nav-inner).
   index.html has no wrapper — body > header IS the row, already handled above. */
nav.snav > .snav-inner,
header.my-nav > .my-nav-inner {
  width: 100% !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: .75rem !important;
  background: transparent !important;
  border: 0 !important;
}

/* Brand / logo — same look everywhere */
header .brand,
nav.snav .snav-logo,
header.my-nav .my-logo {
  display: flex !important;
  align-items: center !important;
  gap: .55rem !important;
  font-weight: 800 !important;
  font-size: 1.15rem !important;
  letter-spacing: .2px !important;
  color: var(--text) !important;
  text-decoration: none !important;
  flex-shrink: 0 !important;
}
header .brand-badge {
  width: 32px !important; height: 32px !important;
  border-radius: 10px !important;
  font-size: 1rem !important;
  transform: none !important;
  box-shadow: 0 6px 18px rgba(255,43,79,.35), inset 0 1px 4px rgba(255,255,255,.3) !important;
}
header .brand-name { font-size: 1.15rem !important; }

/* Nav link row — same look everywhere */
header > nav,
nav.snav .snav-links,
header.my-nav .my-nav-links {
  display: flex !important;
  gap: .15rem !important;
  align-items: center !important;
  margin: 0 auto 0 .75rem !important;
}
header > nav > a,
nav.snav .snav-links > a,
header.my-nav .my-nav-links > a {
  color: var(--muted) !important;
  font-size: .88rem !important;
  font-weight: 600 !important;
  padding: .4rem .75rem !important;
  border-radius: 8px !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  text-decoration: none !important;
  transition: color .15s, background .15s !important;
  white-space: nowrap !important;
}
header > nav > a:hover,
nav.snav .snav-links > a:hover,
header.my-nav .my-nav-links > a:hover {
  color: var(--text) !important;
  background: rgba(255,43,79,.08) !important;
  border-color: transparent !important;
  transform: none !important;
}
nav.snav .snav-links > a.active {
  color: var(--text) !important;
  background: rgba(255,43,79,.12) !important;
}

/* Right-side actions cluster (account / login / wallet / avatar) */
header > nav > a.nav-account,
nav.snav .snav-right,
nav.snav .snav-login,
header.my-nav .my-nav-right {
  display: flex !important;
  align-items: center !important;
  gap: .5rem !important;
  margin-left: auto !important;
}
/* Primary CTA button in header (Account / Login-Sign Up) — same pill */
header > nav > a.nav-account,
nav.snav .snav-login {
  background: linear-gradient(135deg, var(--red), var(--orange)) !important;
  color: #fff !important;
  font-weight: 700 !important;
  padding: .45rem .9rem !important;
  border-radius: 999px !important;
  border: 0 !important;
  box-shadow: 0 6px 18px rgba(255,43,79,.28) !important;
  white-space: nowrap !important;
}
header > nav > a.nav-account:hover,
nav.snav .snav-login:hover { filter: brightness(1.08) !important; }

/* Burger button — same across pages, only visible on mobile */
header .nav-burger,
nav.snav .snav-burger,
header.my-nav #hamburger-btn {
  display: none !important;
  background: var(--glass) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: 8px !important;
  padding: .4rem .6rem !important;
  font-size: 1.1rem !important;
  cursor: pointer !important;
}

/* index.html's <header> has no inner wrapper (unlike plans.html/.snav and
   my.html/.my-nav), so the full-width bar had no max-width on its content and the
   nav's margin-right:auto bunched everything to the left. Keep the full-width bar
   but constrain its CONTENT to the same centered 1200px column as the page body,
   then reset the nav margin so space-between puts the brand left / nav right. */
body > header {
  padding-left: max(1rem, calc((100% - 1200px) / 2)) !important;
  padding-right: max(1rem, calc((100% - 1200px) / 2)) !important;
}
body > header > nav { margin: 0 !important; }

/* /my tab-nav: visually attach to the brand header so it reads as ONE bar,
   not "two stacked headers". Subtle, lower-contrast sub-row. */
header.my-nav + nav.my-tab-nav,
nav.my-tab-nav {
  position: sticky !important;
  top: 56px !important;
  z-index: 199 !important;
  background: rgba(5,5,11,.72) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 0 clamp(1rem, 4vw, 2rem) !important;
  gap: 0 !important;
}
nav.my-tab-nav .my-tab-btn {
  padding: .55rem .95rem !important;
  font-size: .82rem !important;
}

/* Mobile breakpoint — keep behavior consistent */
@media (max-width: 760px) {
  /* Switch outer header from sticky to fixed across all pages on mobile,
     and ENFORCE a single header height via a CSS variable so per-page
     overrides (e.g. movieverse-home's `.nav{height:60px}` + container
     padding) can't drift the actual header taller than body padding-top,
     which used to slide content under the semi-transparent header.

     Variable: --mobile-header-h. body padding-top + header height +
     logo cap all derive from it, so changing it scales the whole bar. */
  :root {
    --mobile-header-h: 52px;
  }
  body {
    padding-top: var(--mobile-header-h);
  }
  body > header,
  body > nav.snav,
  body > .my-wrap > header.my-nav,
  body > .my-wrap header.my-nav {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    height: var(--mobile-header-h) !important;
    min-height: var(--mobile-header-h) !important;
    max-height: var(--mobile-header-h) !important;
    padding: 0 1rem !important;
    background: rgba(5, 5, 11, .92) !important;
    display: flex !important;
    align-items: center !important;
    box-sizing: border-box !important;
  }
  /* Nail down the inner row so flex parents (.snav-inner, .nav,
     .my-nav-inner, .sp-nav-inner) don't expand the fixed bar. */
  body > nav.snav > .snav-inner,
  body > header > .nav,
  body > header > .sp-nav-inner,
  body > .my-wrap > header.my-nav > .my-nav-inner {
    height: 100% !important;
    padding: 0 !important;
  }
  /* Logo image cap so a tall .png brand doesn't blow the bar out. */
  body > header img,
  body > nav.snav img,
  body > .my-wrap > header.my-nav img {
    max-height: calc(var(--mobile-header-h) - 16px) !important;
  }
  header > nav,
  nav.snav .snav-links,
  header.my-nav .my-nav-links { display: none !important; }
  header .nav-burger,
  nav.snav .snav-burger { display: inline-flex !important; }
  /* hide the desktop Account/Login pill on mobile — burger handles it */
  header > nav > a.nav-account,
  nav.snav .snav-login { display: none !important; }
  /* hide the sub-row tab-nav on mobile — bottom-nav handles it */
  nav.my-tab-nav { display: none !important; }
}

