/* =====================================
   Variables
   ===================================== */
:root {
  /* Color palette: warm, earthy, inviting */
  --color-bg: #FAF7F3; /* warm canvas */
  --color-surface: #FFFFFF; /* cards, panels */
  --color-text: #2E2A27; /* warm charcoal */

  /* Primary (herb green) scale */
  --color-primary-200: #CFE3D8;
  --color-primary-300: #A5C8B5;
  --color-primary-400: #7BB38F;
  --color-primary-500: #4E8C6A;
  --color-primary-600: #2F6E4E;
  --color-primary-700: #275B40;

  /* Status colors */
  --color-success: #3D8B6D; /* parsley */
  --color-warning: #CC8B2F; /* amber honey */
  --color-danger:  #B23A2B; /* paprika */

  /* Warm neutral grays */
  --gray-50:  #FAF5F0;
  --gray-100: #F3EEE8;
  --gray-200: #E6E0D9;
  --gray-300: #D1C8BE;
  --gray-400: #B9B0A6;
  --gray-500: #9E9489;
  --gray-600: #7F766C;
  --gray-700: #655C53;
  --gray-800: #4E463F;
  --gray-900: #3B342E;

  /* Typography */
  --font-sans: 'Inter', 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'Liberation Sans', sans-serif;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', Times, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

  --fs-sm: 0.875rem;
  --fs-base: 1rem; /* 16px */
  --fs-md: 1.125rem;
  --lh-tight: 1.25;
  --lh-normal: 1.6;
  --lh-loose: 1.8;

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

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  /* Shadows (soft, warm) */
  --shadow-sm: 0 1px 2px rgba(32, 24, 16, 0.06);
  --shadow-md: 0 8px 24px rgba(32, 24, 16, 0.08);
  --shadow-lg: 0 16px 40px rgba(32, 24, 16, 0.12);

  /* Motion */
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;

  /* Layout */
  --container-max: 1200px;
  --container-pad: var(--space-4);

  /* Focus ring */
  --focus-outline: 2px solid var(--color-primary-400);
  --focus-shadow: 0 0 0 3px rgba(123, 179, 143, 0.35);
}

/* =====================================
   Reset / Normalize
   ===================================== */
* {
  box-sizing: border-box;
}
*::before,
*::after {
  box-sizing: inherit;
}

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

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

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

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

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

/* Remove animations/transitions for reduced motion users handled later */

/* =====================================
   Base styles
   ===================================== */
body {
  min-height: 100vh;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings: elegant, scalable */
h1, .h1 {
  font-family: var(--font-serif);
  line-height: var(--lh-tight);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-6);
  font-size: clamp(2rem, 1.35rem + 2.6vw, 3rem);
}

h2, .h2 {
  font-family: var(--font-serif);
  line-height: var(--lh-tight);
  font-weight: 600;
  letter-spacing: -0.005em;
  margin-bottom: var(--space-5);
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
}

h3, .h3 {
  font-family: var(--font-serif);
  line-height: var(--lh-tight);
  font-weight: 600;
  margin-bottom: var(--space-4);
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.75rem);
}

h4, .h4 {
  font-weight: 600;
  line-height: var(--lh-tight);
  margin-bottom: var(--space-3);
  font-size: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem);
}

h5, .h5 {
  font-weight: 600;
  margin-bottom: var(--space-2);
  font-size: 1rem;
}

h6, .h6 {
  font-weight: 600;
  margin-bottom: var(--space-2);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

p {
  max-width: 70ch;
  margin-bottom: var(--space-4);
  font-size: var(--fs-md);
}

small { font-size: var(--fs-sm); }

/* Links */
a {
  color: var(--color-primary-700);
  text-decoration: none;
  transition: color var(--duration-base) var(--ease-standard),
              text-underline-offset var(--duration-base) var(--ease-standard);
}

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

a:active { color: var(--color-primary-700); }

a:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

/* Lists & separators */
ul, ol { padding-left: 1.25rem; }
hr {
  border: 0;
  border-top: 1px solid var(--gray-200);
  margin: var(--space-8) 0;
}

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

/* Form defaults */
:root { accent-color: var(--color-primary-600); }

/* =====================================
   Utilities
   ===================================== */
.container {
  width: min(100%, var(--container-max));
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

@media (min-width: 768px) {
  :root { --container-pad: var(--space-6); }
}

img {
  max-width:  100%
  width: 100%;
}

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

.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-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }

.gap-sm { gap: var(--space-3); }
.gap-md { gap: var(--space-6); }
.gap-lg { gap: var(--space-10); }

/* Responsive, spacious product grid */
.grid-auto-fit-min-250 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-8);
}

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

/* Flow spacing utility for vertical rhythm */
.flow > * + * { margin-top: var(--space-4); }

/* =====================================
   Components
   ===================================== */
/* Buttons */
.btn {
  --_bg: var(--color-primary-600);
  --_bg-hover: var(--color-primary-700);
  --_text: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.75rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background-color: var(--_bg);
  color: var(--_text);
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color var(--duration-base) var(--ease-standard),
              box-shadow var(--duration-base) var(--ease-standard),
              transform var(--duration-fast) var(--ease-standard);
}

.btn:hover { background-color: var(--_bg-hover); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(1px); }
.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-md), var(--focus-shadow);
}

/* Button variants */
.btn--primary { --_bg: var(--color-primary-600); --_bg-hover: var(--color-primary-700); --_text: #ffffff; }
.btn--outline {
  --_bg: transparent;
  --_bg-hover: rgba(47, 110, 78, 0.06);
  --_text: var(--color-primary-700);
  border-color: var(--color-primary-400);
  color: var(--_text);
}
.btn--ghost {
  --_bg: transparent; --_bg-hover: rgba(47, 110, 78, 0.08); --_text: var(--color-primary-700);
  box-shadow: none;
}

/* Inputs */
input[type='text'],
input[type='email'],
input[type='password'],
input[type='search'],
input[type='tel'],
input[type='number'],
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background-color: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--duration-base) var(--ease-standard),
              box-shadow var(--duration-base) var(--ease-standard),
              background-color var(--duration-base) var(--ease-standard);
}

input::placeholder,
textarea::placeholder { color: var(--gray-500); }

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--color-primary-500);
  box-shadow: var(--focus-shadow);
}

label { display: inline-block; margin-bottom: var(--space-2); font-weight: 600; }

/* Cards */
.card {
  background-color: var(--color-surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
  transition: box-shadow var(--duration-base) var(--ease-standard),
              transform var(--duration-base) var(--ease-standard);
}

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

/* Media wrapper for lifestyle photography */
.media-rounded img,
.media-rounded picture,
.media-rounded video {
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* Badges (e.g., sale, new) */
.badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--gray-100);
  color: var(--gray-800);
}
.badge--success { background-color: rgba(61, 139, 109, 0.12); color: var(--color-success); }
.badge--warning { background-color: rgba(204, 139, 47, 0.12); color: var(--color-warning); }
.badge--danger  { background-color: rgba(178, 58, 43, 0.12); color: var(--color-danger); }

/* Tables (basic, clean) */
.table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--color-surface);
}
.table th,
.table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-200);
}
.table thead th {
  font-weight: 700;
  color: var(--gray-800);
}

/* =====================================
   Accessibility & Motion
   ===================================== */
:focus-visible {
  outline: var(--focus-outline);
  outline-offset: 2px;
}

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