/* ===========================================================================
 * Apex Tyres — Global Design System
 * ===========================================================================
 * Dark automotive theme — charcoal base + neon green (#39FF14) accent.
 * Fonts: Barlow Condensed (display) + Inter (body).
 *
 * Table of Contents:
 *   1.  CSS Custom Properties (Design Tokens)
 *   2.  Reset & Base
 *   3.  Typography
 *   4.  Layout Utilities
 *   5.  Grid System
 *   6.  Buttons
 *   7.  Forms
 *   8.  Cards
 *   9.  Header & Navigation
 *  10.  Announcement Bar
 *  11.  Footer
 *  12.  Flash / Toast Messages
 *  13.  Sidebar
 *  14.  Cart Drawer
 *  15.  Animations
 *  16.  Background Patterns & Gradients
 *  17.  Responsive Rules
 * =========================================================================== */

/* ── 1. CSS Custom Properties ─────────────────────────────────────────── */
:root {
  /* Radius scale */
  --radius: 0.5rem;
  --radius-sm: calc(var(--radius) - 4px);
  --radius-md: calc(var(--radius) - 2px);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) + 4px);
  --radius-2xl: calc(var(--radius) + 8px);
  --radius-3xl: calc(var(--radius) + 12px);
  --radius-4xl: calc(var(--radius) + 16px);

  /* Typography */
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: "Barlow Condensed", "Inter", ui-sans-serif, system-ui, sans-serif;

  /* Core palette — dark theme */
  --bg:         #2b2d2e;
  --fg:         #f4f4f5;
  --carbon:     #232526;
  --surface:    #333538;
  --card:       #333538;
  --card-fg:    #f4f4f5;
  --popover:    #333538;
  --popover-fg: #f4f4f5;

  /* Primary — neon green */
  --primary:        #39FF14;
  --primary-glow:   #5eff3e;
  --primary-fg:     #0f0f0f;
  --primary-dim:    rgba(57, 255, 20, 0.15);
  --primary-medium: rgba(57, 255, 20, 0.35);

  /* Secondary */
  --secondary:       #3a3c3f;
  --secondary-fg:    #f4f4f5;

  /* Muted */
  --muted:           #35373a;
  --muted-fg:        #a1a1aa;

  /* Accent (same as primary for consistency) */
  --accent:          var(--primary);
  --accent-fg:       var(--primary-fg);

  /* Destructive */
  --destructive:       #e74c3c;
  --destructive-fg:    #fafafa;

  /* Borders & inputs */
  --border:      rgba(255, 255, 255, 0.12);
  --input:       rgba(255, 255, 255, 0.14);
  --ring:        var(--primary);
  --ring-offset: var(--bg);

  /* Shadows */
  --shadow-glow:        0 0 40px -8px rgba(57, 255, 20, 0.5);
  --shadow-glow-strong: 0 0 80px -10px rgba(57, 255, 20, 0.6);
  --shadow-elegant:     0 20px 60px -20px rgba(0, 0, 0, 0.5);
  --shadow-card:        0 4px 24px -8px rgba(0, 0, 0, 0.35);
  --shadow-nav:         0 4px 24px -12px rgba(0, 0, 0, 0.5);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-glow) 100%);
  --gradient-radial:  radial-gradient(ellipse at top, rgba(57,255,20,0.18), transparent 60%);
  --gradient-hero:    linear-gradient(180deg, rgba(43,45,46,0.3) 0%, rgba(43,45,46,0.85) 100%);

  /* Transitions */
  --transition-fast:  150ms ease;
  --transition-base:  300ms ease;
  --transition-slow:  500ms ease;

  /* Z-index scale */
  --z-dropdown:  100;
  --z-sticky:    200;
  --z-overlay:   300;
  --z-modal:     400;
  --z-toast:     500;
}

/* ── Skip Navigation ──────────────────────────────────────────────────── */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.75rem 1.25rem;
  background: var(--primary);
  color: var(--primary-fg);
  font-weight: 700;
  font-size: 0.9375rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-nav:focus {
  top: 0.75rem;
}

/* ── 2. Reset & Base ──────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  border-color: var(--border);
}

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

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
  padding: 0;
  margin: 0;
}

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

::selection {
  background: var(--primary);
  color: var(--primary-fg);
}

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

/* Screen reader only */
.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;
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* ── 3. Typography ────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 0 0 0.5em;
  text-transform: uppercase;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin: 0 0 1em;
  color: var(--muted-fg);
}

.text-sm    { font-size: 0.875rem; }
.text-xs    { font-size: 0.75rem; }
.text-lg    { font-size: 1.125rem; }
.text-xl    { font-size: 1.25rem; }
.text-2xl   { font-size: 1.5rem; }
.text-3xl   { font-size: 1.875rem; }

.font-bold      { font-weight: 700; }
.font-semibold  { font-weight: 600; }
.font-medium    { font-weight: 500; }

.text-center    { text-align: center; }
.text-left      { text-align: left; }
.text-right     { text-align: right; }

.uppercase      { text-transform: uppercase; }

.text-muted     { color: var(--muted-fg); }
.text-primary   { color: var(--primary); }
.text-white     { color: #fff; }

.heading-display {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 0.95;
  text-transform: uppercase;
}

.text-gradient-primary {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ── 4. Layout Utilities ──────────────────────────────────────────────── */
.container-page {
  width: 100%;
  max-width: 80rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 768px) {
  .container-page { padding-inline: 2rem; }
}

.section {
  position: relative;
  padding-block: clamp(3rem, 6vw, 5rem);
}

.section-sm { padding-block: clamp(1.5rem, 3vw, 2.5rem); }
.section-lg { padding-block: clamp(4rem, 8vw, 6rem); }

.py-8  { padding-block: 2rem; }
.py-12 { padding-block: 3rem; }
.py-16 { padding-block: 4rem; }
.py-20 { padding-block: 5rem; }
.py-24 { padding-block: 6rem; }
.py-32 { padding-block: 8rem; }

.px-4  { padding-inline: 1rem; }
.px-6  { padding-inline: 1.5rem; }
.px-8  { padding-inline: 2rem; }

.py-4  { padding-block: 1rem; }
.py-2  { padding-block: 0.5rem; }

.mb-4  { margin-bottom: 1rem; }
.mb-6  { margin-bottom: 1.5rem; }
.mb-8  { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.mb-16 { margin-bottom: 4rem; }
.mt-4  { margin-top: 1rem; }
.mt-8  { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }

.mx-auto { margin-inline: auto; }

.gap-4  { gap: 1rem; }
.gap-6  { gap: 1.5rem; }
.gap-8  { gap: 2rem; }
.gap-12 { gap: 3rem; }

.relative { position: relative; }
.absolute { position: absolute; }
.inset-0  { inset: 0; }
.-z-10    { z-index: -10; }
.z-10     { z-index: 10; }
.z-50     { z-index: var(--z-sticky); }

.overflow-hidden { overflow: hidden; }
.isolate         { isolation: isolate; }

.flex           { display: flex; }
.inline-flex    { display: inline-flex; }
.flex-col       { flex-direction: column; }
.flex-wrap      { flex-wrap: wrap; }
.items-center   { align-items: center; }
.items-start    { align-items: flex-start; }
.items-end      { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between{ justify-content: space-between; }
.flex-1         { flex: 1; }
.flex-shrink-0  { flex-shrink: 0; }

.block        { display: block; }
.inline-block { display: inline-block; }

.w-full   { width: 100%; }
.h-full   { height: 100%; }
.min-h-screen { min-height: 100vh; }

.object-cover       { object-fit: cover; }
.object-center      { object-position: center; }
.object-top         { object-position: top; }

.rounded-sm  { border-radius: var(--radius-sm); }
.rounded     { border-radius: var(--radius); }
.rounded-md  { border-radius: var(--radius-md); }
.rounded-lg  { border-radius: var(--radius-lg); }
.rounded-xl  { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full{ border-radius: 9999px; }

.border        { border: 1px solid var(--border); }
.border-t      { border-top: 1px solid var(--border); }
.border-b      { border-bottom: 1px solid var(--border); }
.border-primary { border-color: var(--primary); }

.whitespace-nowrap { white-space: nowrap; }

/* ── 5. Grid System ───────────────────────────────────────────────────── */
.grid { display: grid; }

.grid-cols-1  { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2  { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3  { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4  { grid-template-columns: repeat(4, 1fr); }

@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .md\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
  .lg\:grid-cols-5 { grid-template-columns: repeat(5, 1fr); }
}

/* ── 6. Buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
}

.btn:active { transform: scale(0.97); }

/* Sizes */
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8125rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1.0625rem; }
.btn-xl { padding: 1.125rem 2.5rem; font-size: 1.125rem; }

.btn-block { width: 100%; }

/* Variants */
.btn-primary {
  background: var(--gradient-primary);
  color: var(--primary-fg);
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  box-shadow: var(--shadow-glow-strong);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0) scale(0.97);
  box-shadow: var(--shadow-glow);
}

.btn-outline {
  background: transparent;
  color: var(--fg);
  border-color: var(--border);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-dim);
}

.btn-ghost {
  background: transparent;
  color: var(--muted-fg);
  border-color: transparent;
}

.btn-ghost:hover {
  color: var(--fg);
  background: rgba(255,255,255,0.06);
}

.btn-ghost.active {
  color: var(--primary);
  background: var(--primary-dim);
}

.btn-destructive {
  background: var(--destructive);
  color: var(--destructive-fg);
}
.btn-destructive:hover { filter: brightness(1.15); }

.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn .btn-icon { width: 1.125em; height: 1.125em; flex-shrink: 0; }

/* ── 7. Forms ─────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 0.375rem;
}

.input,
.textarea,
.select {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--input);
  border-radius: var(--radius);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input::placeholder,
.textarea::placeholder { color: var(--muted-fg); }

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.input.error,
.textarea.error,
.select.error {
  border-color: var(--destructive);
}

.textarea {
  min-height: 120px;
  resize: vertical;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23a1a1aa' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
}

.checkbox,
.radio {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--primary);
  margin-right: 0.5rem;
}

.form-error {
  font-size: 0.8125rem;
  color: var(--destructive);
  margin-top: 0.25rem;
}

.form-hint {
  font-size: 0.8125rem;
  color: var(--muted-fg);
  margin-top: 0.25rem;
}

/* Newsletter inline form */
.newsletter-inline {
  display: flex;
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.newsletter-inline .input {
  border: none;
  border-radius: 0;
  flex: 1;
}

.newsletter-inline .btn {
  border-radius: 0;
  flex-shrink: 0;
}

/* ── 8. Cards ─────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  color: var(--card-fg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-base);
}

.card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-card);
  transform: translateY(-2px);
}

.card-body { padding: 1.25rem; }
.card-header { padding: 1.25rem 1.25rem 0; }
.card-footer { padding: 0 1.25rem 1.25rem; }

.card-image {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.375rem;
  text-transform: uppercase;
}

.card-text {
  font-size: 0.875rem;
  color: var(--muted-fg);
  margin: 0;
}

.card-price {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--primary);
}

/* ── 9. Header & Navigation ───────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  transition: background var(--transition-base), border var(--transition-base);
}

.site-header.scrolled {
  background: rgba(43, 45, 46, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  box-shadow: var(--shadow-nav);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 4rem;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--fg);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

.header-logo .logo-icon {
  width: 2.25rem;
  height: 2.25rem;
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Shop button — visible on md+ only */
.header-shop-btn {
  display: none;
}

@media (min-width: 768px) {
  .header-shop-btn {
    display: inline-flex;
  }
}

/* Phone CTA — visible on sm+ only */
.header-phone {
  display: none;
}

@media (min-width: 640px) {
  .header-phone {
    display: inline-flex;
  }
}

/* Desktop Navigation */
.main-nav { display: flex; align-items: center; }

.nav-list {
  display: none; /* hidden on mobile by default */
  align-items: center;
  gap: 0.25rem;
}

@media (min-width: 1024px) {
  .nav-list { display: flex; }
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-fg);
  border-radius: var(--radius);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
  color: var(--fg);
  background: rgba(255,255,255,0.06);
}

.nav-link.active { color: var(--primary); }

.nav-chevron {
  width: 0.875rem;
  height: 0.875rem;
  transition: transform var(--transition-fast);
}

/* Dropdown / Mega Menu */
.has-dropdown { position: relative; }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elegant);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
  z-index: var(--z-dropdown);
}

.has-dropdown:hover .nav-dropdown,
.has-dropdown:focus-within .nav-dropdown {
  opacity: 1;
  visibility: visible;
}

.dropdown-inner {
  padding: 0.5rem;
}

.dropdown-link {
  display: block;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: var(--muted-fg);
  border-radius: var(--radius);
  transition: all var(--transition-fast);
}

.dropdown-link:hover {
  color: var(--fg);
  background: rgba(255,255,255,0.06);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--fg);
  border-radius: var(--radius);
  transition: background var(--transition-fast);
}

.mobile-menu-toggle:hover { background: rgba(255,255,255,0.06); }

@media (min-width: 1024px) {
  .mobile-menu-toggle { display: none; }
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  top: 4rem;
  z-index: var(--z-overlay);
  background: var(--bg);
  overflow-y: auto;
  padding: 1.5rem;
}

.mobile-menu-overlay.hidden {
  display: none;
}

.mobile-link {
  display: block;
  padding: 0.875rem 0.5rem;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--muted-fg);
  border-bottom: 1px solid var(--border);
  transition: color var(--transition-fast);
}

.mobile-link:hover,
.mobile-link.active {
  color: var(--primary);
}

/* Mobile Accordion */
.mobile-accordion { border-bottom: 1px solid var(--border); }

.mobile-accordion-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.875rem 0.5rem;
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--muted-fg);
  transition: color var(--transition-fast);
}

.mobile-accordion-toggle:hover { color: var(--fg); }

.mobile-accordion-toggle svg {
  transition: transform var(--transition-fast);
}

.mobile-accordion-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.mobile-accordion-content {
  padding: 0 0 0.75rem 1rem;
}

.mobile-accordion-content.hidden { display: none; }

.mobile-sub-link {
  display: block;
  padding: 0.5rem 0;
  font-size: 0.9375rem;
  color: var(--muted-fg);
  transition: color var(--transition-fast);
}

.mobile-sub-link:hover { color: var(--primary); }

.mobile-cta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.875rem 0.5rem;
  font-weight: 600;
  color: var(--primary);
  border-top: 1px solid var(--border);
}

/* Cart badge */
.cart-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 1.125rem;
  height: 1.125rem;
  padding: 0 0.25rem;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--primary-fg);
  background: var(--primary);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-badge.hidden { display: none; }

.header-cart { position: relative; }

/* ── 10. Announcement Bar ─────────────────────────────────────────────── */
.announcement-bar {
  background: var(--carbon);
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--muted-fg);
}

.announcement-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.375rem;
  gap: 0.75rem;
}

.announcement-inner a {
  color: var(--fg);
  font-weight: 500;
}

.announcement-inner a:hover { color: var(--primary); }

.announcement-text {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
}

.announcement-text svg { color: var(--primary); }

.announcement-slogan {
  display: none;
  margin: 0;
  color: var(--muted-fg);
}

@media (min-width: 640px) {
  .announcement-slogan { display: block; }
}

/* ── 11. Footer ───────────────────────────────────────────────────────── */
.site-footer {
  background: var(--carbon);
  border-top: 1px solid var(--border);
  padding-top: clamp(2.5rem, 5vw, 4rem);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding-bottom: 2.5rem;
}

.footer-col { min-width: 0; }

.footer-heading {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.footer-about-text {
  font-size: 0.875rem;
  color: var(--muted-fg);
  max-width: 28ch;
  margin-bottom: 1rem;
}

.footer-links-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }

.footer-links-list a,
.footer-contact-list a {
  font-size: 0.875rem;
  color: var(--muted-fg);
  transition: color var(--transition-fast);
}

.footer-links-list a:hover,
.footer-contact-list a:hover { color: var(--primary); }

.footer-contact-list { display: flex; flex-direction: column; gap: 0.75rem; }

.footer-contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  font-size: 0.875rem;
  color: var(--muted-fg);
}

.footer-contact-list svg {
  flex-shrink: 0;
  margin-top: 0.2em;
  color: var(--primary);
}

.footer-social {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  color: var(--muted-fg);
  border-radius: var(--radius);
  transition: all var(--transition-fast);
}

.social-link:hover {
  color: var(--primary);
  background: var(--primary-dim);
}

/* Footer Newsletter */
.footer-newsletter {
  display: flex;
  margin-top: 1rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.footer-newsletter-input {
  flex: 1;
  min-width: 0;
  padding: 0.625rem 0.875rem;
  font-size: 0.8125rem;
  color: var(--fg);
  background: var(--surface);
  border: none;
  outline: none;
}

.footer-newsletter-input::placeholder { color: var(--muted-fg); }

.footer-newsletter-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.875rem;
  background: var(--primary);
  color: var(--primary-fg);
  border: none;
  transition: background var(--transition-fast);
}

.footer-newsletter-btn:hover { filter: brightness(1.1); }

/* Footer Bottom */
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-block: 1.25rem;
}

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

@media (min-width: 640px) {
  .footer-bottom-inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-copy {
  font-size: 0.8125rem;
  color: var(--muted-fg);
  margin: 0;
}

.footer-payments {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.payment-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--muted-fg);
  padding: 0.25rem 0.5rem;
  background: var(--surface);
  border-radius: var(--radius-sm);
}

/* Responsive footer grid */
@media (min-width: 768px) {
  .footer-inner {
    grid-template-columns: 1.2fr 1fr 1fr;
  }
}

/* ── 12. Flash / Toast Messages ───────────────────────────────────────── */
.flash-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 24rem;
}

.flash-toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-elegant);
  animation: slide-in-right 0.3s ease;
}

.flash-success {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--surface));
}

.flash-error {
  border-color: var(--destructive);
  background: color-mix(in srgb, var(--destructive) 10%, var(--surface));
}

.flash-message {
  font-size: 0.875rem;
  flex: 1;
}

.flash-close {
  flex-shrink: 0;
  color: var(--muted-fg);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
}

.flash-close:hover { background: rgba(255,255,255,0.1); }

/* ── 13. Sidebar ──────────────────────────────────────────────────────── */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.sidebar-section {
  padding: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.sidebar-title {
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
  color: var(--fg);
}

.sidebar-filter-list { display: flex; flex-direction: column; gap: 0.25rem; }

.sidebar-filter-link {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--muted-fg);
  border-radius: var(--radius);
  transition: all var(--transition-fast);
}

.sidebar-filter-link:hover {
  color: var(--fg);
  background: rgba(255,255,255,0.06);
}

.sidebar-filter-link.active {
  color: var(--primary);
  background: var(--primary-dim);
}

/* Tyre Finder */
.tyre-finder { display: flex; flex-direction: column; gap: 0.75rem; }

.finder-group { display: flex; flex-direction: column; gap: 0.25rem; }

.finder-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-fg);
  text-transform: uppercase;
}

.finder-select {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--input);
  border-radius: var(--radius);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%23a1a1aa' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  padding-right: 2rem;
}

.finder-select:focus { outline: none; border-color: var(--primary); }

.finder-btn { margin-top: 0.5rem; }

/* Price Range Filter */
.price-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.price-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--input);
  border-radius: var(--radius);
  text-align: center;
}

.price-input:focus { outline: none; border-color: var(--primary); }

.price-separator { color: var(--muted-fg); flex-shrink: 0; }

/* Admin sidebar nav */
.sidebar-nav { display: flex; flex-direction: column; gap: 0.125rem; }

.sidebar-nav-link {
  display: block;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  color: var(--muted-fg);
  border-radius: var(--radius);
  transition: all var(--transition-fast);
}

.sidebar-nav-link:hover {
  color: var(--fg);
  background: rgba(255,255,255,0.06);
}

.sidebar-nav-link.active {
  color: var(--primary);
  background: var(--primary-dim);
}

/* ── 14. Cart Drawer ──────────────────────────────────────────────────── */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(100%, 28rem);
  z-index: var(--z-modal);
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-elegant);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-base);
}

.cart-drawer.open { transform: translateX(0); }

.cart-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) - 1);
  background: rgba(0,0,0,0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

.cart-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.cart-drawer-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--border);
}

.cart-item {
  display: flex;
  gap: 1rem;
  padding-block: 1rem;
  border-bottom: 1px solid var(--border);
}

.cart-item:first-child { padding-top: 0; }

.cart-item-image {
  width: 5rem;
  height: 5rem;
  border-radius: var(--radius);
  object-fit: cover;
  flex-shrink: 0;
}

.cart-item-body { flex: 1; min-width: 0; }

.cart-item-title {
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.cart-item-price {
  font-size: 0.875rem;
  color: var(--primary);
  font-weight: 700;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.5rem;
}

.qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  transition: all var(--transition-fast);
}

.qty-btn:hover {
  border-color: var(--primary);
  background: var(--primary-dim);
}

.qty-value {
  min-width: 2rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--muted-fg);
}

.cart-empty svg { opacity: 0.5; }

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  padding-block: 0.5rem;
  font-size: 0.9375rem;
}

.cart-summary-row.total {
  font-weight: 700;
  font-size: 1.125rem;
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
}

/* ── 15. Animations ───────────────────────────────────────────────────── */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fade-in-down {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes count-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: var(--shadow-glow); }
  50%      { box-shadow: var(--shadow-glow-strong); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.animate-fade-in-up   { animation: fade-in-up 0.6s ease both; }
.animate-fade-in      { animation: fade-in 0.4s ease both; }
.animate-fade-in-down { animation: fade-in-down 0.4s ease both; }
.animate-glow-pulse   { animation: glow-pulse 3s ease-in-out infinite; }
.animate-spin         { animation: spin 1s linear infinite; }

/* Stagger children */
.stagger-children > * { opacity: 0; animation: fade-in-up 0.5s ease forwards; }

.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }

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

/* ── 16. Background Patterns & Gradients ──────────────────────────────── */
.bg-carbon  { background-color: var(--carbon); }
.bg-surface { background-color: var(--surface); }
.bg-muted   { background-color: var(--muted); }

.bg-primary-dim { background: var(--primary-dim); }

.bg-gradient-radial { background: var(--gradient-radial); }

.bg-grid {
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 48px 48px;
}

.gradient-overlay-dark {
  background: linear-gradient(180deg,
    rgba(43,45,46,0.3) 0%,
    rgba(43,45,46,0.85) 100%);
}

.gradient-overlay-side {
  background: linear-gradient(90deg,
    rgba(43,45,46,0.85) 0%,
    rgba(43,45,46,0.5) 50%,
    rgba(43,45,46,0.1) 100%);
}

.gradient-overlay-bottom {
  background: linear-gradient(0deg,
    rgba(43,45,46,0.8) 0%,
    rgba(43,45,46,0.15) 50%,
    transparent 100%);
}

.shadow-glow        { box-shadow: var(--shadow-glow); }
.shadow-glow-strong { box-shadow: var(--shadow-glow-strong); }
.shadow-elegant     { box-shadow: var(--shadow-elegant); }

.backdrop-blur { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

/* ── 17. Responsive Visibility ────────────────────────────────────────── */
@media (max-width: 639px)  { .hidden-mobile  { display: none !important; } }
@media (min-width: 640px)  { .sm\:hidden     { display: none !important; } .sm\:flex { display: flex !important; } .sm\:block { display: block !important; } }
@media (min-width: 768px)  { .md\:hidden     { display: none !important; } .md\:flex { display: flex !important; } .md\:block { display: block !important; } }
@media (min-width: 1024px) { .lg\:hidden     { display: none !important; } .lg\:flex { display: flex !important; } .lg\:block { display: block !important; } }

/* ── Divider ──────────────────────────────────────────────────────────── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin-block: 1.5rem;
}

/* ── Badge / Tag ──────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2em 0.6em;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  background: var(--primary-dim);
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted-fg);
}

/* ── Skeleton / Loading ───────────────────────────────────────────────── */
.skeleton {
  background: var(--muted);
  border-radius: var(--radius);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* ── Aspect Ratio ─────────────────────────────────────────────────────── */
.aspect-video { aspect-ratio: 16/9; }
.aspect-square { aspect-ratio: 1/1; }
.aspect-4-3   { aspect-ratio: 4/3; }

/* ── Tooltip ──────────────────────────────────────────────────────────── */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
  white-space: nowrap;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}

[data-tooltip]:hover::after { opacity: 1; }

/* ── Focus Ring Utility ───────────────────────────────────────────────── */
.focus-ring:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* ── Truncate ─────────────────────────────────────────────────────────── */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Image overrides ──────────────────────────────────────────────────── */
.img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-contain {
  width: 100%;
  height: 100%;
  object-fit: contain;
}