/* ========================================
   FLORALIA - ORGANIC E-COMMERCE BASE
   Refined botanical minimalism
   ======================================== */

/* ----------------------------------------
   1. VARIABLES
   ---------------------------------------- */
:root {
  /* Organic Color Palette */
  --color-bg: #fafaf8;
  --color-bg-alt: #f5f5f0;
  --color-surface: #ffffff;
  
  --color-text: #1f2920;
  --color-text-muted: #5c6b5e;
  --color-text-light: #8a9a8c;
  
  --color-primary: #7a9e7e;
  --color-primary-light: #a8c4ab;
  --color-primary-dark: #5c7a60;
  --color-primary-bg: #f0f5f1;
  
  --color-secondary: #c4a77d;
  --color-secondary-light: #d9c4a3;
  --color-secondary-dark: #a68b5b;
  
  --color-earth: #8b7355;
  --color-earth-light: #b8a99a;
  
  --color-success: #8fbc8f;
  --color-warning: #d4a373;
  --color-danger: #c06c5f;
  --color-info: #7da3a1;
  
  /* Neutral Scale */
  --color-neutral-50: #fafaf8;
  --color-neutral-100: #f5f5f0;
  --color-neutral-200: #e8e6e1;
  --color-neutral-300: #d4cfc7;
  --color-neutral-400: #b8b3a8;
  --color-neutral-500: #9a958a;
  --color-neutral-600: #7a756d;
  --color-neutral-700: #5c5850;
  --color-neutral-800: #3d3a35;
  --color-neutral-900: #1f1d1a;
  
  /* Typography */
  --font-heading: 'Cormorant Garamond', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;
  
  --font-light: 300;
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  --leading-none: 1;
  --leading-tight: 1.2;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;
  
  /* Spacing Scale (0-96px) */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  
  /* Shadows - Soft botanical depth */
  --shadow-sm: 0 1px 2px 0 rgb(31 41 32 / 0.04);
  --shadow-md: 0 4px 6px -1px rgb(31 41 32 / 0.06), 0 2px 4px -2px rgb(31 41 32 / 0.04);
  --shadow-lg: 0 10px 15px -3px rgb(31 41 32 / 0.07), 0 4px 6px -4px rgb(31 41 32 / 0.04);
  --shadow-xl: 0 20px 25px -5px rgb(31 41 32 / 0.07), 0 8px 10px -6px rgb(31 41 32 / 0.03);
  --shadow-inner: inset 0 2px 4px 0 rgb(31 41 32 / 0.04);
  
  /* 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: 1400px;
  --container-narrow: 768px;
  --header-height: 80px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  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;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100vh;
}

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

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

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

ul,
ol {
  list-style: none;
}

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

/* ----------------------------------------
   3. BASE TYPOGRAPHY
   ---------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--font-medium);
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
  color: var(--color-text);
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

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

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

a {
  color: var(--color-primary-dark);
  transition: color var(--duration-fast) var(--ease-out);
}

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

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

/* Polish character support */
:lang(pl) {
  quotes: "„" "”" "«" "»";
}

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

@media (max-width: 640px) {
  .container {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

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

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

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

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

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

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

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

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

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

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

@media (min-width: 1024px) {
  .grid-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* 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-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-6);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  line-height: var(--leading-none);
  border-radius: var(--radius-full);
  transition: all var(--duration-normal) var(--ease-out);
  cursor: pointer;
  border: 1px solid transparent;
}

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

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

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

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

.btn--secondary {
  background-color: transparent;
  color: var(--color-primary-dark);
  border-color: var(--color-primary-light);
}

.btn--secondary:hover:not(:disabled) {
  background-color: var(--color-primary-bg);
  border-color: var(--color-primary);
}

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

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

/* Form Inputs */
.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-neutral-300);
  border-radius: var(--radius-lg);
  transition: all var(--duration-fast) var(--ease-out);
}

.input::placeholder {
  color: var(--color-text-light);
}

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

.input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg);
}

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

/* Card */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

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

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

/* ----------------------------------------
   6. ACCESSIBILITY
   ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .btn,
  .input,
  .card,
  a {
    transition: none;
  }
  
  .card:hover,
  .btn:hover {
    transform: none;
  }
}

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

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --color-primary: #2d5016;
    --color-text: #000000;
  }
  
  .btn--primary {
    border: 2px solid currentColor;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
    color: black;
  }
  
  .no-print {
    display: none !important;
  }
}
