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

:root {
  /* Colors */
  --color-background: #060816;
  --color-surface: #0b0f1f;
  --color-surface-alt: #101529;
  --color-text: #f5f7ff;
  --color-text-muted: #a3acc7;
  --color-primary: #2f7df6;
  --color-primary-soft: rgba(47, 125, 246, 0.14);
  --color-primary-strong: #1a5ec4;
  --color-success: #24c38e;
  --color-warning: #ffb74a;
  --color-danger: #ff4f5e;

  --color-gray-50: #f7f8fc;
  --color-gray-100: #e4e7f5;
  --color-gray-200: #cfd3e6;
  --color-gray-300: #b3bad3;
  --color-gray-400: #8a93b2;
  --color-gray-500: #6b7390;
  --color-gray-600: #4b526b;
  --color-gray-700: #363b4d;
  --color-gray-800: #252838;
  --color-gray-900: #151827;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", 
    "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", 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.2;
  --line-height-snug: 1.35;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (px) */
  --space-0: 0;
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 6px;
  --space-4: 8px;
  --space-5: 10px;
  --space-6: 12px;
  --space-8: 16px;
  --space-10: 20px;
  --space-12: 24px;
  --space-14: 28px;
  --space-16: 32px;
  --space-20: 40px;
  --space-24: 48px;
  --space-32: 64px;
  --space-40: 80px;
  --space-48: 96px;

  /* Radius */
  --radius-xs: 3px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Shadows */
  --shadow-soft: 0 14px 40px rgba(6, 8, 22, 0.6);
  --shadow-elevated: 0 20px 60px rgba(2, 6, 23, 0.85);
  --shadow-subtle: 0 1px 3px rgba(15, 23, 42, 0.55);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-normal: 200ms ease-out;
  --transition-slow: 320ms ease-out;

  /* Layout */
  --layout-max-width: 1120px;
  --layout-gutter: 20px;
}

/* Respect user color scheme if needed (hook for future theming) */
@media (prefers-color-scheme: light) {
  :root[data-theme="light"] {
    --color-background: #f8fafc;
    --color-surface: #ffffff;
    --color-surface-alt: #f1f5f9;
    --color-text: #0f172a;
    --color-text-muted: #64748b;
    --color-gray-900: #020617;
  }
}

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

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

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

body {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
ol,
ul,
dl,
dd {
  margin: 0;
}

ol,
ul {
  padding-left: 1.25rem;
}

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

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

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

/* Remove default link underlines and colors (we'll style below) */
a {
  color: inherit;
  text-decoration: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

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

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  background: radial-gradient(circle at top left, #111827 0, #020617 50%, #000 100%);
  color: var(--color-text);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

#root,
.app-root {
  min-height: 100vh;
}

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: var(--line-height-tight);
  letter-spacing: 0.01em;
  color: var(--color-text);
}

h1 {
  font-size: clamp(2.25rem, 3vw + 1rem, 3.25rem);
  margin-bottom: var(--space-8);
}

h2 {
  font-size: clamp(1.75rem, 2.3vw + 0.75rem, 2.25rem);
  margin-bottom: var(--space-6);
}

h3 {
  font-size: clamp(1.4rem, 1.4vw + 0.8rem, 1.75rem);
  margin-bottom: var(--space-4);
}

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

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

h6 {
  font-size: var(--font-size-md);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

/* Paragraphs */
p {
  margin-bottom: var(--space-6);
  color: var(--color-text-muted);
  }

p:last-child {
  margin-bottom: 0;
}

/* Links */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-normal),
    opacity var(--transition-fast),
    text-shadow var(--transition-normal);
}

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

a:active {
  opacity: 0.85;
}

/* Code / preformatted */
code,
pre {
  font-family: var(--font-mono);
}

pre {
  padding: var(--space-6);
  border-radius: var(--radius-md);
  background: #020617;
  overflow-x: auto;
}

/* ==========================================================================   
   Accessibility & Motion
   ========================================================================== */

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

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

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

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

/* Layout container */
.container {
  width: 100%;
  max-width: calc(var(--layout-max-width) + var(--layout-gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--layout-gutter);
}

.container-wide {
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding-inline: var(--layout-gutter);
}

/* Flex helpers */
.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 helpers */
.grid {
  display: grid;
}

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

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

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

/* Spacing utilities (subset for common use) */
.mt-0 { margin-top: 0 !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mt-8 { margin-top: var(--space-8) !important; }
.mt-16 { margin-top: var(--space-16) !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.mb-8 { margin-bottom: var(--space-8) !important; }
.mb-16 { margin-bottom: var(--space-16) !important; }
.py-8 { padding-block: var(--space-8) !important; }
.py-16 { padding-block: var(--space-16) !important; }
.px-8 { padding-inline: var(--space-8) !important; }

/* Text utilities */
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-muted { color: var(--color-text-muted) !important; }

/* 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;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background-color var(--transition-normal),
    color var(--transition-normal),
    border-color var(--transition-normal),
    box-shadow var(--transition-normal),
    transform var(--transition-fast);
  background-image: linear-gradient(135deg, #1f2937 0, #020617 100%);
  color: var(--color-text);
  box-shadow: var(--shadow-subtle);
}

.btn-primary {
  background-image: linear-gradient(135deg, #2f7df6 0, #1a5ec4 50%, #22c1f1 100%);
  border-color: rgba(148, 163, 255, 0.4);
  color: #f9fafb;
}

.btn-outline {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(148, 163, 255, 0.4);
  color: var(--color-text);
}

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

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: var(--font-size-xs);
}

.btn-lg {
  padding: 0.9rem 1.5rem;
  font-size: var(--font-size-md);
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.05);
}

.btn-outline:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.9);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.7);
  color: var(--color-text);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: none;
}

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

.btn-icon {
  padding: 0.35rem;
  border-radius: 999px;
  width: 2.25rem;
  height: 2.25rem;
}

/* Inputs & form controls */
.input,
select,
textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(15, 23, 42, 0.8);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  line-height: 1.4;
  transition: border-color var(--transition-normal),
    box-shadow var(--transition-normal),
    background-color var(--transition-fast);
}

.input::placeholder,
textarea::placeholder {
  color: var(--color-gray-400);
}

.input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: rgba(59, 130, 246, 0.85);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.85), 0 18px 45px rgba(15, 23, 42, 0.9);
  background: rgba(15, 23, 42, 0.98);
}

.input[aria-invalid="true"],
.input--error {
  border-color: rgba(248, 113, 113, 0.9);
}

.field-label {
  display: block;
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.field-helper {
  margin-top: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

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

/* Cards */
.card {
  position: relative;
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(148, 163, 255, 0.18), transparent 40%),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.18), transparent 55%),
    linear-gradient(135deg, #020617, #020617 50%, #020617 100%);
  border: 1px solid rgba(148, 163, 255, 0.15);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(24px);
}

.card--elevated {
  box-shadow: var(--shadow-elevated);
}

.card-header {
  margin-bottom: var(--space-6);
}

.card-title {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-2);
}

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

.card-footer {
  margin-top: var(--space-6);
}

/* Tag / pill (useful for filters, promotions) */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border: 1px solid rgba(148, 163, 255, 0.35);
  background: rgba(15, 23, 42, 0.8);
  color: var(--color-text-muted);
}

.tag--success {
  border-color: rgba(34, 197, 94, 0.65);
  color: #bbf7d0;
}

.tag--danger {
  border-color: rgba(248, 113, 113, 0.8);
  color: #fecaca;
}

/* Badges for promotions */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(34, 197, 94, 0.18);
  color: #bbf7d0;
}

.badge--promo {
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
}

.badge--warning {
  background: rgba(251, 191, 36, 0.18);
  color: #fef3c7;
}

/* Panels for warranty, delivery info blocks */
.info-panel {
  padding: var(--space-6);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 255, 0.15);
}

.info-panel--highlight {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(56, 189, 248, 0.5);
}

/* Promo banner shell */
.promo-banner {
  position: relative;
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.25), transparent 55%),
    radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.28), transparent 55%),
    #020617;
  overflow: hidden;
}

.promo-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.1) 0, transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(91, 33, 182, 0.4) 0, transparent 55%);
  opacity: 0.08;
  pointer-events: none;
}

.promo-banner-content {
  position: relative;
  z-index: 1;
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.breadcrumbs a {
  color: var(--color-text-muted);
}

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

.breadcrumbs-separator {
  opacity: 0.6;
}

/* Simple chip filter tokens */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  cursor: pointer;
  background: rgba(15, 23, 42, 0.8);
  transition: background-color var(--transition-normal),
    color var(--transition-normal),
    border-color var(--transition-normal),
    transform var(--transition-fast);
}

.chip:hover {
  border-color: rgba(59, 130, 246, 0.7);
  color: var(--color-text);
}

.chip--active {
  border-color: rgba(59, 130, 246, 0.9);
  background: rgba(37, 99, 235, 0.22);
  color: var(--color-text);
}

/* Toast / inline notification */
.alert {
  padding: var(--space-6);
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  font-size: var(--font-size-sm);
  border: 1px solid transparent;
}

.alert--success {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(34, 197, 94, 0.6);
  color: #bbf7d0;
}

.alert--warning {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.7);
  color: #fef3c7;
}

.alert--danger {
  background: rgba(248, 113, 113, 0.16);
  border-color: rgba(248, 113, 113, 0.85);
  color: #fee2e2;
}

/* Simple badge for stock state */
.stock-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.stock-indicator-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: var(--color-success);
}

.stock-indicator--low .stock-indicator-dot {
  background: var(--color-warning);
}

.stock-indicator--out .stock-indicator-dot {
  background: var(--color-danger);
}

/* End of base.css */
