/* ========================================
   BASE.CSS - Outdoor E-Commerce Foundation
   Language: Polish (PL) Optimized
   Theme: Rugged, Cinematic, Wilderness
   ======================================== */

/* ----------------------------------------
   1. VARIABLES
   ---------------------------------------- */
:root {
  /* Colors - Rugged Outdoor Palette */
  --color-background: #F7F5F0;        /* Warm paper white */
  --color-surface: #FFFFFF;           /* Pure white for cards */
  --color-text: #1C2416;              /* Deep forest black-green */
  --color-text-muted: #5C6B57;        /* Muted sage */
  
  /* Primary: Deep Forest Green */
  --color-primary-50: #E8F5E9;
  --color-primary-100: #C8E6C9;
  --color-primary-200: #A5D6A7;
  --color-primary-500: #2E7D32;
  --color-primary-700: #1B5E20;
  --color-primary-900: #0D3B10;
  
  /* Accent: Burnt Orange/Slate */
  --color-accent-500: #C75B39;        /* Burnt orange */
  --color-accent-600: #A84A2D;        /* Rust */
  --color-slate-400: #64748B;         /* Slate gray */
  --color-slate-600: #475569;         /* Deep slate */
  --color-slate-800: #1E293B;         /* Charcoal */
  
  /* Functional Colors */
  --color-success: #2E5C43;           /* Forest success */
  --color-warning: #B45309;           /* Amber/Earth warning */
  --color-danger: #991B1B;            /* Deep red */
  --color-neutral-100: #F1F5F9;
  --color-neutral-200: #E2E8F0;
  --color-neutral-300: #CBD5E1;
  --color-neutral-400: #94A3B8;
  --color-neutral-600: #475569;
  --color-neutral-900: #0F172A;
  
  /* Typography - Polish Language Support (Latin Extended) */
  --font-family-base: 'Inter', 'Segoe UI', 'Roboto', 'Helvetica Neue', 'Arial', system-ui, -apple-system, sans-serif;
  --font-family-heading: 'Inter', 'Segoe UI', 'Roboto', sans-serif;
  
  --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 */
  --font-size-5xl: 3rem;              /* 48px */
  
  --line-height-tight: 1.25;
  --line-height-normal: 1.65;         /* Increased for Polish diacritics */
  --line-height-relaxed: 1.8;
  
  /* 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.5rem;                  /* 24px */
  --space-6: 2rem;                    /* 32px */
  --space-8: 3rem;                    /* 48px */
  --space-10: 4rem;                   /* 64px */
  --space-12: 6rem;                   /* 96px */
  
  /* Radius - Rugged but Refined */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-full: 9999px;
  
  /* Shadows - Warm, Earthy Tones */
  --shadow-sm: 0 1px 2px 0 rgba(28, 36, 22, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(28, 36, 22, 0.08), 0 2px 4px -2px rgba(28, 36, 22, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(28, 36, 22, 0.1), 0 4px 6px -4px rgba(28, 36, 22, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(28, 36, 22, 0.1), 0 8px 10px -6px rgba(28, 36, 22, 0.04);
  --shadow-inner: inset 0 2px 4px 0 rgba(28, 36, 22, 0.05);
  
  /* Transitions */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 350ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  
  /* Layout */
  --container-max: 1280px;
  --container-padding: var(--space-4);
}

/* ----------------------------------------
   2. RESET & NORMALIZE
   ---------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
  scroll-behavior: smooth;
}

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

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-background);
  min-height: 100vh;
  text-underline-offset: 0.2em;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
  font-style: italic; /* For alt text */
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
  word-spacing: inherit;
}

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

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

ul, ol {
  list-style: none;
}

/* ----------------------------------------
   3. BASE STYLES
   ---------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  font-weight: 700;
  line-height: var(--line-height-tight);
  color: var(--color-text);
  margin-bottom: var(--space-4);
  letter-spacing: -0.025em;
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); text-transform: uppercase; letter-spacing: 0.05em; }

p {
  margin-bottom: var(--space-4);
  /* Optimal for Polish text */
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--color-accent-500);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

.flex {
  display: flex;
}

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

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

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.grid {
  display: grid;
}

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

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ----------------------------------------
   5. COMPONENTS
   ---------------------------------------- */

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--font-size-base);
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn--primary {
  background-color: var(--color-primary-700);
  color: white;
}

.btn--primary:hover:not(:disabled) {
  background-color: var(--color-primary-900);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--secondary {
  background-color: var(--color-accent-500);
  color: white;
}

.btn--secondary:hover:not(:disabled) {
  background-color: var(--color-accent-600);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--outline {
  background-color: transparent;
  border-color: var(--color-slate-400);
  color: white;
}

.btn--outline:hover:not(:disabled) {
  border-color: var(--color-primary-700);
  color: var(--color-primary-700);
  background-color: var(--color-primary-50);
}

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

.btn--ghost:hover:not(:disabled) {
  background-color: var(--color-neutral-100);
}

/* Input */
.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 2px solid var(--color-neutral-200);
  border-radius: var(--radius-md);
  transition: border-color var(--duration-fast) var(--ease-out), 
              box-shadow var(--duration-fast) var(--ease-out),
              background-color var(--duration-fast) var(--ease-out);
}

.input:hover {
  border-color: var(--color-neutral-300);
}

.input:focus {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.15);
}

.input::placeholder {
  color: var(--color-neutral-400);
}

.input:disabled {
  background-color: var(--color-neutral-100);
  cursor: not-allowed;
  opacity: 0.7;
}

/* Card */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-neutral-200);
  transition: transform var(--duration-normal) var(--ease-out), 
              box-shadow var(--duration-normal) var(--ease-out);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.card--interactive {
  cursor: pointer;
}

/* ----------------------------------------
   6. ACCESSIBILITY
   ---------------------------------------- */
@media (prefers-contrast: high) {
  :root {
    --color-text: #000000;
    --color-background: #FFFFFF;
    --color-primary-700: #004d00;
    --color-accent-500: #8B3A1F;
  }
  
  .btn--primary,
  .btn--secondary {
    border: 2px solid currentColor;
  }
  
  .input {
    border-width: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn,
  .card,
  .input {
    transition: none;
  }
  
  .btn:hover:not(:disabled),
  .card:hover {
    transform: none;
  }
}

/* Focus visible polyfill support */
.js-focus-visible :focus:not(.focus-visible) {
  outline: none;
}