/* ============================================
   BASE CSS - Refined Nursery E-commerce
   Engineered for discerning parents
   ============================================ */

/* ----------------------------------------
   VARIABLES
   ---------------------------------------- */
:root {
  /* Colors - Soothing nursery palette */
  --color-ivory: #FAF8F5;
  --color-cream: #F5F1EB;
  --color-taupe: #8B7E72;
  --color-taupe-dark: #4A403A;
  --color-taupe-light: #D4CCC3;
  
  --color-powder-blue: #C5D8E8;
  --color-powder-blue-dark: #9BBFD8;
  --color-blush: #E8D5D0;
  --color-blush-dark: #D4B5AD;
  --color-mint: #C8E6D9;
  --color-mint-dark: #A5D4C2;
  
  --color-rose-soft: #E8C5C5;
  --color-amber-soft: #F0E4D1;
  
  /* Semantic colors */
  --color-background: var(--color-ivory);
  --color-surface: #FFFFFF;
  --color-text: var(--color-taupe-dark);
  --color-text-muted: var(--color-taupe);
  --color-primary: var(--color-powder-blue-dark);
  --color-primary-hover: var(--color-powder-blue);
  --color-accent: var(--color-blush-dark);
  --color-success: var(--color-mint-dark);
  --color-warning: var(--color-amber-soft);
  --color-danger: var(--color-rose-soft);
  
  /* Typography - Elegant soft-serif & clean sans */
  --font-serif: 'Playfair Display', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  
  --text-xs: 0.75rem;    /* 12px */
  --text-sm: 0.875rem;   /* 14px */
  --text-base: 1rem;     /* 16px */
  --text-lg: 1.125rem;   /* 18px */
  --text-xl: 1.25rem;    /* 20px */
  --text-2xl: 1.5rem;    /* 24px */
  --text-3xl: 2rem;      /* 32px */
  --text-4xl: 2.5rem;    /* 40px */
  --text-5xl: 3rem;      /* 48px */
  
  --line-tight: 1.2;
  --line-snug: 1.4;
  --line-normal: 1.6;
  --line-relaxed: 1.8;
  
  /* Spacing - Airy, expansive scale */
  --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 */
  
  /* Effects - Soft, nurturing */
  --radius-sm: 0.375rem;  /* 6px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 1rem;      /* 16px */
  --radius-xl: 1.5rem;    /* 24px */
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(74, 64, 58, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(74, 64, 58, 0.08), 0 2px 4px -1px rgba(74, 64, 58, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(74, 64, 58, 0.08), 0 4px 6px -2px rgba(74, 64, 58, 0.04);
  --shadow-soft: 0 8px 32px rgba(74, 64, 58, 0.06);
  
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* ----------------------------------------
   BASE STYLES
   ---------------------------------------- */
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--line-normal);
  color: var(--color-text);
  background-color: var(--color-background);
  min-height: 100vh;
  letter-spacing: -0.01em;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: var(--line-tight);
  color: var(--color-text);
  margin-bottom: var(--space-4);
  letter-spacing: -0.02em;
}

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

a {
  transition: color var(--transition-fast);
}

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

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

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

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

.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-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.grid {
  display: grid;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }

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

/* ----------------------------------------
   COMPONENTS
   ---------------------------------------- */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.025em;
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  line-height: var(--line-snug);
  white-space: nowrap;
}

.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-taupe-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn--secondary {
  background-color: var(--color-blush);
  color: var(--color-taupe-dark)!important;
}

.btn--secondary:hover:not(:disabled) {
  background-color: var(--color-blush-dark);
}

.btn--outline {
  background-color: transparent;
  border-color: var(--color-taupe-light);
  color: var(--color-text);
}

.btn--outline:hover:not(:disabled) {
  border-color: var(--color-taupe);
  background-color: var(--color-cream);
}

/* Form Inputs */
.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--line-snug);
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-taupe-light);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(155, 191, 216, 0.15);
}

.input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.6;
}

/* Cards */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(139, 126, 114, 0.06);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

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

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