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

:root {
  /* Color Palette - Industrial, Clean, Professional */
  --color-background: #0b1020;        /* Deep graphite/navy background */
  --color-surface: #111827;           /* Primary surface for cards/nav */
  --color-surface-alt: #1f2933;       /* Alternate surface / hover */
  --color-text: #e5e7eb;              /* Main text - light gray */
  --color-text-muted: #9ca3af;        /* Muted text / secondary */
  --color-border-subtle: #1f2933;     /* Subtle borders */
  --color-border-strong: #4b5563;     /* Stronger borders */

  --color-primary: #1d4ed8;           /* Industrial deep blue */
  --color-primary-soft: rgba(29, 78, 216, 0.1);
  --color-primary-strong: #1e40af;

  --color-accent: #f5b800;            /* Safety yellow accent */
  --color-accent-soft: rgba(245, 184, 0, 0.16);

  --color-success: #16a34a;           /* Green for success */
  --color-success-soft: rgba(22, 163, 74, 0.12);
  --color-warning: #f59e0b;           /* Amber for warnings */
  --color-warning-soft: rgba(245, 158, 11, 0.12);
  --color-danger: #dc2626;            /* Red for errors */
  --color-danger-soft: rgba(220, 38, 38, 0.12);

  --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",
    Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;

  /* Base font sizes (desktop, responsive scaling handled via clamp) */
  --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-normal: 1.5;
  --line-height-relaxed: 1.7;

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

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

  /* Shadows - subtle industrial depth */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.25);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.3);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.45);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-normal: 180ms ease-out;
  --transition-slow: 240ms ease-out;

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

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

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

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

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

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

body {
  min-height: 100vh;
}

ul[role="list"],
ol[role="list"] {
  list-style: none;
  margin: 0;
  padding: 0;
}

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

img {
  height: auto;
}

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

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

textarea {
  resize: vertical;
}

/* Remove default link styles for consistent base styling */
a {
  text-decoration: none;
  color: inherit;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  background-color: var(--color-background);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  display: block;
}

/* Headings: modern industrial hierarchy */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: var(--line-height-tight);
  color: var(--gray-50);
}

h1 {
  font-size: clamp(2.1rem, 2.3vw + 1.4rem, 2.6rem);
  margin-bottom: var(--space-4);
}

h2 {
  font-size: clamp(1.7rem, 1.6vw + 1.1rem, 2.1rem);
  margin-bottom: var(--space-3);
}

h3 {
  font-size: clamp(1.4rem, 1.1vw + 1rem, 1.7rem);
  margin-bottom: var(--space-3);
}

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

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.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

p {
  margin-bottom: var(--space-3);
  line-height: var(--line-height-relaxed);
  }

strong {
  font-weight: 600;
}

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

/* Links - understated with clear hover */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast),
    opacity var(--transition-fast),
    text-decoration-color var(--transition-fast);
}

a:hover {
  color: var(--color-accent);
}

a:active {
  opacity: 0.85;
}

/* Lists */
ul,
ol {
  margin: 0 0 var(--space-3) var(--space-5);
  padding: 0;
}

/* Horizontal rule */
hr {
  border: 0;
  border-top: 1px solid var(--color-border-subtle);
  margin: var(--space-6) 0;
}

/* ========================================================================== */
/*  Accessibility                                                             */
/* ========================================================================== */

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

:focus {
  outline: none;
}

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

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

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

/* Layout container for structured pages */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 1280px) {
  .container {
    padding-left: var(--space-6);
    padding-right: var(--space-6);
  }
}

/* Flex helpers */
.flex {
  display: flex;
}

.flex-row {
  flex-direction: row;
}

.flex-column {
  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;
}

.justify-end {
  justify-content: flex-end;
}

.gap-2 {
  gap: var(--space-2);
}

.gap-3 {
  gap: var(--space-3);
}

.gap-4 {
  gap: var(--space-4);
}

/* Grid helpers */
.grid {
  display: grid;
}

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

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

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

/* Text utilities */
.text-center {
  text-align: center;
}

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

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

/* Spacing utilities (margin/padding-y only for base cleanliness) */
.mt-4 {
  margin-top: var(--space-4);
}

.mb-4 {
  margin-bottom: var(--space-4);
}

.my-6 {
  margin-top: var(--space-6);
  margin-bottom: var(--space-6);
}

.py-4 {
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}

.py-6 {
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
}

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

/* Buttons - primary actions with safety accent hover */
.button,
button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 500;
  font-size: var(--font-size-sm);
  text-transform: none;
  letter-spacing: 0.02em;
  cursor: pointer;
  background: var(--color-primary);
  color: #f9fafb;
  box-shadow: var(--shadow-xs);
  transition: background-color var(--transition-normal),
    border-color var(--transition-normal),
    box-shadow var(--transition-normal),
    transform var(--transition-fast),
    color var(--transition-normal);
}

.button:hover,
button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover {
  background: var(--color-accent);
  color: #111827;
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.button:active,
button:active,
input[type="button"]:active,
input[type="submit"]:active,
input[type="reset"]:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

.button--secondary {
  background: transparent;
  color: var(--color-text)!important;
  border-color: var(--color-border-strong);
  box-shadow: none;
}

.button--secondary:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-accent);
}

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

.button--ghost:hover {
  background: rgba(15, 23, 42, 0.75);
  color: var(--color-text);
}

.button:disabled,
button:disabled,
input[type="button"]:disabled,
input[type="submit"]:disabled,
input[type="reset"]:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
  transform: none;
}

/* Form fields */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border-subtle);
  background-color: var(--color-surface);
  color: var(--color-text);
  line-height: 1.4;
  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);
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent-soft);
}

input[disabled],
select[disabled],
textarea[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}

/* Card - product / info blocks */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: var(--shadow-xs);
  padding: var(--space-4);
  transition: border-color var(--transition-normal),
    box-shadow var(--transition-normal),
    transform var(--transition-fast),
    background-color var(--transition-normal);
}

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

.card--interactive {
  cursor: pointer;
}

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

.card-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: var(--space-1);
}

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

.card-body {
  font-size: var(--font-size-sm);
}

.card-footer {
  margin-top: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--font-size-sm);
}

/* Tag / badge: technical data, categories */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: var(--color-text-muted);
  background: rgba(15, 23, 42, 0.85);
}

.tag--accent {
  border-color: transparent;
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.tag--success {
  border-color: transparent;
  background: var(--color-success-soft);
  color: var(--color-success);
}

.tag--danger {
  border-color: transparent;
  background: var(--color-danger-soft);
  color: var(--color-danger);
}

/* Simple badge for product availability */
.badge-dot {
  position: relative;
  padding-left: 0.9rem;
}

.badge-dot::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background-color: var(--color-success);
  transform: translateY(-50%);
}

.badge-dot--danger::before {
  background-color: var(--color-danger);
}

/* Helper: subtle section background bands */
.section-band {
  background: radial-gradient(circle at top left, rgba(245, 184, 0, 0.06), transparent 55%),
    radial-gradient(circle at bottom right, rgba(15, 23, 42, 0.85), transparent 60%),
    var(--color-background);
}

/* Tables for technical specs */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}

.table th,
.table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.table th {
  text-align: left;
  font-weight: 500;
  color: var(--color-text-muted);
  background-color: rgba(15, 23, 42, 0.85);
}

.table--dense th,
.table--dense td {
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

/* Messages / alerts */
.alert {
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  border: 1px solid transparent;
  font-size: var(--font-size-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.alert--success {
  background: var(--color-success-soft);
  border-color: rgba(22, 163, 74, 0.4);
  color: var(--color-success);
}

.alert--warning {
  background: var(--color-warning-soft);
  border-color: rgba(245, 158, 11, 0.4);
  color: var(--color-warning);
}

.alert--danger {
  background: var(--color-danger-soft);
  border-color: rgba(220, 38, 38, 0.4);
  color: var(--color-danger);
}

/* End of base.css */
