/* =============================================
   Variables
   ============================================= */

:root {
  /* Colors */
  --color-bg: #070a0d; /* deep charcoal */
  --color-surface: #10151b; /* card / panels */
  --color-surface-alt: #181f27;
  --color-text: #f5f7fa;
  --color-text-muted: #9aa4b2;

  --color-primary: #0f8ce8; /* electric blue */
  --color-primary-soft: rgba(15, 140, 232, 0.12);
  --color-primary-strong: #0b6bb3;

  --color-success: #19b27b;
  --color-warning: #f5a623;
  --color-danger: #f04438;

  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2933;
  --gray-900: #111827;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-heading: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-md: 1rem;      /* 16px */
  --font-size-lg: 1.125rem;  /* 18px */
  --font-size-xl: 1.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem;  /* 36px */

  --line-height-tight: 1.15;
  --line-height-snug: 1.3;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (0–96px) */
  --space-0: 0;
  --space-1: 0.125rem; /* 2px */
  --space-2: 0.25rem;  /* 4px */
  --space-3: 0.375rem; /* 6px */
  --space-4: 0.5rem;   /* 8px */
  --space-5: 0.625rem; /* 10px */
  --space-6: 0.75rem;  /* 12px */
  --space-8: 1rem;     /* 16px */
  --space-10: 1.25rem; /* 20px */
  --space-12: 1.5rem;  /* 24px */
  --space-16: 2rem;    /* 32px */
  --space-20: 2.5rem;  /* 40px */
  --space-24: 3rem;    /* 48px */
  --space-32: 4rem;    /* 64px */
  --space-40: 5rem;    /* 80px */
  --space-48: 6rem;    /* 96px */

  /* Radius */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 18px;
  --radius-pill: 999px;

  /* Shadows (subtle, layered, high-contrast for cards) */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.45);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-base: 180ms ease-out;
  --transition-slow: 260ms ease-out;

  /* Layout */
  --container-max-width: 1200px;
}

/* Reduced motion adjustments */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-base: 0ms;
    --transition-slow: 0ms;
  }
}


/* =============================================
   Reset / Normalize
   ============================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

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

button {
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

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

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure {
  margin: 0;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

textarea {
  resize: vertical;
}

:focus:not(:focus-visible) {
  outline: none;
}


/* =============================================
   Base Styles
   ============================================= */

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
 h2,
 h3,
 h4,
 h5,
 h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

h1 {
  font-size: var(--font-size-4xl);
  letter-spacing: 0.02em;
  margin-bottom: var(--space-16);
}

h2 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-12);
}

h3 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-8);
}

h4 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-6);
}

h5 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-4);
}

h6 {
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

p {
  margin-bottom: var(--space-8);
  color: var(--color-text-muted);
}

strong {
  font-weight: 600;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-base), opacity var(--transition-fast);
}

a:hover {
  color: var(--color-primary-strong);
}

a:active {
  opacity: 0.75;
}

code,
pre {
  font-family: var(--font-mono);
}

hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin: var(--space-16) 0;
}


/* =============================================
   Accessibility & Focus
   ============================================= */

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

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

.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;
}


/* =============================================
   Layout Utilities
   ============================================= */

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-16);
  padding-right: var(--space-16);
}

.container--wide {
  max-width: 1440px;
}

.flex {
  display: flex;
}

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

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-16);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-16);
}

.grid-auto-fit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-16);
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

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

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

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-8 { margin-top: var(--space-8); }
.mb-8 { margin-bottom: var(--space-8); }
.mt-16 { margin-top: var(--space-16); }
.mb-16 { margin-bottom: var(--space-16); }


/* =============================================
   Components
   ============================================= */

/* Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-strong));
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 140, 232, 0.4);
  transition:
    background var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    opacity var(--transition-fast);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 36px rgba(15, 140, 232, 0.55);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 18px rgba(15, 140, 232, 0.35);
}

.btn--secondary {
  background: rgba(255, 255, 255, 0.02);
  color: var(--color-text);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.btn--secondary:hover {
  background: rgba(255, 255, 255, 0.06);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text);
  border-color: transparent;
  box-shadow: none;
}

.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.04);
}

.btn--icon-only {
  padding-inline: var(--space-8);
  border-radius: var(--radius-pill);
}

.btn[disabled],
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}


/* Form Inputs */

.input,
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background-color: rgba(12, 16, 22, 0.96);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
}

.input::placeholder,
textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 0.7;
}

.input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary-soft), 0 12px 30px rgba(0, 0, 0, 0.6);
  outline: none;
}

.input[disabled],
select[disabled],
textarea[disabled] {
  background-color: rgba(17, 24, 39, 0.7);
  cursor: not-allowed;
  opacity: 0.7;
}

label {
  display: inline-block;
  margin-bottom: var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-text);
}

.form-field {
  margin-bottom: var(--space-12);
}

.form-error {
  margin-top: var(--space-4);
  font-size: var(--font-size-xs);
  color: var(--color-danger);
}


/* Card Component */

.card {
  position: relative;
  background: radial-gradient(circle at top left, rgba(15, 140, 232, 0.08), transparent 55%),
              radial-gradient(circle at bottom right, rgba(255, 255, 255, 0.05), transparent 55%),
              var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-16);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    border-color var(--transition-fast),
    background var(--transition-slow);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(15, 140, 232, 0.45);
}

.card--flat {
  box-shadow: none;
}

.card__header {
  margin-bottom: var(--space-12);
}

.card__title {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-4);
}

.card__subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.card__body {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.card__footer {
  margin-top: var(--space-12);
}


/* Badge / Pill (useful for new arrivals, top-rated) */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background-color: var(--color-primary-soft);
  color: var(--color-primary);
}

.badge--success {
  background-color: rgba(25, 178, 123, 0.16);
  color: var(--color-success);
}

.badge--warning {
  background-color: rgba(245, 166, 35, 0.18);
  color: var(--color-warning);
}

.badge--dark {
  background-color: rgba(15, 23, 42, 0.85);
  color: var(--color-text-muted);
}


/* Rating stars (basic baseline) */

.rating {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.9rem;
  color: #fbbf24; /* warm yellow */
}

.rating__count {
  margin-left: 4px;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}


/* Utility: subtle separators for sections */

.section {
  padding-top: var(--space-32);
  padding-bottom: var(--space-32);
}

.section--muted {
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.7), rgba(7, 10, 13, 1));
}

.section__header {
  margin-bottom: var(--space-20);
}

.section__title {
  font-size: var(--font-size-3xl);
}

.section__subtitle {
  margin-top: var(--space-4);
  max-width: 42rem;
  color: var(--color-text-muted);
}


/* Helper classes for automotive / product imagery */

.product-image {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: auto;
  transition: transform var(--transition-slow);
}

.product-image:hover img {
  transform: scale(1.04);
}
