/* =====================================
   Variables
   ===================================== */
:root {
  /* Palette tuned for modern, minimalist e‑commerce (soft gray, pastel blue, white, beige) */
  --color-background: #f7f8fa;
  --color-surface: #ffffff;
  --color-surface-alt: #f4ede6; /* soft beige surface */
  --color-text: #253040; /* deep slate */
  --color-primary: #4f89c9; /* pastel/soft blue with good contrast */
  --color-primary-hover: #457ebd;
  --color-primary-weak: #e7f0fb;
  --color-success: #3fb995;
  --color-warning: #e0ab3b;
  --color-danger: #db5f5f;

  /* 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: #1f2937;
  --gray-900: #111827;

  /* Typography */
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;

  --fs-xs: 12px;
  --fs-sm: 14px;
  --fs-base: 16px;
  --fs-md: 18px;
  --fs-lg: 20px;
  --fs-xl: 24px;
  --fs-2xl: 30px;
  --fs-3xl: 36px;
  --fs-4xl: 48px;

  --lh-tight: 1.25;
  --lh-normal: 1.6;
  --lh-relaxed: 1.8;

  /* Comfortable reading measure */
  --measure: 70ch;

  /* Spacing scale (0–96px) */
  --space-0: 0px;
  --space-2: 2px;
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-28: 28px;
  --space-32: 32px;
  --space-36: 36px;
  --space-40: 40px;
  --space-48: 48px;
  --space-56: 56px;
  --space-64: 64px;
  --space-72: 72px;
  --space-80: 80px;
  --space-96: 96px;

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

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 16px 32px rgba(15, 23, 42, 0.12);
  --shadow-focus: 0 0 0 3px rgba(79, 137, 201, 0.35);

  /* Transitions */
  --dur-fast: 120ms;
  --dur: 200ms;
  --dur-slow: 320ms;
  --easing-standard: cubic-bezier(0.2, 0.65, 0.3, 1);
}

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

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

/* Remove default margins */
body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }

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

/* Inherit fonts for form controls */
input, button, textarea, select { font: inherit; color: inherit; }

button, [role=button] { cursor: pointer; }

/* Improve line-height for text elements */
:where(p, li, figcaption) { line-height: var(--lh-normal); }

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

/* Headings: scalable, minimal margins */
h1, h2, h3, h4, h5, h6 { font-weight: 600; color: var(--color-text); line-height: var(--lh-tight); }

h1 { font-size: clamp(2rem, 1.2rem + 2.5vw, 3rem); margin-block: 0 0.5em; }
h2 { font-size: clamp(1.5rem, 1rem + 2vw, 2.25rem); margin-block: 0 0.6em; }
h3 { font-size: clamp(1.25rem, 0.9rem + 1.2vw, 1.75rem); margin-block: 0 0.6em; }
h4 { font-size: var(--fs-lg); margin-block: 0 0.5em; }
h5 { font-size: var(--fs-md); margin-block: 0 0.5em; }
h6 { font-size: var(--fs-base); margin-block: 0 0.4em; }

/* Links: clean, understated */
a { color: var(--color-primary); text-decoration: none; text-underline-offset: 2px; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; border-radius: var(--radius-sm); }

/* Paragraphs: comfortable line length */
p {  margin-block-end: var(--space-16); }

/* Lists */
ul, ol { padding-left: 1.2em; margin-block: 0 1em; }

/* Horizontal rule */
hr { border: 0; height: 1px; background: var(--gray-200); margin-block: var(--space-24); }

/* =====================================
   Utilities
   ===================================== */
/* Container */
.container { width: min(100%, 1200px); margin-inline: auto; padding-inline: var(--space-16); }
.container--narrow { width: min(100%, 880px); }
.container--wide { width: min(100%, 1400px); }

/* Layout helpers */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-8); }
.gap-md { gap: var(--space-16); }
.gap-lg { gap: var(--space-24); }

.grid { display: grid; }
.grid-gap-sm { gap: var(--space-12); }
.grid-gap-md { gap: var(--space-20); }
.grid-gap-lg { gap: var(--space-32); }

/* 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; }
.sr-only-focusable:focus { position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: normal; }

/* =====================================
   Components
   ===================================== */
/* Buttons */
.btn {
  --btn-bg: var(--gray-100);
  --btn-fg: var(--color-text);
  --btn-border: var(--gray-300);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: 0.625rem 1rem; /* ~10px 16px */
  border-radius: var(--radius-md);
  border: 1px solid var(--btn-border);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color var(--dur) var(--easing-standard), border-color var(--dur) var(--easing-standard), color var(--dur) var(--easing-standard), box-shadow var(--dur) var(--easing-standard), transform var(--dur-fast) var(--easing-standard);
}

.btn:hover { background: var(--gray-50); border-color: var(--gray-300); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn:disabled, .btn[aria-disabled=true] { opacity: 0.55; cursor: not-allowed; pointer-events: none; }

/* Primary button */
.btn--primary { --btn-bg: var(--color-primary); --btn-fg: #ffffff; --btn-border: var(--color-primary); background: var(--btn-bg); color: var(--btn-fg); border-color: var(--btn-border); }
.btn--primary:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }

/* Neutral subtle button */
.btn--neutral { --btn-bg: var(--gray-100); --btn-fg: var(--color-text); --btn-border: var(--gray-300); }

/* Outline / ghost styles */
.btn--outline { --btn-bg: transparent; --btn-fg: var(--color-text); --btn-border: var(--gray-300); background: transparent; }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--color-primary); --btn-border: transparent; background: transparent; color: var(--color-primary); }
.btn--ghost:hover { background: var(--color-primary-weak); }

/* Inputs */
input[type=text], input[type=email], input[type=search], input[type=password], input[type=tel], input[type=url], select, textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  color: var(--color-text);
  transition: border-color var(--dur) var(--easing-standard), box-shadow var(--dur) var(--easing-standard), background-color var(--dur) var(--easing-standard);
}

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

input:hover, select:hover, textarea:hover { border-color: var(--gray-400); }

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

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

/* Search input accent */
input[type=search] { background-color: var(--color-surface); }

/* Card */
.card {
  background: var(--color-surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-20);
  box-shadow: var(--shadow-sm);
}

.card--elevated { box-shadow: var(--shadow-md); }
.card__header { margin-bottom: var(--space-12); }
.card__footer { margin-top: var(--space-16); }

/* Badges (optional small component for promos/new arrivals) */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-size: var(--fs-sm);
  border-radius: var(--radius-round);
  background: var(--color-primary-weak);
  color: var(--color-primary);
}

/* =====================================
   Accessibility
   ===================================== */
/* Strong, consistent focus indicators */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* Respect prefers-reduced-motion */
@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; }
}

/* =====================================
   Header & Footer styles
   ===================================== */

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 16px;
  background: var(--color-primary);
  color: #fff;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: transform var(--dur) var(--easing-standard);
}
.skip-link:focus { top: 12px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.9);
  backdrop-filter: saturate(180%) blur(8px);
  box-shadow: var(--shadow-xs);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.brand__link { font-weight: 700; font-size: 1.125rem; color: var(--color-text); letter-spacing: 0.2px; }

/* Nav */
.nav-toggle {
  display: inline-flex;
  width: 42px; height: 42px;
  align-items: center; justify-content: center;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  flex-direction: column;
}
.nav-toggle__bar { width: 20px; height: 2px; background: var(--color-text); margin: 2px 0; border-radius: 2px; display: block; }

.primary-nav { position: relative; }
.nav-list { display: flex; gap: var(--space-24); align-items: center; list-style: none; margin: 0; padding: 0; }
.nav-list a { color: var(--color-text); font-weight: 600; }

@media (max-width: 980px) {
  .nav-list { position: absolute; right: 0; top: calc(100% + 12px); background: var(--color-surface); border: 1px solid var(--gray-200); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 12px; display: none; flex-direction: column; min-width: 220px; }
  .primary-nav.open .nav-list { display: flex; }
}
@media (min-width: 981px) {
  .nav-toggle { display: none; }
}

/* Footer */
.site-footer { background: var(--color-surface); border-top: 1px solid var(--gray-200); margin-top: var(--space-56); position: relative; }
.footer__grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1.2fr; gap: var(--space-32); padding: var(--space-40) 0; }
.footer__title { font-size: var(--fs-md); margin-bottom: var(--space-12); }
.footer__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.brand__link--footer { font-weight: 700; color: var(--color-text); }
.newsletter { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.newsletter__note { font-size: var(--fs-sm); color: var(--gray-600); margin: 0; grid-column: 1 / -1; }
.newsletter__feedback { margin-top: 6px; font-size: var(--fs-sm); grid-column: 1 / -1; }
.footer__bottom { border-top: 1px solid var(--gray-200); padding: 12px 0 24px; font-size: var(--fs-sm); color: var(--gray-600); }

@media (max-width: 980px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .footer__grid { grid-template-columns: 1fr; }
}

/* Cookie consent */
.cookie-consent { position: sticky; bottom: 0; background: rgba(255,255,255,0.98); border-top: 1px solid var(--gray-200); box-shadow: var(--shadow-sm); padding: 12px 0; }
.cookie-consent[hidden] { display: none !important; }
.cookie-consent__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-16); }
.cookie-consent__text { margin: 0; color: var(--gray-700); }
.cookie-consent__actions { display: flex; gap: var(--space-12); flex-wrap: wrap; }

@media (max-width: 780px) {
  .cookie-consent__inner { flex-direction: column; align-items: stretch; }
  .cookie-consent__actions { justify-content: flex-end; }
}
