/*
 * Base CSS for modern Dutch-language e-commerce site
 * Style: modern, minimalist, professional, blue-and-white
 * Sections: Variables, Reset, Base, Utilities, Components, Accessibility
 */

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

:root {
  /* Color palette */
  --color-bg: #f5f7fb;
  --color-surface: #ffffff;
  --color-text: #111827;
  --color-text-muted: #6b7280;

  --color-primary: #2563eb; /* Blue */
  --color-primary-soft: #e0edff;
  --color-primary-strong: #1d4ed8;

  --color-success: #16a34a;
  --color-warning: #f59e0b;
  --color-danger: #dc2626;

  /* Neutral grays */
  --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-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-base: 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 (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-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-pill: 9999px;

  /* Shadows (subtle for professional feel) */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.03);
  --shadow-md: 0 4px 6px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 15px rgba(15, 23, 42, 0.12), 0 4px 6px rgba(15, 23, 42, 0.08);

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

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

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

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

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

/* Remove default margins */
* {
  margin: 0;
}

html,
body {
  height: 100%;
}

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

body {
  -webkit-font-smoothing: antialiased;
}

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

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

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

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

/* Remove default link underline while preserving color inheritance */
a {
  color: inherit;
  text-decoration: none;
}

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

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

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  background-color: var(--color-bg);
  color: var(--color-text);
}

main {
  min-height: 60vh;
}

/* Headings */

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

h1 { font-size: var(--font-size-4xl); margin-bottom: var(--space-4); }

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

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

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

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

h6 { font-size: var(--font-size-base); margin-bottom: var(--space-1); }

/* Paragraphs: comfortable line length for product descriptions */

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

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

/* Links */

a {
  cursor: pointer;
  transition: color var(--transition-fast),
              text-decoration-color var(--transition-fast),
              background-color var(--transition-fast);
}

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

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

/* Lists */

ul,
ol {
  padding-left: 1.25rem;
  margin-bottom: var(--space-3);
}

li + li {
  margin-top: 0.125rem;
}

/* Forms typography */

label {
  display: inline-block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.25rem;
}

small {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

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

/* Layout container */

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

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

/* Flex helpers */

.flex {
  display: flex;
}

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

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

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

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

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

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

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

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

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

/* Spacing utilities (common) */

.mt-4 { margin-top: var(--space-4); }
.mb-4 { margin-bottom: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-6 { margin-bottom: var(--space-6); }
.pt-6 { padding-top: var(--space-6); }
.pb-6 { padding-bottom: var(--space-6); }

/* Alignment and text */

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

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-weight: 500;
  font-size: var(--font-size-sm);
  line-height: 1;
  cursor: pointer;
  background-color: var(--color-primary);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--transition-normal),
              box-shadow var(--transition-normal),
              transform var(--transition-fast),
              border-color var(--transition-fast);
}

.button:hover {
  background-color: var(--color-primary-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  color: #ffffff;
}

.button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

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

.button--outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary-soft);
  box-shadow: none;
}

.button--outline:hover {
  background-color: var(--color-primary-soft);
  border-color: var(--color-primary);
}

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

.button--ghost:hover {
  background-color: rgba(37, 99, 235, 0.06);
}

/* Inputs, selects, textareas */

.input,
select,
textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--gray-200);
  background-color: #ffffff;
  color: var(--color-text);
  font-size: var(--font-size-sm);
  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(--gray-400);
}

.input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.18);
}

.input[disabled],
select[disabled],
textarea[disabled] {
  background-color: var(--gray-100);
  cursor: not-allowed;
  color: var(--gray-500);
}

/* Cards for products and content blocks */

.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(15, 23, 42, 0.04);
}

.card--flush {
  padding: var(--space-3);
  box-shadow: var(--shadow-xs);
}

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

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

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

.card-media {
  margin-bottom: var(--space-3);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: auto;
}

/* Simple badges (for availability, discounts, etc.) */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.5rem;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.badge--success {
  background-color: rgba(22, 163, 74, 0.06);
  color: var(--color-success);
}

.badge--warning {
  background-color: rgba(245, 158, 11, 0.06);
  color: var(--color-warning);
}

.badge--danger {
  background-color: rgba(220, 38, 38, 0.06);
  color: var(--color-danger);
}

/* Simple tag for filters/category chips */

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--gray-200);
  font-size: var(--font-size-xs);
  color: var(--gray-700);
  background-color: #ffffff;
  cursor: pointer;
  transition: background-color var(--transition-fast),
              border-color var(--transition-fast),
              color var(--transition-fast);
}

.chip--active {
  border-color: var(--color-primary);
  background-color: var(--color-primary-soft);
  color: var(--color-primary-strong);
}

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

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

/* Remove animations for users who prefer reduced motion */

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