/* ============================================================
   STUDIOWORKS - Tebex Webstore Template
   Dark violet street aesthetic · Anton / Barlow / JetBrains Mono
   Replaces shared.css/generic.css of the Exo base template.
   Keeps every functional hook of Tebex' main.js intact.
   ============================================================ */

/* ------------------------------------------------------------
   1 · TOKENS
   ------------------------------------------------------------ */
:root {
  /* Brand palette (accent + gold are overridable via head.twig config) */
  --sw-accent: #8B27E8;
  --sw-accent-hover: #9B3DFF;
  --sw-accent-press: #7118C6;
  --sw-gold: #FFC81E;
  --sw-gold-light: #FFDD66;
  --sw-gold-dark: #F0AF00;

  --sw-purple-200: #C79BFF;
  --sw-purple-300: #AE6BFF;

  /* Ink - near-black with a violet cast, never pure grey */
  --sw-ink-950: #050208;
  --sw-ink-900: #0A0512;
  --sw-ink-850: #0F0819;
  --sw-ink-800: #150C24;
  --sw-ink-700: #1E1230;
  --sw-ink-600: #2A1B40;
  --sw-ink-500: #3A2755;
  --sw-ink-400: #584176;
  --sw-ink-300: #8574A3;
  --sw-ink-200: #B6A9CC;
  --sw-ink-100: #DCD4E8;

  --sw-success: #2BE88C;
  --sw-warning: #FFC81E;
  --sw-danger: #FF3B5C;
  --sw-info: #3DA5FF;

  /* Surfaces */
  --surface-page: #080511;   /* a notch above pure black - the page must not read as a hole */
  --surface-raised: var(--sw-ink-900);
  --surface-card: var(--sw-ink-850);
  --surface-card-hover: var(--sw-ink-800);
  --surface-inset: var(--sw-ink-800);
  --surface-overlay: rgba(10, 5, 18, .86);
  --surface-glass: rgba(30, 18, 48, .55);
  --surface-accent-soft: rgba(139, 39, 232, .14);
  --surface-gold-soft: rgba(255, 200, 30, .12);

  /* Text */
  --text-display: #EDE7F6;
  --text-body: #C8BEDA;
  --text-muted: var(--sw-ink-300);
  --text-faint: var(--sw-ink-400);
  --text-accent: var(--sw-purple-300);
  --text-gold: var(--sw-gold);
  --text-on-light: #241A38;   /* text on gold/white surfaces - softer than pure black */

  /* Lines */
  --border-subtle: rgba(180, 150, 255, .09);
  --border-default: rgba(180, 150, 255, .16);
  --border-strong: rgba(180, 150, 255, .30);
  --focus-ring: 0 0 0 3px rgba(155, 61, 255, .45);

  /* Gradients */
  --grad-brand: linear-gradient(135deg, var(--sw-accent-hover) 0%, var(--sw-accent-press) 100%);
  --grad-gold: linear-gradient(135deg, var(--sw-gold-light), var(--sw-gold-dark));
  --grad-protect: linear-gradient(180deg, rgba(5, 2, 8, 0) 0%, rgba(5, 2, 8, .72) 62%, var(--sw-ink-950) 100%);
  --grad-street: radial-gradient(120% 90% at 50% 0%, rgba(139, 39, 232, .28) 0%, rgba(5, 2, 8, 0) 60%);

  /* Type */
  --font-display: "Anton", "Barlow Condensed", Impact, sans-serif;
  --font-ui: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --font-condensed: "Barlow Condensed", "Barlow", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --display-skew: -6deg;

  /* Radii - tight, street */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Shadows & glow */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .6);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, .55);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, .6);
  --shadow-card-hover: 0 22px 50px rgba(0, 0, 0, .65), 0 0 0 1px rgba(180, 150, 255, .22);
  --glow-accent: 0 0 0 1px rgba(155, 61, 255, .5), 0 8px 32px rgba(139, 39, 232, .42);
  --glow-gold: 0 0 0 1px rgba(255, 200, 30, .5), 0 8px 28px rgba(255, 200, 30, .28);
  --inner-hairline: inset 0 1px 0 rgba(255, 255, 255, .07);

  /* Motion - fast + mechanical */
  --ease-out: cubic-bezier(.22, .9, .28, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 380ms;

  /* Layout - wide content plane, overridable via config */
  --container-max: 1320px;
  --content-padding: 32px;
  --widget-padding: 24px;
  --header-h: 64px;
  --sw-logo-h: 40px;

  /* Exo/main.js bridge (Tebex checkout modal reads primary + secondary) */
  --color-primary: var(--sw-accent);
  --color-primary-hover: var(--sw-accent-hover);
  --color-secondary: var(--sw-ink-600);
  --color-bg: var(--surface-page);
  --color-brighter-bg: var(--surface-card);
  --color-text: var(--text-body);
  --color-text-secondary: var(--text-muted);
  --color-tertiary-text: var(--text-muted);
  --color-tertiary-text-hover: var(--text-display);
}

/* ------------------------------------------------------------
   2 · BASE
   ------------------------------------------------------------ */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scrollbar-width: thin;
  scrollbar-color: var(--sw-ink-500) var(--surface-page);
}

html.no-scroll { overflow: hidden; }

body {
  position: relative;
  background:
    linear-gradient(180deg, rgba(139, 39, 232, .10) 0%, rgba(8, 5, 17, 0) 520px),
    radial-gradient(1300px 780px at 78% 0%, rgba(139, 39, 232, .26) 0%, rgba(8, 5, 17, 0) 62%),
    radial-gradient(1100px 900px at 2% 24%, rgba(139, 39, 232, .16) 0%, rgba(8, 5, 17, 0) 60%),
    radial-gradient(1200px 950px at 98% 50%, rgba(255, 200, 30, .07) 0%, rgba(8, 5, 17, 0) 58%),
    radial-gradient(1100px 900px at 8% 76%, rgba(139, 39, 232, .18) 0%, rgba(8, 5, 17, 0) 60%),
    radial-gradient(1200px 850px at 88% 100%, rgba(139, 39, 232, .14) 0%, rgba(8, 5, 17, 0) 60%),
    var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* faint brand tag + grid texture across the whole page (0resmon-style backdrop) */
body::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    url("sw-logo.png"),
    url("sw-logo.png"),
    linear-gradient(rgba(180, 150, 255, .55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(180, 150, 255, .55) 1px, transparent 1px);
  background-repeat: no-repeat, no-repeat, repeat, repeat;
  background-position: right -60px top -50px, left -90px bottom 8%, 0 0, 0 0;
  background-size: 520px auto, 460px auto, 46px 46px, 46px 46px;
  opacity: .09;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .85) 560px, rgba(0, 0, 0, .5) 1300px, rgba(0, 0, 0, .5) 100%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .85) 560px, rgba(0, 0, 0, .5) 1300px, rgba(0, 0, 0, .5) 100%);
}

/* film grain over the whole page - kills the flat "hole" feel.
   Lives on ::after so the head.twig body::before override never touches it. */
body::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 140px 140px;
  opacity: .05;
  mix-blend-mode: screen;
}
.site { position: relative; z-index: 1; }

::selection { background: var(--sw-accent); color: #fff; }

img { max-width: 100%; display: block; }

a {
  color: var(--text-accent);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--sw-purple-200); }

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

input, select, textarea { font: inherit; color: inherit; }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-xs);
}

.js-only { display: none; }
body.sw-js .js-only { display: flex; }

/* ------------------------------------------------------------
   3 · TYPE UTILITIES
   ------------------------------------------------------------ */
.sw-display {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: .96;
  letter-spacing: .005em;
  color: var(--text-display);
}

.sw-eyebrow {
  font-family: var(--font-condensed);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: 11px;
  color: var(--text-accent);
}

.sw-label {
  font-family: var(--font-ui);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 11px;
}

/* ------------------------------------------------------------
   4 · BUTTONS
   ------------------------------------------------------------ */
.btn-primary,
.btn-secondary,
.btn-tertiary,
.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  transition:
    filter var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    transform var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

.btn-primary svg, .btn-secondary svg, .btn-tertiary svg, .btn-gold svg {
  width: 16px; height: 16px; flex: none;
}

.btn-primary {
  background: var(--grad-brand);
  color: #F5F1FB;
  box-shadow: var(--shadow-sm), var(--inner-hairline);
}
.btn-primary:hover { filter: brightness(1.12); color: #F5F1FB; box-shadow: var(--glow-accent); }

.btn-gold {
  background: var(--grad-gold);
  color: var(--text-on-light);
  box-shadow: var(--shadow-sm), var(--inner-hairline);
}
.btn-gold:hover { filter: brightness(1.08); color: var(--text-on-light); box-shadow: var(--glow-gold); }

.btn-secondary {
  background: transparent;
  border-color: var(--border-default);
  color: var(--text-body);
}
.btn-secondary:hover {
  background: var(--surface-accent-soft);
  border-color: var(--sw-accent);
  color: var(--text-display);
}

.btn-tertiary {
  background: transparent;
  color: var(--text-muted);
}
.btn-tertiary:hover { color: var(--text-display); background: rgba(255, 255, 255, .06); }

.btn-primary:active, .btn-secondary:active, .btn-tertiary:active, .btn-gold:active {
  transform: scale(.97);
}

.btn-lg { padding: 14px 26px; font-size: 13px; border-radius: var(--radius-sm); }

[disabled], .btn-primary[disabled], .btn-secondary[disabled], a[disabled] {
  opacity: .42;
  pointer-events: none;
}

.wide { width: 100%; }
.half { width: calc(50% - 4px); }

.link-text {
  font-size: 13px;
  color: var(--text-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Small square glyph buttons (quantity +/- etc.) */
.btn-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-inset);
  border: 1px solid var(--border-subtle);
  transition: all var(--dur-fast) var(--ease-out);
}
.btn-glyph:hover { color: var(--text-display); border-color: var(--border-strong); }

/* ------------------------------------------------------------
   5 · LAYOUT
   ------------------------------------------------------------ */
.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-content {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 40px var(--content-padding) 0;
  flex: 1;
}

/* the sidebar concept is retired - content gets the full plane.
   (kept default pages still include sidebar.twig; it renders empty,
   and this keeps their layout single-column as a safety net) */
.site-content-widgets { display: block; }
.store-sidebar { display: none; }

.sw-section { margin-top: 64px; }
.sw-section:first-child { margin-top: 0; }

.sw-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.sw-section-title {
  font-size: 34px;
  transform: skewX(var(--display-skew));
  transform-origin: left bottom;
}
.sw-section-title .accent { color: var(--sw-accent-hover); }
.sw-section-head .sw-eyebrow { display: block; margin-bottom: 8px; }

/* ------------------------------------------------------------
   6 · HEADER
   ------------------------------------------------------------ */
.site-sale-banner {
  background: var(--grad-gold);
  color: var(--text-on-light);
  text-align: center;
  padding: 8px var(--content-padding);
  font-family: var(--font-condensed);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 12px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  border-bottom: 1px solid var(--border-subtle);
}

/* glass layer lives on a pseudo element so the header does NOT become the
   containing block for the fixed mobile navigation drawer (backdrop-filter
   on the header itself would break position:fixed inside it) */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(5, 2, 8, .85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background var(--dur-base) var(--ease-out);
}
body.sw-scrolled .site-header::before { background: rgba(5, 2, 8, .96); }

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1400px;   /* header breathes wider than the content column */
  margin: 0 auto;
  padding: 0 var(--content-padding);
  height: var(--header-h);
}

.site-logo { display: inline-flex; align-items: center; flex: none; }
.site-logo img {
  height: var(--sw-logo-h, 40px);
  /* hard caps: even if the height variable ever resolves invalid,
     an original-size logo can never blow up the header again */
  max-height: 64px;
  max-width: 280px;
  width: auto;
  object-fit: contain;
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex: none;
}

/* header chips (server IP / discord) */
.header-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-body);
  font-size: 12px;
  font-weight: 600;
  transition: border-color var(--dur-base) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.header-chip svg { width: 15px; height: 15px; color: var(--text-accent); flex: none; }
.header-chip:hover { border-color: var(--border-strong); color: var(--text-display); }
.header-chip .chip-label { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.header-chip .chip-action {
  font-family: var(--font-condensed);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-faint);
  border-left: 1px solid var(--border-subtle);
  padding-left: 8px;
  transition: color var(--dur-fast) var(--ease-out);
}
.header-chip .chip-action:hover { color: var(--sw-gold); }

/* language + currency switcher (shows only when the store has >1 option) */
.header-chip-lang { position: relative; cursor: pointer; }
.header-chip-lang .chip-label { font-family: var(--font-condensed); letter-spacing: .1em; }
.header-chip-lang .chip-caret { width: 12px; height: 12px; color: var(--text-faint); transition: rotate var(--dur-fast) var(--ease-out); }
.header-chip-lang:hover .chip-caret,
.header-chip-lang:focus-within .chip-caret { rotate: 180deg; }

/* invisible hover bridge so the pointer can travel across the gap
   between the chip and the open dropdown without closing it */
.header-chip-lang::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 14px;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 700;
  min-width: 180px;
  max-height: min(56vh, 400px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--sw-ink-500) transparent;
  padding: 8px;
  list-style: none;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), var(--inner-hairline);
  /* stays open briefly when the pointer slips off (visibility delay) */
  opacity: 0;
  visibility: hidden;
  translate: 0 -4px;
  pointer-events: none;
  transition:
    opacity var(--dur-fast) var(--ease-out),
    translate var(--dur-fast) var(--ease-out),
    visibility 0s linear .25s;
}
.header-chip-lang:hover .lang-menu,
.header-chip-lang:focus-within .lang-menu {
  opacity: 1;
  visibility: visible;
  translate: 0 0;
  pointer-events: auto;
  transition-delay: 0s;
}

.lang-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.lang-menu a:hover { color: var(--text-display); background: rgba(255, 255, 255, .05); }
.lang-menu a.active {
  color: var(--text-display);
  background: var(--surface-accent-soft);
}
.lang-menu a.active::after {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  flex: none;
  background-color: var(--sw-accent-hover);
  mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 12.5 5 5L20 6.5'/%3E%3C/svg%3E") center center / contain no-repeat;
}

/* user pill (Exo text/text-hover swap) */
.btn-glyph-text { position: relative; }
.btn-glyph-text svg { width: 16px; height: 16px; }
.user-name .text-inner { display: grid; }
.user-name .text, .user-name .text-hover {
  grid-area: 1 / 1;
  transition: opacity var(--dur-fast) var(--ease-out);
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-name .text-hover { opacity: 0; color: var(--sw-danger); }
.user-name:hover .text { opacity: 0; }
.user-name:hover .text-hover { opacity: 1; }

/* basket button + live count */
.open-basket { position: relative; }
.basket-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  margin-left: 2px;
  border-radius: var(--radius-pill);
  background: var(--grad-gold);
  color: var(--text-on-light);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

/* burger - hidden on desktop */
.toggle-navigation {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  color: var(--text-body);
  flex: none;
}
.toggle-navigation svg { width: 22px; height: 22px; }

/* ------------------------------------------------------------
   7 · NAVIGATION
   ------------------------------------------------------------ */
.site-navigation { --fade-duration: 200ms; min-width: 0; }

.site-navigation .menu {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-navigation .menu::-webkit-scrollbar { display: none; }

.site-navigation .menu > li { position: relative; flex: none; }

.site-navigation .menu a {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-faint);
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.site-navigation .menu a:hover { color: var(--text-display); }

.site-navigation .menu a.link-active {
  color: var(--text-display);
  background: var(--surface-accent-soft);
  box-shadow: inset 0 -2px 0 var(--sw-accent);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.site-navigation .toggle {
  min-width: 26px;
  height: 26px;
  background: transparent;
  border: 0;
}
.site-navigation .toggle::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  margin: auto;
  background-color: currentColor;
  mask: url("https://template-assets.tebex.io/images/chevron.svg") center center / contain no-repeat;
  transition: rotate var(--dur-fast) var(--ease-out);
}

.site-navigation .close-navigation { display: none; }

/* desktop dropdown for subcategories */
@media (width > 960px) {
  /* hover bridge across the gap below the menu item */
  .site-navigation .has-children::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 12px;
  }
  .site-navigation .has-children > ul {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 600;
    min-width: 210px;
    padding: 8px;
    list-style: none;
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg), var(--inner-hairline);
    opacity: 0;
    visibility: hidden;
    translate: 0 -4px;
    pointer-events: none;
    transition:
      opacity var(--dur-fast) var(--ease-out),
      translate var(--dur-fast) var(--ease-out),
      visibility 0s linear .25s;
  }
  .site-navigation .has-children:hover > ul,
  .site-navigation .has-children:focus-within > ul,
  .site-navigation .has-children.expanded > ul {
    opacity: 1;
    visibility: visible;
    translate: 0 0;
    pointer-events: auto;
    transition-delay: 0s;
  }
  .site-navigation .has-children > ul a {
    display: flex;
    width: 100%;
    padding: 9px 12px;
    font-size: 12px;
  }
}

/* mobile drawer (mechanics ported from Exo so main.js' Drawer works) */
@media (width <= 960px) {
  .toggle-navigation { display: inline-flex; }

  .site-navigation {
    position: fixed;
    inset: 0;
    z-index: 100000;
    padding: 0;
    background: rgba(5, 2, 8, .7);
    backdrop-filter: blur(6px);
    transition: opacity var(--fade-duration) ease;
  }

  body:not(.show-navigation) .site-navigation {
    visibility: hidden;
    opacity: 0;
  }

  .site-navigation.drawer { user-select: none; }

  .site-navigation .menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    position: absolute;
    inset: 0 64px 0 0;
    padding: 84px var(--widget-padding) var(--widget-padding);
    background: var(--surface-raised);
    border-right: 1px solid var(--border-default);
    overflow: hidden auto;
    font-size: 16px;
    transition: opacity var(--fade-duration) ease, scale var(--fade-duration) ease, translate var(--fade-duration) ease;
  }

  body:not(.show-navigation) .site-navigation .menu {
    translate: -100% 0;
    opacity: .8;
    scale: .95;
  }

  .site-navigation.touching .menu {
    transition: opacity var(--fade-duration) ease, scale var(--fade-duration) ease;
  }
  .site-navigation.may-close .menu { opacity: .8; }

  .site-navigation .menu a {
    width: 100%;
    padding: 12px 14px;
    font-size: 14px;
  }
  .site-navigation .menu a.link-active {
    box-shadow: inset 2px 0 0 var(--sw-accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  }

  .site-navigation .has-children {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
  }
  .site-navigation .has-children > a { flex: 1 1 auto; }
  .site-navigation .has-children > ul {
    display: none;
    width: 100%;
    list-style: none;
    padding-left: 14px;
  }
  .site-navigation .has-children.expanded > ul { display: block; }
  .site-navigation .has-children.expanded > .toggle::before { rotate: 180deg; }

  .site-navigation .close-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 18px;
    right: 84px;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    font-size: 0;
    color: var(--text-body);
  }
  .site-navigation .close-navigation::before {
    content: "";
    display: block;
    width: 20px;
    height: 20px;
    background-color: currentColor;
    mask: url("https://template-assets.tebex.io/images/close.svg") center center / contain no-repeat;
  }

  .site-navigation .log-out { margin-top: auto; }
}

/* ------------------------------------------------------------
   8 · HERO
   ------------------------------------------------------------ */
.sw-hero {
  position: relative;
  min-height: 540px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--border-subtle);
}

.sw-hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 2, 8, .94) 0%, rgba(5, 2, 8, .68) 48%, rgba(5, 2, 8, .3) 100%),
    var(--grad-protect);
}

.sw-hero-glow {
  position: absolute;
  inset: 0;
  background: var(--grad-street);
  pointer-events: none;
}

.sw-hero-inner {
  position: relative;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 72px var(--content-padding);
}

.sw-hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.sw-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .14em;
}
.sw-badge svg { width: 14px; height: 14px; }
.sw-badge-gold {
  background: var(--grad-gold);
  color: var(--text-on-light);
  box-shadow: var(--shadow-sm);
}

.sw-hero-title {
  font-size: clamp(42px, 5.4vw, 76px);
  max-width: 920px;
  transform: skewX(var(--display-skew));
  transform-origin: left bottom;
}
.sw-hero-title .accent { color: var(--sw-accent-hover); }

.sw-hero-sub {
  margin-top: 20px;
  max-width: 540px;
  font-size: 16px;
  color: var(--text-muted);
}

.sw-hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.sw-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 44px;
}
.sw-hero-stats .stat {
  padding: 0 32px;
  border-left: 1px solid var(--border-default);
}
.sw-hero-stats .stat:first-child { padding-left: 0; border-left: 0; }
.sw-hero-stats .stat-value {
  font-size: 30px;
  transform: skewX(var(--display-skew));
  transform-origin: left bottom;
}
.sw-hero-stats .stat-label {
  margin-top: 4px;
  font-family: var(--font-condensed);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ------------------------------------------------------------
   9 · CATEGORY TILES (home)
   ------------------------------------------------------------ */
.sw-category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* A store with two or three categories should not leave half the row empty -
   the tiles grow to fill it instead of sitting there as postage stamps. */
@media (min-width: 1181px) {
  .sw-category-grid:has(> :nth-child(1):last-child) { grid-template-columns: minmax(0, 760px); }
  .sw-category-grid:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, 1fr); }
  .sw-category-grid:has(> :nth-child(3):last-child) { grid-template-columns: repeat(3, 1fr); }
}

.sw-category-tile {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-default);
  background: var(--surface-card);
  box-shadow: var(--shadow-lg), var(--inner-hairline);
  isolation: isolate;
  transition:
    transform var(--dur-slow) var(--ease-out),
    border-color var(--dur-slow) var(--ease-out),
    box-shadow var(--dur-slow) var(--ease-out);
}

.sw-category-tile .tile-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform .7s var(--ease-out);
}
.sw-category-tile .tile-image-default { display: block; background-size: cover; background-position: center; }

/* keep the artwork readable up top, hand the lower third to the label and
   let a violet wash rise from the floor on hover */
.sw-category-tile .tile-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 2, 8, .1) 0%, rgba(5, 2, 8, 0) 34%, rgba(5, 2, 8, .68) 74%, rgba(5, 2, 8, .95) 100%),
    radial-gradient(130% 76% at 50% 125%, rgba(139, 39, 232, .34) 0%, rgba(5, 2, 8, 0) 62%);
  transition: opacity var(--dur-slow) var(--ease-out);
}
.sw-category-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(120% 70% at 50% 130%, rgba(155, 61, 255, .5) 0%, rgba(5, 2, 8, 0) 60%);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-slow) var(--ease-out);
}
.sw-category-tile:hover::before { opacity: 1; }

.sw-category-tile .tile-body {
  position: absolute;
  left: 26px;
  right: 84px;
  bottom: 22px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  transition: transform var(--dur-slow) var(--ease-out);
}

.sw-category-tile .tile-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--sw-gold);
}
.sw-category-tile .tile-count::before {
  content: "";
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-gold);
  flex: none;
}

.sw-category-tile .tile-name {
  display: block;
  max-width: 100%;
  font-size: clamp(24px, 2.5vw, 38px);
  line-height: .98;
  transform: skewX(var(--display-skew));
  transform-origin: left bottom;
  text-shadow: 0 4px 26px rgba(5, 2, 8, .8);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sw-category-tile .tile-arrow {
  position: absolute;
  right: 22px;
  bottom: 22px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: rgba(5, 2, 8, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--border-default);
  color: var(--text-display);
  transition: all var(--dur-base) var(--ease-out);
}
.sw-category-tile .tile-arrow svg { width: 19px; height: 19px; transition: transform var(--dur-base) var(--ease-out); }

.sw-category-tile:hover {
  transform: translateY(-6px);
  border-color: var(--sw-accent);
  box-shadow: var(--shadow-lg), var(--glow-accent);
}
.sw-category-tile:hover .tile-image { transform: scale(1.09); }
.sw-category-tile:hover .tile-body { transform: translateY(-3px); }
.sw-category-tile:hover .tile-arrow {
  background: var(--grad-gold);
  border-color: transparent;
  color: var(--text-on-light);
  box-shadow: var(--glow-gold);
}
.sw-category-tile:hover .tile-arrow svg { transform: translateX(2px); }
.sw-category-tile:focus-visible { border-color: var(--sw-accent); }

/* ------------------------------------------------------------
   10 · PROMO BANNER + TRUST
   ------------------------------------------------------------ */
.sw-promo {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-default);
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-lg);
}

.sw-promo-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(5, 2, 8, .93) 0%, rgba(5, 2, 8, .72) 55%, rgba(5, 2, 8, .35) 100%);
}
.sw-promo-gold .sw-promo-shade {
  background:
    radial-gradient(80% 120% at 85% 20%, rgba(255, 200, 30, .16) 0%, rgba(5, 2, 8, 0) 55%),
    linear-gradient(90deg, rgba(5, 2, 8, .93) 0%, rgba(5, 2, 8, .72) 55%, rgba(5, 2, 8, .35) 100%);
}

.sw-promo-inner {
  position: relative;
  padding: 52px 48px;
  max-width: 640px;
}

.sw-promo-kicker {
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--text-gold);
  margin-bottom: 12px;
}
.sw-promo-violet .sw-promo-kicker { color: var(--text-accent); }

.sw-promo-title {
  font-size: clamp(34px, 4.4vw, 56px);
  transform: skewX(var(--display-skew));
  transform-origin: left bottom;
}
.sw-promo-gold .sw-promo-title .accent { color: var(--sw-gold); }
.sw-promo-violet .sw-promo-title .accent { color: var(--sw-accent-hover); }

.sw-promo-sub {
  margin-top: 14px;
  max-width: 480px;
  color: var(--text-muted);
  font-size: 15px;
}
.sw-promo-inner .btn-lg { margin-top: 24px; }

/* Trust cards */
.sw-trust-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.sw-trust-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md), var(--inner-hairline);
  transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.sw-trust-card:hover { transform: translateY(-4px); border-color: var(--border-strong); }
.sw-trust-card svg { width: 24px; height: 24px; color: var(--text-accent); }
.sw-trust-card h4 { margin-top: 14px; font-size: 19px; }
.sw-trust-card p { margin-top: 8px; font-size: 13px; color: var(--text-faint); }

/* ------------------------------------------------------------
   11 · PRODUCT CARDS + GRIDS
   ------------------------------------------------------------ */
.store-products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.store-products-grid.sw-cols-4 { grid-template-columns: repeat(4, 1fr); }

.store-product {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md), var(--inner-hairline);
  transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}

.store-product:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card-hover);
}

.store-product .image-link {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;   /* cinematic - the artwork leads */
  overflow: hidden;
  background: var(--surface-inset);
}

/* cinematic shade so the image blends into the card body */
.store-product .image-link::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 34%;
  background: linear-gradient(180deg, rgba(15, 8, 25, 0) 0%, rgba(15, 8, 25, .55) 100%);
  pointer-events: none;
  z-index: 1;
}

.store-product .image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}
.store-product:hover .image { transform: scale(1.06); }

.image-default {
  width: 100%;
  height: 100%;
  min-height: 120px;
  background:
    radial-gradient(80% 100% at 50% 0%, rgba(139, 39, 232, .25) 0%, rgba(5, 2, 8, 0) 70%),
    var(--surface-inset);
  position: relative;
}
.image-default::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 46%;
  max-width: 110px;
  aspect-ratio: 1;
  background: url("sw-mark.png") center center / contain no-repeat;
  opacity: .5;
}

.product-badges {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.product-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}
.product-badge-sale { background: var(--sw-danger); color: #F7F3FC; }
.product-badge-sub { background: var(--grad-brand); color: #F7F3FC; }

.product-countdown {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  background: rgba(5, 2, 8, .8);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border-default);
  color: var(--sw-gold);
  font-family: var(--font-mono);
  font-size: 11px;
}
.product-countdown svg { width: 12px; height: 12px; }

.store-product .product-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 15px 16px 16px;
  gap: 10px;
}

.store-product .product-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  min-height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* short description excerpt on cards (first lines only, flattened to text) */
.product-excerpt {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-faint);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.product-excerpt * { display: inline; margin: 0; padding: 0; font-size: inherit; color: inherit; font-weight: inherit; }
.product-excerpt img, .product-excerpt iframe, .product-excerpt br { display: none; }
.store-product .product-title a { color: var(--text-display); }
.store-product .product-title a:hover { color: var(--sw-purple-200); }

/* actions block (contract element for main.js) */
.product-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: auto;
}

.product-actions .price {
  width: 100%;
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 30px;
}

.product-actions .price strong {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 21px;
  letter-spacing: .01em;
  color: var(--text-display);
  transform: skewX(var(--display-skew));
}

/* card CTAs: clean white button (0resmon-style); config can switch back to violet */
.product-actions .btn-primary {
  background: #E6DFF2;
  color: var(--text-on-light);
  box-shadow: var(--shadow-sm);
}
.product-actions .btn-primary:hover {
  background: #E6DFF2;
  color: var(--text-on-light);
  filter: none;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .25);
}
.product-actions .btn-primary:active { transform: scale(.97); }

.product-actions .price del,
.product-actions .price del strong {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-faint);
  transform: none;
  text-decoration: line-through;
}
.product-actions .price del { order: 2; }

.product-actions .gift {
  font-size: 0;
  min-width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
  flex: none;
  order: 3;
}
.product-actions .gift::before {
  content: "";
  display: block;
  width: 17px;
  height: 17px;
  background-color: currentColor;
  mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='8' width='18' height='4' rx='1'/%3E%3Cpath d='M12 8v13'/%3E%3Cpath d='M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7'/%3E%3Cpath d='M7.5 8a2.5 2.5 0 0 1 0-5C11 3 12 8 12 8s1-5 4.5-5a2.5 2.5 0 0 1 0 5'/%3E%3C/svg%3E") center center / contain no-repeat;
}
.product-actions .add,
.product-actions .subscribe { flex: 1; }
.product-actions .add.wide,
.product-actions .subscribe.wide { width: auto; flex: 1 1 auto; }

/* quantity widget (contract markup from main.js) */
.quantity-field {
  display: inline-flex;
  align-items: stretch;
  gap: 4px;
}
.quantity-field input[type="number"] {
  width: 52px;
  text-align: center;
  background: var(--surface-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  color: var(--text-display);
  font-family: var(--font-mono);
  font-size: 13px;
  -moz-appearance: textfield;
  appearance: textfield;
}
.quantity-field input[type="number"]::-webkit-outer-spin-button,
.quantity-field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }

.quantity-field.with-open-basket { flex: 1 1 auto; min-width: 0; }
.quantity-field.with-open-basket .open-basket {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  border-radius: var(--radius-xs);
  background: var(--surface-accent-soft);
  border: 1px solid var(--sw-accent);
  color: var(--text-display);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 8px 8px;
  transition: filter var(--dur-fast) var(--ease-out);
}
.quantity-field.with-open-basket .open-basket:hover { filter: brightness(1.15); }

/* busy state set by main.js */
.updating { position: relative; pointer-events: none; }
.updating > * { opacity: .45; }
.updating::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  z-index: 5;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .18);
  border-top-color: var(--sw-accent-hover);
  animation: sw-spin .7s linear infinite;
}
@keyframes sw-spin { to { rotate: 360deg; } }

/* list display type */
.store-products-list { display: flex; flex-direction: column; gap: 14px; }
.store-products-list .store-product {
  flex-direction: row;
  align-items: stretch;
}
.store-products-list .image-link {
  aspect-ratio: 16 / 10;
  width: 230px;
  flex: none;
}
.store-products-list .product-body { padding: 18px 20px; }
.store-products-list .product-title { min-height: 0; }

/* ------------------------------------------------------------
   12 · CATEGORY PAGE HEAD + TOOLBAR
   ------------------------------------------------------------ */
.store-products { min-width: 0; }

.sw-category-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 26px;
}

.sw-category-title {
  font-size: clamp(30px, 3.6vw, 42px);
  transform: skewX(var(--display-skew));
  transform-origin: left bottom;
  text-shadow: 0 0 34px rgba(255, 255, 255, .14);
}
.sw-category-title .dim { color: var(--text-faint); text-shadow: none; }

.sw-category-count {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
}

.sw-catalog-toolbar { display: flex; align-items: center; gap: 10px; }
body.sw-js .sw-catalog-toolbar.js-only { display: flex; }

.sw-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--surface-inset);
  border: 1px solid var(--border-subtle);
  transition: border-color var(--dur-base) var(--ease-out);
}
.sw-search:focus-within { border-color: var(--sw-accent); box-shadow: var(--focus-ring); }
.sw-search svg { width: 15px; height: 15px; color: var(--text-faint); flex: none; }
.sw-search-input {
  width: 170px;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text-display);
  font-size: 13px;
}
.sw-search-input::placeholder { color: var(--text-faint); }

.sw-sort-select {
  height: 40px;
  padding: 0 34px 0 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-inset) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238574A3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 14px;
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
  font-size: 13px;
  appearance: none;
  cursor: pointer;
  transition: border-color var(--dur-base) var(--ease-out);
}
.sw-sort-select:hover, .sw-sort-select:focus { border-color: var(--border-strong); outline: none; }

.category-description { margin-bottom: 26px; }

.no-products, .sw-no-results {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-faint);
  background: var(--surface-card);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-lg);
}

/* ------------------------------------------------------------
   13 · PRODUCT FULL PAGE
   ------------------------------------------------------------ */
.store-product-full {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-areas:
    "title title"
    "media actions"
    "descr actions";
  gap: 24px 32px;
  align-content: start;
  background: none;
  border: 0;
  box-shadow: none;
  overflow: visible;
  transform: none;
}
.store-product-full:hover { transform: none; box-shadow: none; border: 0; }

.store-product-full > .product-title {
  grid-area: title;
  display: block;
  min-height: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1;
  text-transform: uppercase;
  color: var(--text-display);
  transform: skewX(var(--display-skew));
  transform-origin: left bottom;
}

.store-product-full > .product-title .countdown {
  display: inline-block;
  margin-left: 14px;
  vertical-align: middle;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  background: rgba(255, 200, 30, .12);
  border: 1px solid rgba(255, 200, 30, .4);
  color: var(--sw-gold);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  transform: skewX(6deg);
}

.store-product-full > .image,
.store-product-full > .image-default,
.store-product-full > .media-slider {
  grid-area: media;
  width: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.store-product-full > .image-default { aspect-ratio: 16 / 9; }

.store-product-full > .product-actions {
  grid-area: actions;
  align-self: start;
  margin-top: 0;
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 24px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), var(--inner-hairline);
}

.store-product-full > .product-actions .price {
  flex-direction: row;
  min-height: 0;
  margin-bottom: 4px;
}
.store-product-full > .product-actions .price strong { font-size: 36px; }

.store-product-full > .product-actions .gift {
  font-size: 12px;
  min-width: 0;
  width: 100%;
  height: auto;
  padding: 10px 18px;
  order: 0;
  display: inline-flex;
  gap: 8px;
}

.store-product-full > .descr {
  grid-area: descr;
  min-width: 0;
}

/* popup variant: single column */
.popup .store-product-full {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.popup .store-product-full > .product-actions { position: static; }

/* ------------------------------------------------------------
   14 · MEDIA SLIDER (contract markup from package-media.twig)
   ------------------------------------------------------------ */
.media-slider {
  --slider-spacing: 10px;
  --thumbs-size: 64px;
  --thumb-padding: 5px;
  position: relative;
  width: 100%;
  overflow: hidden;
}

@media (width > 960px) { .media-slider { --thumbs-size: 78px; } }

.media-slider .slider {
  width: 100%;
  min-height: 200px;
  overflow: hidden;
  margin-bottom: var(--slider-spacing);
  background: var(--sw-ink-900);
  border-radius: var(--radius-lg);
}

.media-slider .slider::part(container) {
  --swiper-navigation-size: 22px;
  --swiper-theme-color: #fff;
}
.media-slider .slider::part(button-prev),
.media-slider .slider::part(button-next) {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(5, 2, 8, .6);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border-default);
}
.media-slider .slider::part(wrapper) { align-items: center; }

.media-slider .slide { align-content: center; }
.media-slider .slide-image {
  margin: auto;
  max-width: 100%;
  min-height: 200px;
  max-height: 100%;
  object-fit: contain;
}
.media-slider .slide-frame {
  display: block;
  margin: auto;
  width: 100%;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

.media-slider .thumbs {
  display: flex;
  gap: var(--slider-spacing);
  align-items: stretch;
  flex-wrap: wrap;
  list-style: none;
  padding: 0 2px 2px;
}

.media-slider .thumb {
  display: block;
  width: var(--thumbs-size);
  height: var(--thumbs-size);
  padding: var(--thumb-padding);
  background: var(--surface-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.media-slider .thumb.active { border-color: var(--sw-accent); box-shadow: 0 0 0 1px var(--sw-accent); }

.media-slider .thumb-image,
.media-slider .thumb-youtube {
  width: calc(var(--thumbs-size) - var(--thumb-padding) * 2 - 2px);
  height: calc(var(--thumbs-size) - var(--thumb-padding) * 2 - 2px);
  transition: opacity var(--dur-base) var(--ease-out);
  border-radius: var(--radius-xs);
  overflow: hidden;
}
.media-slider .thumb:not(.active) .thumb-image,
.media-slider .thumb:not(.active) .thumb-youtube { opacity: .5; }
.media-slider .thumb-image { object-fit: cover; }

.media-slider .thumb-youtube { position: relative; align-content: center; }
.media-slider .thumb-youtube img { width: 100%; height: 100%; object-fit: cover; }
.media-slider .thumb-youtube::after {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
  margin: auto;
  width: 24px;
  height: 24px;
  background-color: #fff;
  mask: url("https://template-assets.tebex.io/images/play.svg") center center / contain no-repeat;
}

.media-slider .open-lightbox {
  position: absolute;
  right: var(--slider-spacing);
  bottom: calc(var(--thumbs-size) + var(--slider-spacing) * 2);
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: rgba(5, 2, 8, .6);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border-default);
  visibility: hidden;
  line-height: 0;
  font-size: 0;
  color: transparent;
  opacity: 0;
  transition: all var(--dur-fast) var(--ease-out);
}
.media-slider .open-lightbox::before {
  content: "";
  display: block;
  margin: auto;
  width: 16px;
  height: 16px;
  background-color: var(--text-body);
  mask: url("https://template-assets.tebex.io/images/fullscreen.svg") center center / contain no-repeat;
}
.media-slider .slider:hover ~ .open-lightbox,
.media-slider .open-lightbox:hover,
.media-slider .open-lightbox:focus {
  opacity: 1;
  visibility: visible;
}
.media-slider .open-lightbox:hover { border-color: var(--border-strong); }

/* fullscreen lightbox popup (markup generated by main.js) */
.popup.popup-media-slider {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(5, 2, 8, .94);
  padding: 24px;
}
.popup.popup-media-slider .slider {
  flex: 1;
  width: 100%;
  min-height: 0;
}
.popup.popup-media-slider .slider::part(container) {
  --swiper-navigation-size: 28px;
  --swiper-theme-color: #fff;
  height: 100%;
}
.popup.popup-media-slider .slide { align-content: center; height: 100%; }
.popup.popup-media-slider .slide-image {
  margin: auto;
  max-width: 100%;
  max-height: calc(100vh - 90px);
  object-fit: contain;
}
.popup.popup-media-slider .slide-frame {
  display: block;
  margin: auto;
  width: min(100%, 160vh);
  aspect-ratio: 16 / 9;
  border: 0;
}
.popup.popup-media-slider .popup-close { position: fixed; top: 14px; right: 14px; }

/* ------------------------------------------------------------
   15 · BASKET (drawer content - contract markup)
   ------------------------------------------------------------ */
.site-content .basket { display: none; }   /* page itself redirects into the drawer */

.basket-popup .popup-scroll-cont {
  padding: 0;
  align-items: stretch;
  justify-content: flex-end;
}

.basket-popup-content.basket {
  display: flex;
  flex-direction: column;
  width: min(460px, 94vw);
  max-width: none;
  min-height: 100dvh;
  margin-left: auto;
  padding: 0;
  border-radius: 0;
  border-left: 1px solid var(--border-default);
  background: var(--surface-raised);
}

.basket .basket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px var(--widget-padding) 16px;
}

.basket .basket-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  text-transform: uppercase;
  color: var(--text-display);
}
.basket .basket-title::before {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  background-color: var(--text-accent);
  mask: url("https://template-assets.tebex.io/images/user.svg") center center / contain no-repeat;
}

.basket .basket-second-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px var(--widget-padding);
  background: var(--surface-card);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-condensed);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.basket .basket-second-header .total strong {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-display);
  letter-spacing: 0;
}

.basket .basket-content {
  flex: 1;
  overflow: hidden auto;
  scrollbar-width: thin;
  scrollbar-color: var(--sw-ink-500) transparent;
}

.basket .basket-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: var(--widget-padding);
}

.basket .basket-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--inner-hairline);
}

.basket .basket-item .info { margin-right: auto; min-width: 0; }
.basket .basket-item .title { font-size: 14px; font-weight: 700; }
.basket .basket-item .title a { color: var(--text-display); }
.basket .basket-item .title a:hover { color: var(--sw-purple-200); }

.basket .basket-item .options {
  list-style: none;
  padding: 4px 0 0;
  font-size: 12px;
  color: var(--text-faint);
}
.basket .basket-item .options strong { color: var(--text-muted); font-weight: 600; }

.basket .basket-item .price { margin-top: 6px; }
.basket .basket-item .price strong {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-display);
}

.basket .basket-item .remove {
  order: 5;
  font-size: 0;
  min-width: 34px;
  height: 34px;
  padding: 0;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  color: var(--text-faint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast) var(--ease-out);
}
.basket .basket-item .remove::before {
  content: "";
  display: block;
  width: 15px;
  height: 15px;
  background-color: currentColor;
  mask: url("https://template-assets.tebex.io/images/close.svg") center center / contain no-repeat;
}
.basket .basket-item .remove:hover {
  color: var(--sw-danger);
  border-color: rgba(255, 59, 92, .4);
  background: rgba(255, 59, 92, .08);
}

.basket .basket-empty {
  margin: auto;
  padding: 60px 24px;
  text-align: center;
  font-size: 15px;
  color: var(--text-faint);
}

.basket .basket-checkout {
  padding: var(--widget-padding);
  border-top: 1px solid var(--border-default);
  background: var(--surface-card);
}

.basket .basket-checkout h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  font-family: var(--font-condensed);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.basket .basket-checkout .total { display: inline-block; }
.basket .basket-checkout .total strong {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 30px;
  letter-spacing: .01em;
  color: var(--text-display);
  transform: skewX(var(--display-skew));
  display: inline-block;
}

.basket .basket-checkout .checkout {
  width: 100%;
  padding: 15px 22px;
  border-radius: var(--radius-sm);
  background: var(--grad-gold);
  color: var(--text-on-light);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm), var(--inner-hairline);
  transition: filter var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.basket .basket-checkout .checkout:hover { filter: brightness(1.08); box-shadow: var(--glow-gold); }
.basket .basket-checkout .checkout:active { transform: scale(.97); }

/* ------------------------------------------------------------
   16 · POPUP SYSTEM (mechanics ported from Exo, restyled)
   ------------------------------------------------------------ */
.popup {
  --fade-duration: 300ms;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 100vw;
  z-index: 1000;
  overflow: hidden scroll;
  scrollbar-width: thin;
  scrollbar-color: var(--sw-ink-500) transparent;
  background: rgba(5, 2, 8, .78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background-color var(--fade-duration) ease, opacity var(--fade-duration) ease-in-out, display var(--fade-duration) allow-discrete;
}

@starting-style { .popup { opacity: 0; } }

.popup.drawer { user-select: none; }
.popup.may-close { user-select: none; background: rgba(5, 2, 8, .4); }

.popup[hidden] { opacity: 0; display: none; }

.popup-scroll-cont {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: calc(var(--content-padding) / 2);
  overscroll-behavior: none;
}
@media (width > 600px) { .popup-scroll-cont { padding: var(--content-padding); } }
@media (pointer: coarse) {
  .popup:not(.basket-popup) .popup-scroll-cont { align-items: flex-end; padding-bottom: 0; }
}

.popup-content {
  position: relative;
  width: 100%;
  max-width: 550px;
  padding: var(--widget-padding);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), var(--inner-hairline);
  transition: translate var(--fade-duration) ease, opacity var(--fade-duration) ease;
}
@starting-style { .popup-content { translate: 0 20px; } }
@media (pointer: coarse) {
  .popup:not(.basket-popup) .popup-content {
    padding-bottom: calc(var(--widget-padding) * 2);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }
}

.popup.touching .popup-content {
  transition: opacity var(--fade-duration) ease, scale var(--fade-duration) ease;
}

.popup.may-close .popup-content,
.popup.drawer[hidden] .popup-content { opacity: .8; scale: .95; }

.popup.drawer-up[hidden] .popup-content { translate: 0 -100%; }
.popup.drawer-down[hidden] .popup-content { translate: 0 100%; }
.popup.drawer-right[hidden] .popup-content { translate: 100% 0; }
.popup.drawer-left[hidden] .popup-content { translate: -100% 0; }
.popup:not(.drawer)[hidden] .popup-content { translate: 0 20px; }

.popup.popup-loading .popup-content { min-height: 180px; }
.popup.popup-loading .popup-content::before {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
  margin: auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .14);
  border-top-color: var(--sw-accent-hover);
  animation: sw-spin .7s linear infinite;
}

/* drag handles */
.drawer-up .popup-content::after,
.drawer-down .popup-content::after,
.drawer-left .popup-content::after,
.drawer-right .popup-content::after {
  content: "";
  display: block;
  position: absolute;
  background: rgba(180, 150, 255, .28);
  border-radius: 2px;
  pointer-events: none;
}
.drawer-up .popup-content::after,
.drawer-down .popup-content::after {
  left: 0; right: 0;
  margin-inline: auto;
  height: 4px; width: 90px;
}
.drawer-up .popup-content::after { bottom: 7px; }
.drawer-down .popup-content::after { top: 7px; }
.drawer-left .popup-content::after,
.drawer-right .popup-content::after {
  top: 0; bottom: 0;
  margin-block: auto;
  width: 4px; height: 90px;
}
.drawer-left .popup-content::after { right: 7px; }
.drawer-right .popup-content::after { left: 7px; }

.popup-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 20;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  opacity: .6;
  line-height: 0;
  font-size: 0;
  color: transparent;
  transition: all var(--dur-fast) var(--ease-out);
}
.popup-close::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background-color: var(--text-body);
  mask: url("https://template-assets.tebex.io/images/close.svg") center center / 18px no-repeat;
}
.popup-close:hover { opacity: 1; background: rgba(255, 255, 255, .08); }

.store-product-popup-content { max-width: 860px; }
.product-options-popup .popup-content { max-width: 480px; }
.login-popup { z-index: 1002; }
.login-popup-content { max-width: 440px; }
.basket { position: relative; z-index: 1001; }

.gift-form-popup .popup-content { max-width: 440px; }
.gift-form-popup .popup-content h3 { margin-bottom: 12px; }
.gift-form-popup .popup-content .actions { position: relative; margin-top: 14px; display: flex; gap: 10px; }

.store-quote-popup .popup-content { max-width: 460px; }
.store-quote .actions { display: flex; gap: 10px; margin-top: 18px; }

/* ------------------------------------------------------------
   17 · TOASTS (markup generated by main.js)
   ------------------------------------------------------------ */
.toaster {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 40px));
}

.toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 40px 14px 18px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), var(--inner-hairline);
  font-size: 13px;
  color: var(--text-body);
  overflow: hidden;
  animation: sw-toast-in var(--dur-base) var(--ease-out);
}
@keyframes sw-toast-in {
  from { opacity: 0; translate: 0 10px; }
  to { opacity: 1; translate: 0 0; }
}

.toast::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--sw-info);
}
.toast-success::before { background: var(--sw-success); }
.toast-error::before { background: var(--sw-danger); }
.toast-warning::before { background: var(--sw-warning); }
.toast-info::before { background: var(--sw-info); }

.toast p { margin: 0; }

.toast-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  font-size: 0;
  color: transparent;
  opacity: .55;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.toast-close::before {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  background-color: var(--text-body);
  mask: url("https://template-assets.tebex.io/images/close.svg") center center / 12px no-repeat;
}
.toast-close:hover { opacity: 1; }

/* ------------------------------------------------------------
   18 · SIDEBAR WIDGETS (Tebex modules)
   ------------------------------------------------------------ */
.widget {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), var(--inner-hairline);
  overflow: hidden;
}

.widget-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-accent);
}

.widget-content { padding: 18px; font-size: 13px; }
.widget-content .empty { color: var(--text-faint); }

/* featured package widget reuses the product card */
.widget-featured .widget-content { padding: 0; }
.widget-featured .store-product {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.widget-featured .store-product:hover { transform: none; box-shadow: none; }
.widget-featured .widget-title {
  background: var(--surface-gold-soft);
  color: var(--sw-gold);
  border-bottom-color: rgba(255, 200, 30, .25);
}

/* progress bars (goal / community goal) */
.progress {
  width: 100%;
  height: 12px;
  border-radius: var(--radius-pill);
  background: var(--surface-inset);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  margin-bottom: 10px;
}
.progress-bar {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--grad-brand);
  transition: width var(--dur-slow) var(--ease-out);
}
.progress-bar.striped {
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, .18) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .18) 50%, rgba(255, 255, 255, .18) 75%, transparent 75%, transparent),
    var(--grad-brand);
  background-size: 16px 16px, 100% 100%;
}
.progress-bar.animated { animation: sw-stripes 1s linear infinite; }
@keyframes sw-stripes { to { background-position: 16px 0; } }

.widget .goal-image { border-radius: var(--radius-sm); margin-bottom: 12px; }
.widget .descr { margin-bottom: 12px; color: var(--text-muted); }

/* recent payments */
.purchases { display: flex; flex-direction: column; gap: 12px; }
.purchase { display: flex; align-items: center; gap: 10px; }
.purchase .avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  flex: none;
}
.purchase .info { min-width: 0; }
.purchase .username {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-display);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.purchase p { font-size: 12px; color: var(--text-faint); }
.purchase .price { font-family: var(--font-mono); color: var(--text-muted); }
.purchase .sep { margin: 0 3px; }
.purchase time { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); }

/* top donator */
.widget-top-donator .widget-content { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; }
.widget-top-donator .avatar {
  grid-row: span 2;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
}
.widget-top-donator .username { font-size: 14px; font-weight: 700; color: var(--text-display); }
.widget-top-donator p { font-size: 12px; color: var(--text-faint); }
.widget-top-donator .empty { grid-column: 1 / -1; }

/* server status */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  font-family: var(--font-condensed);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.badge-success { background: rgba(43, 232, 140, .14); color: var(--sw-success); border: 1px solid rgba(43, 232, 140, .35); }
.badge-danger { background: rgba(255, 59, 92, .12); color: var(--sw-danger); border: 1px solid rgba(255, 59, 92, .35); }

.widget-server-status h6 {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-display);
  cursor: pointer;
  margin-bottom: 4px;
}
.widget-server-status h6:hover { color: var(--sw-gold); }
.widget-server-status p { color: var(--text-faint); font-size: 12px; }

/* gift card widget */
.widget-gift-card .widget-content { display: flex; flex-wrap: wrap; gap: 8px; }
.widget-gift-card .gift-card-input { flex: 1; min-width: 0; }
.widget-gift-card p { width: 100%; margin: 4px 0 0; }

/* generic alert paragraphs (giftcard module etc.) */
.alert {
  position: relative;
  padding: 10px 14px 10px 17px;
  border-radius: var(--radius-md);
  background: var(--surface-inset);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
  overflow: hidden;
}
.alert::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--sw-info);
}
.alert-danger::before { background: var(--sw-danger); }
.alert-warning::before { background: var(--sw-warning); }
.alert-success::before { background: var(--sw-success); }

/* ------------------------------------------------------------
   19 · FORMS (login / options / gift / quote)
   ------------------------------------------------------------ */
.store-form input[type="text"],
.store-form input[type="number"],
.store-form input[type="search"],
.store-form input[type="email"],
.store-form select,
.store-form textarea,
.gift-form-popup input[type="text"],
.widget-gift-card .gift-card-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface-inset);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-display);
  font-size: 14px;
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.store-form input:focus,
.store-form select:focus,
.store-form textarea:focus,
.gift-form-popup input:focus,
.widget-gift-card .gift-card-input:focus {
  outline: none;
  border-color: var(--sw-accent);
  box-shadow: var(--focus-ring);
}
.store-form input::placeholder { color: var(--text-faint); }

.store-form select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238574A3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 38px;
  cursor: pointer;
}
.store-form select option { background: var(--sw-ink-800); color: var(--text-body); }

.store-form .field { margin-bottom: 16px; }
.store-form .field > p { margin-bottom: 8px; font-size: 13px; color: var(--text-muted); }
.store-form .field-inline { display: flex; align-items: center; gap: 10px; }

.store-form .actions { display: flex; flex-wrap: wrap; gap: 10px; }

.store-product-options .product-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 24px;
  text-transform: uppercase;
  line-height: 1.05;
  color: var(--text-display);
  margin-bottom: 18px;
  padding-right: 34px;
  transform: skewX(var(--display-skew));
  transform-origin: left bottom;
}

/* login page/popup */
.store-form h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 26px;
  text-transform: uppercase;
  color: var(--text-display);
  margin-bottom: 16px;
  transform: skewX(var(--display-skew));
  transform-origin: left bottom;
}
.login-popup-content form.field,
.store-form form.field { display: flex; gap: 10px; }
.login-popup-content form.field input { flex: 1; }

/* ------------------------------------------------------------
   20 · TEXT CONTENT (CMS pages, descriptions, homepage content)
   ------------------------------------------------------------ */
.text-content { line-height: 1.65; color: var(--text-body); }

.text-content h1,
.text-content h2 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 1.02;
  color: var(--text-display);
  margin: 1.4em 0 .5em;
}
.text-content h1 { font-size: 34px; }
.text-content h2 { font-size: 28px; }
.text-content h3, .text-content h4, .text-content h5, .text-content h6 {
  font-weight: 700;
  color: var(--text-display);
  margin: 1.3em 0 .45em;
}
.text-content h3 { font-size: 19px; }
.text-content h4 { font-size: 16px; }
.text-content > :first-child, .text-content > h1:first-child, .text-content > h2:first-child { margin-top: 0; }

.text-content p { margin: 0 0 1em; }
.text-content ul, .text-content ol { margin: 0 0 1em; padding-left: 1.3em; }
.text-content li { margin-bottom: .35em; }
.text-content li::marker { color: var(--sw-accent-hover); }

.text-content img { border-radius: var(--radius-lg); margin: 1em 0; }

.text-content hr {
  border: 0;
  height: 1px;
  background: var(--border-default);
  margin: 2em 0;
}

.text-content blockquote {
  margin: 1.2em 0;
  padding: 14px 18px;
  background: var(--surface-inset);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-style: italic;
}

.text-content code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--surface-inset);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xs);
  padding: .1em .4em;
}
.text-content pre {
  background: var(--sw-ink-900);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  overflow-x: auto;
  margin: 0 0 1em;
}
.text-content pre code { background: none; border: 0; padding: 0; }

.text-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.2em;
  font-size: 14px;
}
.text-content th, .text-content td {
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  text-align: left;
}
.text-content th {
  background: var(--surface-inset);
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.store-text { min-width: 0; }

/* ------------------------------------------------------------
   21 · TIERED CATEGORIES (subscriptions)
   ------------------------------------------------------------ */
.store-category-tiered-header { margin-bottom: 26px; }
.store-category-tiered-header h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 3.6vw, 44px);
  text-transform: uppercase;
  color: var(--text-display);
  transform: skewX(var(--display-skew));
  transform-origin: left bottom;
}

.store-products-tiered {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

.store-products-tiered .store-product-tiered {
  display: flex;
  flex-direction: column;
  padding: 24px;
  gap: 12px;
}
.store-products-tiered .store-product-tiered .image {
  border-radius: var(--radius-md);
  max-height: 160px;
  object-fit: cover;
}
.store-products-tiered .store-product-tiered .product-title { min-height: 0; font-size: 20px; }
.store-products-tiered .store-product-tiered .descr { font-size: 13px; color: var(--text-muted); flex: 1; }
.store-products-tiered .store-product-tiered.subscribed {
  border-color: var(--sw-accent);
  box-shadow: var(--glow-accent);
}

/* ------------------------------------------------------------
   22 · FOOTER
   ------------------------------------------------------------ */
.site-footer {
  margin-top: 88px;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-raised);
}

.site-footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 56px var(--content-padding) 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-mark { height: 64px; width: auto; }

.footer-blurb {
  margin-top: 16px;
  max-width: 300px;
  font-size: 13px;
  color: var(--text-faint);
}

.footer-social { display: flex; gap: 8px; margin-top: 18px; }
.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  transition: all var(--dur-fast) var(--ease-out);
}
.social-btn svg { width: 16px; height: 16px; }
.social-btn:hover {
  color: var(--text-display);
  border-color: var(--sw-accent);
  background: var(--surface-accent-soft);
}

.footer-title {
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-links { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer-links a { font-size: 13px; color: var(--text-faint); }
.footer-links a:hover { color: var(--text-display); }

.footer-bottom {
  margin-top: 48px;
  padding-top: 22px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.we-accept {
  display: flex;
  align-items: center;
  gap: 14px;
  list-style: none;
}
.we-accept img {
  height: 20px;
  width: auto;
  opacity: .55;
  filter: grayscale(35%);
  transition: opacity var(--dur-fast) var(--ease-out), filter var(--dur-fast) var(--ease-out);
}
.we-accept li:hover img { opacity: 1; filter: none; }

.copyright {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
}

/* ------------------------------------------------------------
   23 · RESPONSIVE
   ------------------------------------------------------------ */
@media (width <= 1180px) {
  .sw-category-grid { grid-template-columns: repeat(2, 1fr); }
  .store-products-grid.sw-cols-4 { grid-template-columns: repeat(3, 1fr); }
}

@media (width <= 1280px) {
  .header-chip-server { display: none; }
}

@media (width <= 960px) {
  .site-content-widgets { grid-template-columns: 1fr; }
  .store-sidebar { position: static; }
  .store-products-grid, .store-products-grid.sw-cols-4 { grid-template-columns: repeat(2, 1fr); }
  .store-products-tiered { grid-template-columns: 1fr; }
  .store-product-full {
    grid-template-columns: 1fr;
    grid-template-areas: "back" "title" "media" "actions" "descr";
  }
  .store-product-full > .product-actions,
  .store-product-full > .sw-buy-col { position: static; }
  .site-header-inner { gap: 12px; }
  .header-chip-discord .chip-label { display: none; }
  .sw-hero { min-height: 470px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (width <= 640px) {
  :root { --content-padding: 20px; --widget-padding: 18px; --sw-logo-h: 38px !important; }
  .site-header-inner { gap: 8px; }
  .site-header-actions { gap: 6px; }
  .header-chip { padding: 7px 9px; }
  .user-name { padding-left: 10px; padding-right: 10px; }
  .user-name .text-inner { display: none; }
  .open-basket.btn-glyph-text { padding-left: 12px; padding-right: 12px; }
  .site-sale-banner { font-size: 10px; letter-spacing: .14em; padding: 7px 14px; }
  .sw-hero-inner { padding: 56px var(--content-padding); }
  .sw-hero-stats { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); justify-content: start; }
  .sw-hero-stats .stat { padding: 0 14px; }
  .sw-hero-stats .stat:first-child { padding-left: 0; }
  .sw-hero-stats .stat-value { font-size: 22px; }
  .sw-hero-stats .stat-label { font-size: 9px; letter-spacing: .1em; }
  .sw-category-grid { grid-template-columns: 1fr; gap: 14px; }
  .sw-category-tile { aspect-ratio: 16 / 9; }
  .sw-category-tile .tile-body { left: 18px; right: 72px; bottom: 16px; gap: 7px; }
  .sw-category-tile .tile-arrow { right: 16px; bottom: 16px; width: 40px; height: 40px; }
  .sw-trust-grid { grid-template-columns: 1fr; }
  .store-products-grid, .store-products-grid.sw-cols-4 { grid-template-columns: 1fr; }
  .store-products-list .store-product { flex-direction: column; }
  .store-products-list .image-link { width: 100%; }
  .sw-section { margin-top: 48px; }
  .sw-section-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .sw-category-head { align-items: stretch; flex-direction: column; }
  .sw-catalog-toolbar { flex-wrap: wrap; }
  .sw-search { flex: 1; }
  .sw-search-input { width: 100%; }
  .sw-promo-inner { padding: 36px 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  .basket-popup-content.basket { width: 100vw; border-left: 0; }
  .user-name .text, .user-name .text-hover { max-width: 74px; }
  .basket-label { display: none; }
}

/* ------------------------------------------------------------
   24 · MOTION LAYER - load sequence, scroll reveals, micro anims
   ------------------------------------------------------------ */

/* hero load sequence (staggered rise) */
@keyframes sw-rise {
  from { opacity: 0; transform: translateY(14px); }
}
@keyframes sw-rise-skew {
  from { opacity: 0; transform: skewX(var(--display-skew)) translateY(14px); }
  to { opacity: 1; transform: skewX(var(--display-skew)); }
}
.sw-hero-meta { animation: sw-rise .55s var(--ease-out) .05s backwards; }
.sw-hero-title { animation: sw-rise-skew .6s var(--ease-out) .14s backwards; }
.sw-hero-sub { animation: sw-rise .55s var(--ease-out) .24s backwards; }
.sw-hero-ctas { animation: sw-rise .55s var(--ease-out) .32s backwards; }
.sw-hero-stats { animation: sw-rise .55s var(--ease-out) .42s backwards; }

/* ambient glow breathe */
.sw-hero-glow { animation: sw-breathe 9s ease-in-out infinite; }
@keyframes sw-breathe { 50% { opacity: .72; } }

/* scroll reveals (classes applied by studioworks.js; safe without JS) */
.sw-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s var(--ease-out), transform .55s var(--ease-out);
  transition-delay: calc(var(--reveal-i, 0) * 70ms);
}
.sw-reveal.sw-revealed { opacity: 1; transform: none; }

/* micro interactions */
.btn-lg svg:last-child { transition: transform var(--dur-base) var(--ease-out); }
.btn-lg:hover svg:last-child { transform: translateX(3px); }

@keyframes sw-pop { 40% { transform: scale(1.35); } }
.basket-count.sw-pop { animation: sw-pop .35s var(--ease-out); }

/* ------------------------------------------------------------
   25 · PRODUCT PAGE EXTRAS (replaced package.html)
   ------------------------------------------------------------ */
.sw-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  font-family: var(--font-condensed);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.sw-back svg { width: 15px; height: 15px; transition: transform var(--dur-base) var(--ease-out); }
.sw-back:hover { color: var(--text-display); }
.sw-back:hover svg { transform: translateX(-3px); }
.store-product-full {
  grid-template-areas:
    "back back"
    "title title"
    "media actions"
    "descr actions";
}
.store-product-full > .sw-back { grid-area: back; margin-bottom: 0; align-self: start; }

/* buy column: actions panel + trust notes share the sticky right rail */
.store-product-full > .sw-buy-col {
  grid-area: actions;
  align-self: start;
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sw-buy-col .product-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  margin-top: 0;
  padding: 24px;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), var(--inner-hairline);
}
.sw-buy-col .product-actions .price { flex-direction: row; min-height: 0; margin-bottom: 4px; }
.sw-buy-col .product-actions .price strong { font-size: 34px; }
.sw-buy-col .product-actions .gift {
  font-size: 12px;
  min-width: 0;
  width: 100%;
  height: auto;
  padding: 10px 18px;
  order: 0;
  display: inline-flex;
  gap: 8px;
}

.sw-buy-notes {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.sw-buy-notes li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.sw-buy-notes svg { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--sw-success); }

.popup .store-product-full > .sw-buy-col { position: static; }

/* ------------------------------------------------------------
   26 · DISCORD CARD (above the footer)
   ------------------------------------------------------------ */
.sw-discord-wrap {
  max-width: var(--container-max);
  margin: 88px auto 0;
  padding: 0 var(--content-padding);
}
.sw-discord-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 36px 40px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(90% 160% at 92% 10%, rgba(139, 39, 232, .22) 0%, rgba(5, 2, 8, 0) 55%),
    var(--surface-card);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-lg), var(--inner-hairline);
  overflow: hidden;
}
.sw-discord-card .dc-mark { width: 84px; height: auto; flex: none; }
.sw-discord-card .dc-text { flex: 1; min-width: 0; }
.sw-discord-card h3 {
  font-size: 24px;
  transform: skewX(var(--display-skew));
  transform-origin: left bottom;
}
.sw-discord-card h3 .accent { color: var(--sw-accent-hover); }
.sw-discord-card p { margin-top: 8px; font-size: 13.5px; color: var(--text-muted); max-width: 52ch; }
.btn-white {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  background: #E6DFF2;
  color: var(--text-on-light);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.btn-white:hover {
  color: var(--text-on-light);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 255, 255, .25);
}
.btn-white svg { width: 16px; height: 16px; }
.site-footer { margin-top: 48px; }
.sw-discord-wrap + .site-footer { margin-top: 48px; }

@media (width <= 720px) {
  .sw-discord-card { flex-direction: column; align-items: flex-start; padding: 28px 24px; }
  .sw-discord-card .dc-mark { width: 64px; }
}

/* ------------------------------------------------------------
   27 · FOOTER MODULES + RECENT-PURCHASES TICKER
   ------------------------------------------------------------ */
/* Tebex sidebar modules now render once, above the footer. Any module the
   owner enables shows here as a centered card - except "recent payments",
   which becomes a full-width running ticker. */
.sw-footer-modules { width: 100%; }
.sw-footer-modules .widget {
  max-width: var(--container-max);
  margin: 32px auto 0;
}
.sw-footer-modules > .widget:first-child,
.sw-footer-modules > *:first-child { margin-top: 64px; }
@media (width > 640px) {
  .sw-footer-modules .widget {
    margin-left: auto;
    margin-right: auto;
    width: calc(100% - var(--content-padding) * 2);
  }
}

.sw-ticker {
  position: relative;
  display: flex;
  align-items: stretch;
  margin-top: 64px;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-raised);
  overflow: hidden;
}
.sw-footer-modules .sw-ticker {
  max-width: none;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.sw-ticker-label {
  position: relative;
  z-index: 2;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px 14px var(--content-padding);
  background: var(--surface-raised);
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--sw-gold);
  white-space: nowrap;
}
.sw-ticker-label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sw-success);
  box-shadow: 0 0 0 0 rgba(43, 232, 140, .5);
  animation: sw-ping 2.2s ease-out infinite;
}
@keyframes sw-ping {
  0% { box-shadow: 0 0 0 0 rgba(43, 232, 140, .5); }
  70% { box-shadow: 0 0 0 8px rgba(43, 232, 140, 0); }
  100% { box-shadow: 0 0 0 0 rgba(43, 232, 140, 0); }
}
.sw-ticker-label::after {
  content: "";
  position: absolute;
  right: -18px;
  top: 0;
  bottom: 0;
  width: 18px;
  background: linear-gradient(90deg, var(--surface-raised), rgba(10, 5, 18, 0));
  pointer-events: none;
}

.sw-ticker-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 40px, #000 calc(100% - 60px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 40px, #000 calc(100% - 60px), transparent 100%);
}

.sw-ticker-track {
  display: flex;
  align-items: center;
  gap: 44px;
  width: max-content;
  padding: 10px 44px 10px 24px;
  animation: sw-marquee 38s linear infinite;
}
.sw-ticker:hover .sw-ticker-track { animation-play-state: paused; }
@keyframes sw-marquee {
  to { transform: translateX(-50%); }
}

.sw-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-muted);
}
.sw-ticker-item .avatar {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  flex: none;
}
.sw-ticker-item .buyer { font-weight: 700; color: var(--text-display); }
.sw-ticker-item .bought { color: var(--text-faint); }
.sw-ticker-item .item-name { color: var(--text-muted); }
.sw-ticker-item .price {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--sw-gold);
}
.sw-ticker-item .price strong { font-weight: 600; color: var(--sw-gold); }

@media (prefers-reduced-motion: reduce) {
  .sw-ticker-track { animation: none; }
  .sw-ticker-viewport { overflow-x: auto; mask-image: none; -webkit-mask-image: none; }
  .sw-ticker-label::before { animation: none; }
}
@media (width <= 640px) {
  .sw-ticker-label { padding: 12px 16px 12px var(--content-padding); font-size: 11px; }
}

/* ------------------------------------------------------------
   28 · REDUCED MOTION
   ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .sw-reveal { opacity: 1 !important; transform: none !important; }
  .sw-hero-glow { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ---------------------------------------------------------------
   29 - HEADER ICON BUTTONS (clean right side)
   --------------------------------------------------------------- */
.header-socials { display: inline-flex; align-items: center; gap: 2px; }

.header-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.header-icon-btn svg { width: 18px; height: 18px; }
.header-icon-btn:hover { color: var(--text-display); background: rgba(255, 255, 255, .07); }
.header-icon-btn:active { transform: scale(.94); }

.header-divider {
  width: 1px;
  height: 22px;
  background: var(--border-default);
  margin: 0 4px;
  flex: none;
}

/* basket as icon button: badge sits on the corner */
.header-icon-btn .basket-count {
  position: absolute;
  top: 1px;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  margin-left: 0;
  font-size: 10px;
}

@media (width <= 640px) {
  .header-socials, .header-divider { display: none; }
}

/* Exo marks the nav logout entry .mobile-only - drawer only, never in the desktop bar */
@media (width > 960px) {
  .site-navigation .mobile-only { display: none; }
}

/* ---------------------------------------------------------------
   30 - FLOATING HERO MARK
   --------------------------------------------------------------- */
.sw-hero-mark {
  position: absolute;
  top: 50%;
  right: calc(var(--content-padding) + 1.5vw);
  width: min(26vw, 400px);
  transform: translateY(-50%);
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 30px 70px rgba(139, 39, 232, .5)) drop-shadow(0 6px 18px rgba(0, 0, 0, .6));
  animation:
    sw-mark-in .9s var(--ease-out) .5s backwards,
    sw-float 7s ease-in-out 1.4s infinite;
}
@keyframes sw-mark-in {
  from { opacity: 0; transform: translateY(calc(-50% + 30px)) rotate(-6deg) scale(.9); }
}
@keyframes sw-float {
  0%, 100% { transform: translateY(-50%) rotate(0deg); }
  50% { transform: translateY(calc(-50% - 16px)) rotate(2.4deg); }
}
@media (width <= 1180px) {
  .sw-hero-mark { width: min(24vw, 320px); opacity: .55; }
}
@media (width <= 960px) {
  .sw-hero-mark { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sw-hero-mark { animation: none; }
}

/* ---------------------------------------------------------------
   31 - VISUAL POLISH PACK
   --------------------------------------------------------------- */

/* dark scrollbar - the stock grey one breaks the theme */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--surface-page); }
::-webkit-scrollbar-thumb {
  background: var(--sw-ink-600);
  border-radius: 6px;
  border: 3px solid var(--surface-page);
}
::-webkit-scrollbar-thumb:hover { background: var(--sw-accent); }

/* hero closes on a brand gradient line instead of a flat border */
.sw-hero { border-bottom: 0; }
.sw-hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(155, 61, 255, .65) 18%, rgba(255, 200, 30, .55) 50%, rgba(155, 61, 255, .65) 82%, transparent);
}

/* light sweep across the big CTAs on hover */
.btn-gold, .btn-white { position: relative; overflow: hidden; }
.btn-gold::after, .btn-white::after {
  content: "";
  position: absolute;
  top: -40%;
  bottom: -40%;
  width: 36%;
  left: -60%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-18deg);
  pointer-events: none;
}
.btn-gold:hover::after, .btn-white:hover::after { left: 130%; transition: left .55s ease; }

/* spray-tag dash in front of section eyebrows */
.sw-section-head .sw-eyebrow { display: flex; align-items: center; gap: 10px; }
.sw-section-head .sw-eyebrow::before {
  content: "";
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: var(--grad-gold);
  transform: skewX(-18deg);
  flex: none;
}

/* glossy sweep over card artwork + category tiles on hover */
.store-product .image-link::before,
.sw-category-tile::after {
  content: "";
  position: absolute;
  top: -30%;
  bottom: -30%;
  width: 40%;
  left: -70%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .16), transparent);
  transform: skewX(-18deg);
  z-index: 2;
  pointer-events: none;
}
.store-product:hover .image-link::before,
.sw-category-tile:hover::after { left: 140%; transition: left .7s ease; }

/* announcement bar gets a passing sheen */
.site-sale-banner { position: relative; overflow: hidden; }
.site-sale-banner::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 25%;
  left: -40%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, .5), transparent);
  transform: skewX(-18deg);
  animation: sw-banner-sheen 6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes sw-banner-sheen {
  0%, 55% { left: -40%; }
  75%, 100% { left: 140%; }
}

/* small life on the brand + hero numbers */
.site-logo img { transition: transform var(--dur-base) var(--ease-out); }
.site-logo:hover img { transform: scale(1.05); }
.sw-hero-stats .stat-value { text-shadow: 0 0 26px rgba(199, 155, 255, .35); }

/* back-to-top (element injected by studioworks.js) */
.sw-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(21, 12, 36, .85);
  border: 1px solid var(--border-default);
  color: var(--text-muted);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  translate: 0 10px;
  transition: opacity var(--dur-base) var(--ease-out), translate var(--dur-base) var(--ease-out), visibility 0s linear var(--dur-base), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.sw-top svg { width: 20px; height: 20px; }
.sw-top.sw-top-visible { opacity: 1; visibility: visible; translate: 0 0; transition-delay: 0s; }
.sw-top:hover { color: var(--text-display); border-color: var(--sw-accent); box-shadow: var(--glow-accent); }

/* ---------------------------------------------------------------
   32 - CATALOG CARDS (reference layout)
   --------------------------------------------------------------- */

/* full-width search bar above the grid, sort docked right */
.sw-catalog-toolbar { width: 100%; margin-bottom: 26px; }
.sw-search { flex: 1; height: 50px; border-radius: var(--radius-md); }
.sw-search svg { width: 17px; height: 17px; }
.sw-search-input { width: 100%; font-size: 14.5px; }
/* .sw-search already draws the focus ring around the whole field; without
   this the global :focus-visible ring stacks a second one on the bare input */
.sw-search-input:focus-visible { box-shadow: none; border-radius: 0; }
.sw-sort-select { height: 50px; border-radius: var(--radius-md); flex: none; }
.sw-category-head { margin-bottom: 18px; }

/* price row: bold sans price, struck old price, red off-chip inline */
.store-products-grid .product-actions .price strong,
.store-products-list .product-actions .price strong {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: 0;
  transform: none;
}
.price-off {
  order: 3;
  display: inline-flex;
  align-items: center;
  align-self: center;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  background: var(--sw-danger);
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: .02em;
  transform: none;
}

/* cards carry one clean full-width CTA - gifting stays on the product page */
.store-products-grid .product-actions .gift,
.store-products-list .product-actions .gift { display: none; }
.store-products-grid .product-actions .btn-primary,
.store-products-grid .product-actions .btn-secondary.add,
.store-products-list .product-actions .btn-primary,
.store-products-list .product-actions .btn-secondary.add {
  width: 100%;
  flex: 1 1 100%;
  padding: 12px 18px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .01em;
  text-transform: none;
}

/* roomier card body, bigger title, calmer excerpt */
.store-products-grid .product-title,
.store-products-list .product-title { font-size: 16.5px; line-height: 1.4; }
.store-products-grid .product-excerpt,
.store-products-list .product-excerpt { font-size: 13px; }
.store-products-grid .product-body { padding: 16px 18px 18px; gap: 11px; }

/* ---------------------------------------------------------------
   33 - PRODUCT DETAIL PAGE (own page, no longer a popup)
   Gallery left, open buy column right and bottom-aligned with it,
   then the description running full width underneath - one block.
   --------------------------------------------------------------- */

/* Tebex reports displayType "images" for the standard grid; category.html
   normalises it, this alias keeps any other page on the same rails. */
.store-products-images {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.store-products-images.sw-cols-4 { grid-template-columns: repeat(4, 1fr); }

.store-product-full.sw-pdp {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  grid-template-areas:
    "back  back"
    "media buy"
    "descr descr";
  gap: 18px 44px;
  align-content: start;
}

.sw-pdp > .sw-back { grid-area: back; margin-bottom: 0; align-self: start; }
.sw-back strong { color: var(--text-display); font-weight: 700; }

.sw-pdp-media { grid-area: media; min-width: 0; align-self: start; }
.sw-pdp-media > .image,
.sw-pdp-media > .image-default,
.sw-pdp-media > .media-slider {
  width: 100%;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.sw-pdp-media > .image-default { aspect-ratio: 16 / 9; }

/* Media rail is pinned to 16:9. Product galleries mix a 16:9 key art with
   portrait screenshots; without this the slider takes the tallest slide and
   the hero image floats in a black letterbox twice its own height. */
.sw-pdp-media .slider { aspect-ratio: 16 / 9; height: auto; min-height: 0; }
.sw-pdp-media .slider::part(container) { height: 100%; }
.sw-pdp-media .slider::part(wrapper) { height: 100%; align-items: center; }
.sw-pdp-media .slide { height: 100%; }
.sw-pdp-media .slide-image { width: 100%; height: 100%; min-height: 0; object-fit: contain; cursor: zoom-in; }
.sw-pdp-media .slide-frame { height: 100%; max-height: 100%; }
.sw-pdp-media > .image { cursor: zoom-in; }

/* ---- buy column: no card, just a clean stack ---- */
.sw-pdp-buy { grid-area: buy; min-width: 0; align-self: end; }

.sw-pdp-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.sw-pdp-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 2.3vw, 34px);
  line-height: 1.04;
  text-transform: uppercase;
  color: var(--text-display);
  transform: skewX(var(--display-skew));
  transform-origin: left bottom;
}
.sw-pdp-title .countdown {
  display: inline-block;
  margin-left: 10px;
  vertical-align: middle;
  padding: 4px 9px;
  border-radius: var(--radius-xs);
  background: rgba(255, 200, 30, .12);
  border: 1px solid rgba(255, 200, 30, .4);
  color: var(--sw-gold);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  transform: skewX(6deg);
}

/* framework chips, filled by studioworks.js from the description text */
.sw-pdp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -8px; }
.sw-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  background: var(--surface-inset);
  border: 1px solid var(--border-subtle);
  font-family: var(--font-condensed);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.sw-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sw-accent-hover);
  flex: none;
}

/* price and CTA share one row, separated from the title by a hairline */
.sw-pdp-card .product-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 18px;
  margin-top: 0;
  padding: 22px 0 0;
  background: none;
  border: 0;
  border-top: 1px solid var(--border-subtle);
  box-shadow: none;
}
.sw-pdp-card .product-actions .price {
  width: auto;
  flex: 0 1 auto;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 9px;
  min-height: 0;
  margin: 0;
}
.sw-pdp-card .product-actions .price strong {
  font-family: var(--font-ui);
  font-weight: 800;
  font-size: 40px;
  line-height: 1;
  letter-spacing: -.02em;
  transform: none;
  color: var(--text-display);
}
.sw-pdp-card .product-actions .price del,
.sw-pdp-card .product-actions .price del strong { font-size: 15px; font-weight: 600; }

.sw-pdp-card .product-actions .add,
.sw-pdp-card .product-actions .subscribe,
.sw-pdp-card .product-actions .open-basket-cta,
.sw-pdp-card .product-actions .quantity-field {
  flex: 1 1 165px;
  width: auto;
  min-width: 0;
  margin-left: auto;
}
.sw-pdp-card .product-actions .add,
.sw-pdp-card .product-actions .subscribe,
.sw-pdp-card .product-actions .open-basket-cta {
  padding: 16px 22px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: none;
}
.sw-pdp-card .product-actions .gift {
  flex: 1 1 100%;
  order: 5;
  font-size: 12px;
  min-width: 0;
  width: 100%;
  height: auto;
  padding: 10px 18px;
  display: inline-flex;
  gap: 8px;
}
.sw-pdp-card .product-actions .gift::before { width: 15px; height: 15px; }

/* trust lines: open list, no box */
.sw-pdp-card .sw-buy-notes {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 0 0;
  margin-top: -2px;
  border-top: 1px solid var(--border-subtle);
  background: none;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
}
.sw-pdp-card .sw-buy-notes li { font-size: 13px; color: var(--text-muted); }
.sw-pdp-card .sw-buy-notes svg { width: 15px; height: 15px; margin-top: 3px; }

/* ---- description: one calm block, full width, generous type ---- */
.sw-pdp-descr {
  grid-area: descr;
  min-width: 0;
  margin-top: 12px;
  padding: 36px 40px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--inner-hairline);
}

.sw-pdp-descr .descr {
  font-size: 15.5px;
  line-height: 1.78;
  color: var(--text-body);
}
/* cap the measure so full-width lines stay readable */
.sw-pdp-descr .descr p,
.sw-pdp-descr .descr ul,
.sw-pdp-descr .descr ol,
.sw-pdp-descr .descr blockquote { max-width: 92ch; }

.sw-pdp-descr .descr h1,
.sw-pdp-descr .descr h2 {
  font-size: clamp(22px, 2vw, 27px);
  margin: 2em 0 .7em;
  padding-top: 1.1em;
  border-top: 1px solid var(--border-subtle);
}
.sw-pdp-descr .descr > :first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.sw-pdp-descr .descr h3 { font-size: 17.5px; margin: 1.6em 0 .5em; }
.sw-pdp-descr .descr h4 { font-size: 15.5px; margin: 1.5em 0 .45em; }
.sw-pdp-descr .descr p { margin: 0 0 1.15em; }
.sw-pdp-descr .descr ul,
.sw-pdp-descr .descr ol { margin: 0 0 1.15em; padding-left: 1.25em; }
.sw-pdp-descr .descr li { margin-bottom: .55em; }
.sw-pdp-descr .descr img { border-radius: var(--radius-lg); margin: 1.4em 0; }
.sw-pdp-descr .descr > :last-child { margin-bottom: 0; }

/* main.js can still render this page inside its product popup - basket item
   links and history navigation both go through openProductPopup, and there the
   .sw-pdp grid class is absent. Without a stretch the media rail has no
   resolvable width, so its 16:9 ratio blows the box up to millions of pixels
   and the popup reads as empty. */
.popup .store-product-full > .sw-pdp-media,
.popup .store-product-full > .sw-pdp-buy,
.popup .store-product-full > .sw-pdp-descr {
  align-self: stretch;
  width: 100%;
  min-width: 0;
}
.popup .store-product-full > .sw-pdp-descr {
  margin-top: 0;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
}
.popup .store-product-full > .sw-back { display: none; }

/* ---------------------------------------------------------------
   34 - MEDIA LIGHTBOX (markup generated by main.js)
   Big picture on top, thumbnail rail underneath - main.js already
   emits .slider + ul.thumbs, this gives them a layout.
   --------------------------------------------------------------- */
.popup.popup-media-slider {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 22px 18px;
  overflow: hidden;
  background: rgba(4, 2, 7, .97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.popup-media-slider .slider {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  height: auto;
  aspect-ratio: auto;
  background: none;
  border-radius: 0;
  margin: 0;
}
.popup-media-slider .slider::part(container) {
  height: 100%;
  --swiper-navigation-size: 26px;
  --swiper-theme-color: #fff;
}
.popup-media-slider .slider::part(wrapper) { height: 100%; align-items: center; }
.popup-media-slider .slider::part(button-prev),
.popup-media-slider .slider::part(button-next) {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: rgba(15, 8, 25, .72);
  border: 1px solid var(--border-default);
  backdrop-filter: blur(6px);
}

.popup-media-slider .slide {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.popup-media-slider .slide-image {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  object-fit: contain;
  margin: auto;
  border-radius: var(--radius-md);
}
.popup-media-slider .slide-frame {
  width: min(100%, 168vh);
  height: auto;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius-md);
  margin: auto;
}

/* thumbnail rail */
.popup-media-slider .thumbs {
  flex: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 4px;
  list-style: none;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--sw-ink-500) transparent;
}
.popup-media-slider .thumbs::-webkit-scrollbar { height: 6px; }

.popup-media-slider .thumb {
  flex: none;
  display: block;
  width: 84px;
  height: 62px;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--surface-inset);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.popup-media-slider .thumb-image,
.popup-media-slider .thumb-youtube {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  border-radius: var(--radius-xs);
  opacity: .45;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.popup-media-slider .thumb-youtube { position: relative; overflow: hidden; }
.popup-media-slider .thumb-youtube img { width: 100%; height: 100%; object-fit: cover; }
.popup-media-slider .thumb-youtube::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  background-color: #fff;
  mask: url("https://template-assets.tebex.io/images/play.svg") center center / contain no-repeat;
}
.popup-media-slider .thumb:hover { border-color: var(--border-strong); }
.popup-media-slider .thumb:hover .thumb-image,
.popup-media-slider .thumb:hover .thumb-youtube { opacity: .8; }
.popup-media-slider .thumb.active {
  border-color: var(--sw-accent);
  box-shadow: 0 0 0 1px var(--sw-accent), var(--glow-accent);
}
.popup-media-slider .thumb.active .thumb-image,
.popup-media-slider .thumb.active .thumb-youtube { opacity: 1; }

.popup-media-slider .popup-close {
  position: fixed;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(15, 8, 25, .72);
  border: 1px solid var(--border-default);
  opacity: 1;
}
.popup-media-slider .popup-close:hover { background: rgba(30, 18, 48, .9); border-color: var(--border-strong); }

@media (max-width: 1180px) {
  .store-product-full.sw-pdp { grid-template-columns: minmax(0, 1fr) 360px; gap: 18px 30px; }
  .sw-pdp-descr { padding: 30px 30px; }
}

@media (max-width: 960px) {
  .store-product-full.sw-pdp {
    grid-template-columns: 1fr;
    grid-template-areas: "back" "media" "buy" "descr";
    gap: 22px;
  }
  .sw-pdp-buy { align-self: start; }
}

@media (max-width: 640px) {
  .sw-pdp-card .product-actions .price strong { font-size: 34px; }
  .sw-pdp-card .product-actions .add,
  .sw-pdp-card .product-actions .subscribe,
  .sw-pdp-card .product-actions .open-basket-cta,
  .sw-pdp-card .product-actions .quantity-field { flex: 1 1 100%; margin-left: 0; }
  .sw-pdp-descr { padding: 22px 20px; margin-top: 4px; }
  .sw-pdp-descr .descr { font-size: 15px; line-height: 1.72; }
  .popup.popup-media-slider { padding: 14px 12px 12px; }
  .popup-media-slider .thumb { width: 66px; height: 50px; }
  .popup-media-slider .thumbs { justify-content: flex-start; }
}
