/* ==========================================================
   GearShiftBD — Global Utilities
   Loaded after base.css, before Tailwind CDN.

   Defines every token-mapped utility class used across
   templates so they render correctly before Tailwind CDN
   processes. Naming mirrors Tailwind conventions exactly —
   classes work in both CDN dev mode and compiled output.

   Depends on: base.css (CSS custom properties must be
   defined first).
========================================================== */


/* ── 1. Background — Surface ─────────────────────────────── */

.bg-void      { background-color: var(--void); }
.bg-surface-0 { background-color: var(--surface-0); }
.bg-surface-1 { background-color: var(--surface-1); }
.bg-surface-2 { background-color: var(--surface-2); }
.bg-surface-3 { background-color: var(--surface-3); }


/* ── 2. Background — Brand ───────────────────────────────── */

.bg-red-400   { background-color: var(--red-400); }
.bg-red-500   { background-color: var(--red-500); }
.bg-red-600   { background-color: var(--red-600); }
.bg-red-800   { background-color: var(--red-800); }
.bg-gold-400  { background-color: var(--gold-400); }
.bg-gold-500  { background-color: var(--gold-500); }


/* ── 3. Text — Ink ───────────────────────────────────────── */

.text-ink-primary   { color: var(--ink-primary); }
.text-ink-secondary { color: var(--ink-secondary); }
.text-ink-muted     { color: var(--ink-muted); }
.text-ink-inverse   { color: var(--ink-inverse); }


/* ── 4. Text — Brand ─────────────────────────────────────── */

.text-red-400   { color: var(--red-400); }
.text-red-500   { color: var(--red-500); }
.text-red-600   { color: var(--red-600); }
.text-red-800   { color: var(--red-800); }
.text-gold-400  { color: var(--gold-400); }
.text-gold-500  { color: var(--gold-500); }


/* ── 5. Text — Stroke (used for decorative text) ────────── */

.text-stroke-dim   { color: var(--stroke-dim); }
.text-stroke-base  { color: var(--stroke-base); }
.text-stroke-loud  { color: var(--stroke-loud); }
.text-stroke-brand { color: var(--stroke-brand); }


/* ── 6. Border — Stroke ──────────────────────────────────── */

.border-stroke-dim   { border-color: var(--stroke-dim); }
.border-stroke-base  { border-color: var(--stroke-base); }
.border-stroke-loud  { border-color: var(--stroke-loud); }
.border-stroke-brand { border-color: var(--stroke-brand); }

.divide-stroke-dim   > * + * { border-color: var(--stroke-dim); }
.divide-stroke-base  > * + * { border-color: var(--stroke-base); }


/* ── 7. Font Families ────────────────────────────────────── */

.font-display   { font-family: var(--font-display); }
.font-condensed { font-family: var(--font-condensed); }
.font-sans      { font-family: var(--font-sans); }
.font-mono      { font-family: var(--font-mono); }


/* ── 8. Transition Easing ────────────────────────────────── */
/* Usage: class="transition ease-sharp duration-200" */

.ease-sharp    { transition-timing-function: var(--ease-sharp); }
.ease-out-fast { transition-timing-function: var(--ease-out-fast); }
.ease-snap     { transition-timing-function: var(--ease-snap); }


/* ── 9. Animation Utilities ──────────────────────────────── */

.animate-fade-up {
  animation: fadeSlideUp 0.7s var(--ease-out-fast) forwards;
}

.animate-fade-in {
  animation: fadeIn 0.6s var(--ease-out-fast) forwards;
}

.animate-marquee {
  animation: marquee 32s linear infinite;
}

.animate-scroll-bar {
  animation: scrollBar 1.8s ease-in-out infinite;
}

.animate-pulse-dot {
  animation: pulse-dot 2s ease-in-out infinite;
}

/* Staggered entrance delays — apply with [style="--delay:Xms"] */
.animate-stagger { animation-delay: var(--delay, 0ms); }

/* Paused state — remove with JS when element enters viewport */
.animate-paused { animation-play-state: paused; }


/* ── 10. Hover — Background ──────────────────────────────── */
/* Backslash escapes colon in CSS selector, matching Tailwind output */

.hover\:bg-red-500:hover   { background-color: var(--red-500); }
.hover\:bg-red-600:hover   { background-color: var(--red-600); }
.hover\:bg-red-800:hover   { background-color: var(--red-800); }
.hover\:bg-surface-1:hover { background-color: var(--surface-1); }
.hover\:bg-surface-2:hover { background-color: var(--surface-2); }


/* ── 11. Hover — Text ────────────────────────────────────── */

.hover\:text-red-500:hover         { color: var(--red-500); }
.hover\:text-red-600:hover         { color: var(--red-600); }
.hover\:text-ink-primary:hover     { color: var(--ink-primary); }
.hover\:text-ink-secondary:hover   { color: var(--ink-secondary); }


/* ── 12. Hover — Border ──────────────────────────────────── */

.hover\:border-stroke-brand:hover  { border-color: var(--stroke-brand); }
.hover\:border-stroke-base:hover   { border-color: var(--stroke-base); }
.hover\:border-stroke-loud:hover   { border-color: var(--stroke-loud); }


/* ── 13. Section Rhythm ──────────────────────────────────── */

.gs-section {
  padding-block: var(--section-py);
}

@media (min-width: 1024px) {
  .gs-section {
    padding-block: var(--section-py-lg);
  }
}

/* Section gap between sibling sections — for tight editorial pairings */
.gs-section-gap { margin-top: var(--section-py); }

@media (min-width: 1024px) {
  .gs-section-gap { margin-top: var(--section-py-lg); }
}


/* ── 14. Layout Helpers ──────────────────────────────────── */

/* Centered flex row */
.gs-row    { display: flex; align-items: center; gap: 0.75rem; }

/* Centered flex column stack */
.gs-stack  { display: flex; flex-direction: column; gap: 1rem; }

/* Flex row, space-between */
.gs-between { display: flex; align-items: center; justify-content: space-between; }

/* Absolute centering */
.gs-center  { display: flex; align-items: center; justify-content: center; }

/* Full absolute cover — for image/overlay layers */
.gs-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Full-bleed breakout — escapes gs-container padding */
.gs-full-bleed {
  margin-inline: calc(-1 * var(--container-px, 1.25rem));
}


/* ── 15. Image Overlays ──────────────────────────────────── */

/* Standard dark-to-transparent vignette (from-bottom) */
.gs-vignette {
  background: linear-gradient(
    to top,
    rgba(8, 8, 8, 0.85) 0%,
    rgba(8, 8, 8, 0.20) 55%,
    transparent 100%
  );
}

/* Heavier vignette for hero use */
.gs-vignette-heavy {
  background: linear-gradient(
    to top,
    rgba(8, 8, 8, 0.95) 0%,
    rgba(8, 8, 8, 0.55) 40%,
    rgba(8, 8, 8, 0.15) 70%,
    transparent 100%
  );
}

/* Horizontal vignette — for side-fades on scrolling rows */
.gs-vignette-left {
  background: linear-gradient(to right, var(--void) 0%, transparent 100%);
}

.gs-vignette-right {
  background: linear-gradient(to left, var(--void) 0%, transparent 100%);
}


/* ── 16. Aspect Ratios (pre-Tailwind CDN fallback) ───────── */

.aspect-square  { aspect-ratio: 1 / 1; }
.aspect-video   { aspect-ratio: 16 / 9; }
.aspect-card    { aspect-ratio: 4 / 3; }
.aspect-banner  { aspect-ratio: 3 / 1; }
.aspect-portrait { aspect-ratio: 2 / 3; }


/* ── 17. Overflow ────────────────────────────────────────── */

.overflow-hidden   { overflow: hidden; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-x-auto   { overflow-x: auto; }
.overflow-y-auto   { overflow-y: auto; }


/* ── 18. Pointer + Select ────────────────────────────────── */

.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }
.select-none         { user-select: none; }
.cursor-pointer      { cursor: pointer; }
.cursor-default      { cursor: default; }


/* ── 19. Visibility ──────────────────────────────────────── */

/* Tailwind's sr-only — hides visually, keeps in DOM for screen readers */
.sr-only {
  position: absolute;
  width:    1px;
  height:   1px;
  padding:  0;
  margin:   -1px;
  overflow: hidden;
  clip:     rect(0, 0, 0, 0);
  white-space: nowrap;
  border:   0;
}

.not-sr-only {
  position: static;
  width:    auto;
  height:   auto;
  padding:  0;
  margin:   0;
  overflow: visible;
  clip:     auto;
  white-space: normal;
}


/* ── 20. Z-Index Scale ───────────────────────────────────── */

.z-0    { z-index: 0; }
.z-10   { z-index: 10; }
.z-20   { z-index: 20; }
.z-30   { z-index: 30; }
.z-40   { z-index: 40; }
.z-50   { z-index: 50; }
.z-auto { z-index: auto; }


/* ── 21. Opacity ─────────────────────────────────────────── */

.opacity-0   { opacity: 0; }
.opacity-10  { opacity: 0.1; }
.opacity-20  { opacity: 0.2; }
.opacity-35  { opacity: 0.35; }
.opacity-50  { opacity: 0.5; }
.opacity-75  { opacity: 0.75; }
.opacity-100 { opacity: 1; }

.hover\:opacity-100:hover { opacity: 1; }
.hover\:opacity-75:hover  { opacity: 0.75; }


/* ── 22. Filter ──────────────────────────────────────────── */

/* Monochrome white — used for brand logos on dark bg */
.filter-white  { filter: brightness(0) invert(1); }
/* Remove filter — used on hover to reveal color logos */
.filter-none   { filter: none; }

.hover\:filter-none:hover { filter: none; }


/* ── 23. Transform Utilities ─────────────────────────────── */

.scale-y-0   { transform: scaleY(0); }
.scale-y-100 { transform: scaleY(1); }
.scale-x-0   { transform: scaleX(0); }
.scale-x-100 { transform: scaleX(1); }

/* Group-hover scale variants — used on category/brand cards */
.group:hover .group-hover\:scale-\[1\.04\] { transform: scale(1.04); }
.group:hover .group-hover\:scale-\[1\.05\] { transform: scale(1.05); }
.group:hover .group-hover\:scale-\[1\.06\] { transform: scale(1.06); }

.group:hover .group-hover\:translate-x-1  { transform: translateX(0.25rem); }
.group:hover .group-hover\:translate-x-0\.5 { transform: translateX(0.125rem); }
.group:hover .group-hover\:-translate-y-1 { transform: translateY(-0.25rem); }


/* ── 24. Group-Hover — Text + Border ────────────────────────*/

.group:hover .group-hover\:text-red-500     { color: var(--red-500); }
.group:hover .group-hover\:text-red-600     { color: var(--red-600); }
.group:hover .group-hover\:text-ink-primary { color: var(--ink-primary); }

.group:hover .group-hover\:border-stroke-brand { border-color: var(--stroke-brand); }

.group:hover .group-hover\:scale-y-100 { transform: scaleY(1); }
.group:hover .group-hover\:scale-x-100 { transform: scaleX(1); }


/* ── 25. Active State ────────────────────────────────────── */

.active\:scale-95:active   { transform: scale(0.95); }
.active\:bg-red-800:active { background-color: var(--red-800); }


/* ── 26. Transition Presets ──────────────────────────────── */
/* Compound transitions for common patterns */

.gs-transition-color {
  transition: color var(--transition-base),
              background-color var(--transition-base),
              border-color var(--transition-base);
}

.gs-transition-transform {
  transition: transform var(--transition-base),
              opacity   var(--transition-base);
}

.gs-transition-all {
  transition: color            var(--transition-base),
              background-color var(--transition-base),
              border-color     var(--transition-base),
              transform        var(--transition-base),
              box-shadow       var(--transition-base),
              opacity          var(--transition-base);
}


/* ── 27. Loading / Disabled State ────────────────────────── */

.is-loading {
  pointer-events: none;
  opacity: 0.6;
  cursor: wait;
}

.is-disabled {
  pointer-events: none;
  opacity: 0.4;
  cursor: not-allowed;
}


/* ── 28. Truncate / Clamp ────────────────────────────────── */

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.break-word    { overflow-wrap: break-word; word-break: break-word; }
.whitespace-nowrap   { white-space: nowrap; }
.whitespace-pre-wrap { white-space: pre-wrap; }


/* ── 29. Responsive Utilities ────────────────────────────── */

/* sm: ≥640px */
@media (min-width: 640px) {
  .sm\:hidden  { display: none; }
  .sm\:block   { display: block; }
  .sm\:flex    { display: flex; }
  .sm\:inline-flex { display: inline-flex; }
}

/* lg: ≥1024px */
@media (min-width: 1024px) {
  .lg\:hidden     { display: none; }
  .lg\:block      { display: block; }
  .lg\:flex       { display: flex; }
  .lg\:inline-flex { display: inline-flex; }
  .lg\:grid       { display: grid; }
}

/* Mobile-only show */
@media (min-width: 640px) {
  .mobile-only { display: none !important; }
}


/* ── 30. Spacing Helpers ─────────────────────────────────── */
/* Named spacing tokens — consistent vertical rhythm */

.mt-section  { margin-top:    var(--section-py); }
.mb-section  { margin-bottom: var(--section-py); }
.pt-section  { padding-top:    var(--section-py); }
.pb-section  { padding-bottom: var(--section-py); }

@media (min-width: 1024px) {
  .mt-section  { margin-top:    var(--section-py-lg); }
  .mb-section  { margin-bottom: var(--section-py-lg); }
  .pt-section  { padding-top:    var(--section-py-lg); }
  .pb-section  { padding-bottom: var(--section-py-lg); }
}

/* Component-level spacing tokens */
.gap-card    { gap: 0.625rem; }       /* 10px — mobile card grids */
.gap-card-lg { gap: 1rem; }           /* 16px — desktop card grids */
.gap-section { gap: var(--section-gap); }

/* Inline content spacing */
.space-top-xs  { margin-top: 0.375rem; }  /* 6px */
.space-top-sm  { margin-top: 0.75rem; }   /* 12px */
.space-top-md  { margin-top: 1.25rem; }   /* 20px */
.space-top-lg  { margin-top: 2rem; }      /* 32px */
.space-top-xl  { margin-top: 3rem; }      /* 48px */


/* ── 31. Card Shadows ────────────────────────────────────── */
/* Named shadow scale — use for elevation hierarchy */

/* Resting states */
.shadow-card-sm   { box-shadow: 0 1px 6px  rgba(0, 0, 0, 0.30); }
.shadow-card      { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.40); }
.shadow-card-lg   { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.50); }
.shadow-card-xl   { box-shadow: 0 12px 48px rgba(0, 0, 0, 0.60); }

/* Hover elevation — brand red glow */
.shadow-brand-xs  { box-shadow: 0 0  0  1px rgba(204, 0, 0, 0.25); }
.shadow-brand-sm  { box-shadow: 0 4px 16px rgba(204, 0, 0, 0.12); }
.shadow-brand     { box-shadow: 0 8px 32px rgba(204, 0, 0, 0.18); }
.shadow-brand-lg  { box-shadow: 0 12px 48px rgba(204, 0, 0, 0.28); }

/* Gold accent glow — for featured/starred items */
.shadow-gold      { box-shadow: 0 4px 24px rgba(201, 168, 76, 0.15); }
.shadow-gold-lg   { box-shadow: 0 8px 40px rgba(201, 168, 76, 0.25); }

/* Inset top stroke — editorial separator */
.shadow-inset-top { box-shadow: inset 0 1px 0 var(--stroke-dim); }

/* Hover shadow transitions */
.hover\:shadow-brand:hover    { box-shadow: 0 8px 32px rgba(204, 0, 0, 0.18); }
.hover\:shadow-brand-lg:hover { box-shadow: 0 12px 48px rgba(204, 0, 0, 0.28); }
.hover\:shadow-card-lg:hover  { box-shadow: 0 6px 24px rgba(0, 0, 0, 0.50); }


/* ── 32. Glass Styles ────────────────────────────────────── */
/*
   Glassmorphism for: header scroll state, search overlay,
   mobile drawer, product quick-view, toast notifications.
   Requires: parent must have a background behind it.
*/

/* Standard — header, drawers */
.glass {
  background: rgba(15, 15, 15, 0.78);
  backdrop-filter:         blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Light — subtle card tinting */
.glass-sm {
  background: rgba(20, 20, 20, 0.55);
  backdrop-filter:         blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

/* Heavy — modal overlays, fullscreen search */
.glass-heavy {
  background: rgba(8, 8, 8, 0.88);
  backdrop-filter:         blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
}

/* Brand-tinted — sale banners, notification bars */
.glass-brand {
  background: rgba(204, 0, 0, 0.08);
  backdrop-filter:         blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  border: 1px solid rgba(204, 0, 0, 0.18);
}

/* Gold-tinted — featured product highlights */
.glass-gold {
  background: rgba(201, 168, 76, 0.06);
  backdrop-filter:         blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(201, 168, 76, 0.14);
}

/* Surface-level — for cards inside sections */
.glass-surface {
  background: rgba(20, 20, 20, 0.65);
  backdrop-filter:         blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}


/* ── 33. Print ───────────────────────────────────────────── */

@media print {
  #site-header,
  #site-footer,
  .btn,
  .no-print { display: none !important; }

  body  { background: #fff; color: #000; }
  a     { color: #000; text-decoration: underline; }

  .gs-container { max-width: 100%; padding-inline: 0; }
}
