/* =========================
   VARIABLES (Root Custom Properties)
   ========================= */
:root {
  /* Colors */
  --color-background: #fafcff;
  --color-text: #222b45;
  --color-primary: #5b93fc;
  --color-primary-hover: #3466d6;
  --color-success: #22c55e;
  --color-warning: #ffbe3d;
  --color-danger: #f7746a;
  --color-neutral-100: #ffffff;
  --color-neutral-200: #f3f4f6;
  --color-neutral-300: #e5e7eb;
  --color-neutral-400: #a7adc5;
  --color-neutral-500: #6b7280;
  --color-neutral-600: #475569;

  /* Typography */
  --font-sans: 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-heading: 'Poppins', 'Segoe UI', Arial, 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.5rem;    /* 24px */
  --font-size-2xl: 2rem;     /* 32px */
  --line-height-tight: 1.15;
  --line-height-normal: 1.6;
  --line-length: 60ch;

  /* Spacing Scale (px) */
  --space-0:   0px;
  --space-1:   4px;
  --space-2:   8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-6:   24px;
  --space-8:   32px;
  --space-12:  48px;
  --space-16:  64px;
  --space-24:  96px;

  /* Borders & Shadows */
  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 18px;

  --shadow-xs: 0 1px 2px 0 rgba(40, 64, 141, 0.03);
  --shadow-sm: 0 2px 8px 0 rgba(40, 64, 141, 0.07);
  --shadow-md: 0 4px 16px 0 rgba(40, 64, 141, 0.12);

  /* Transitions */
  --transition-fast: 120ms cubic-bezier(0.4,0,0.2,1);
  --transition-normal: 220ms cubic-bezier(0.4,0,0.2,1);
  --transition-slow: 400ms cubic-bezier(0.4,0,0.2,1);
}

/* =========================
   RESET & NORMALIZE
   ========================= */
* {
  box-sizing: border-box;
}
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}
body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote, dl, dd {
  margin: 0;
  padding: 0;
}
ul, ol {
  list-style: none;
}
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}
table {
  border-collapse: collapse;
}
input, button, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
  box-shadow: none;
}
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

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

/* =========================
   BASE STYLES
   ========================= */
body {
  min-height: 100vh;
  background: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-text);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-2);
}
h1 {font-size: var(--font-size-2xl);}
h2 {font-size: var(--font-size-xl);}
h3 {font-size: 1.25rem;}
h4 {font-size: var(--font-size-lg);}
h5 {font-size: var(--font-size-base);}
h6 {font-size: var(--font-size-sm);}

p {
  margin-bottom: var(--space-3);
  line-height: var(--line-height-normal);
}

/* Links */
a {
  color: var(--color-primary);
  text-decoration: underline;
  transition: color var(--transition-fast);
  cursor: pointer;
  outline: none;
  border-radius: var(--radius-sm);
}
a:hover, a:active {
  color: var(--color-primary-hover);
  text-decoration: underline wavy 2px;
}
a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

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

.flex {
  display: flex;
}
.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.grid {
  display: grid;
  gap: var(--space-4);
}
.gap-2 { gap: var(--space-2) }
.gap-4 { gap: var(--space-4) }
.gap-6 { gap: var(--space-6) }
.gap-8 { gap: var(--space-8) }

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

/* =========================
   COMPONENTS
   ========================= */
/* Buttons */
.button, button, [type="button"], [type="submit"], [type="reset"] {
  appearance: none;
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  font-weight: 600;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-normal),
    box-shadow var(--transition-normal),
    transform var(--transition-fast);
  outline: none;
}
.button:hover, button:hover, [type="button"]:hover, [type="submit"]:hover, [type="reset"]:hover {
  background: var(--color-primary-hover);
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-md);
}
.button:active, button:active, [type="button"]:active {
  background: var(--color-primary);
}
.button:focus-visible, button:focus-visible,
[type="button"]:focus-visible, [type="submit"]:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.button:disabled, button:disabled,
[type="button"]:disabled, [type="submit"]:disabled {
  opacity: 0.6;
  pointer-events: none;
  box-shadow: none;
}

/* Inputs */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
select, textarea {
  width: 100%;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-neutral-300);
  background: var(--color-neutral-100);
  color: var(--color-text);
  box-shadow: var(--shadow-xs);
  font-size: var(--font-size-base);
  transition: border-color var(--transition-fast),
    box-shadow var(--transition-fast);
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-hover);
}
input:disabled, select:disabled, textarea:disabled {
  background: var(--color-neutral-200);
  color: var(--color-neutral-500);
  opacity: 0.7;
}

/* Card */
.card {
  background: var(--color-neutral-100);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: box-shadow var(--transition-fast);
}
.card:hover, .card:focus-within {
  box-shadow: var(--shadow-md);
}

/* Accessibility */
:focus-visible {
  outline: 2px solid var(--color-primary-hover);
  outline-offset: 2px;
}

/* Playful Accents: Example classes */
.accent {
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-success) 100%);
  color: #fff;
  border-radius: var(--radius-md);
  padding: var(--space-1) var(--space-3);
  font-weight: 700;
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .container {
    padding-left: var(--space-2);
    padding-right: var(--space-2);
  }
  .card {
    padding: var(--space-3);
  }
  h1 {font-size: var(--font-size-xl);}
  h2 {font-size: 1.25rem;}
}

/* =========================
   HEADER & FOOTER styles (shared)
   ========================= */
.site-header {
  background: var(--color-neutral-100);
  box-shadow: var(--shadow-xs);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  min-height: 64px;
}
.site-logo {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--color-primary);
  text-decoration: none;
}
.site-logo:focus-visible {
  outline: 2px solid var(--color-primary-hover);
}

.main-nav {
  position: relative;
}
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--space-2);
}
.menu-icon {
  display: block;
  width: 24px;
  height: 3px;
  background: var(--color-primary);
  position: relative;
  transition: background 0.2s;
}
.menu-icon::before, .menu-icon::after {
  content: '';
  display: block;
  width: 24px;
  height: 3px;
  background: var(--color-primary);
  position: absolute;
  left: 0;
  transition: transform 0.2s;
}
.menu-icon::before {
  top: -8px;
}
.menu-icon::after {
  top: 8px;
}
.nav-list {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  background: transparent;
  padding: 0;
  font-size: var(--font-size-base);
}
.nav-list.mobile {
  display: none;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--color-neutral-100);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  position: absolute;
  top: 48px;
  right: 0;
  min-width: 195px;
  z-index: 99;
  padding: var(--space-2);
}
.nav-list.mobile[hidden] {
  display: none;
}
.nav-list a {
  color: var(--color-text);
  font-weight: 500;
  text-decoration: none;
  padding: var(--space-2) var(--space-1);
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.nav-list a:hover, .nav-list a:focus-visible {
  background: var(--color-neutral-200);
  color: var(--color-primary);
}

@media (max-width: 900px) {
  .header-inner {
    flex-direction: row;
  }
  .nav-list {
    display: none;
  }
  .menu-toggle {
    display: block;
  }
  .nav-list.mobile {
    display: flex;
  }
}

.site-footer {
  background: var(--color-neutral-100);
  box-shadow: var(--shadow-xs);
  padding: var(--space-12) 0 var(--space-6) 0;
  margin-top: var(--space-12);
}
.footer-content {
  align-items: flex-start;
  gap: var(--space-16);
}
.footer-brand {
  flex: 1 1 200px;
}
.footer-logo {
  font-family: var(--font-heading);
  color: var(--color-primary);
  font-size: 1.25rem;
  font-weight: bold;
  text-decoration: none;
}
.footer-desc {
  font-size: var(--font-size-sm);
  color: var(--color-neutral-500);
  margin-top: var(--space-1);
  margin-bottom: 0;
}
.footer-nav, .footer-legal {
  flex: 1 1 130px;
}
.footer-links li, .footer-legal-links li {
  margin-bottom: var(--space-2);
}
.footer-links a, .footer-legal-links a {
  color: var(--color-neutral-600);
  text-decoration: none;
  font-size: var(--font-size-sm);
}
.footer-links a:hover, .footer-legal-links a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}
.copyright {
  text-align: center;
  color: var(--color-neutral-500);
  font-size: var(--font-size-xs);
  margin-top: var(--space-8);
}

/* =========================
   Cookie Consent Banner
   ========================= */
.cookie-consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-primary);
  color: #fff;
  z-index: 1000;
  padding: var(--space-2) 0;
  box-shadow: 0 -2px 24px 0 rgba(91,147,252,0.12);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s;
  font-size: var(--font-size-base);
}
.cookie-content {
  max-width: 1100px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: 0 var(--space-4);
}
.cookie-content a {
  color: #fff;
  text-decoration: underline;
}
.cookie-buttons {
  display: flex;
  gap: var(--space-2);
}
@media (max-width: 600px) {
  .cookie-content {
    flex-direction: column;
    gap: var(--space-3);
    align-items: flex-start;
    padding: 0 var(--space-2);
  }
}

/* =========================
   Miscellaneous
   ========================= */
.card:focus-within, .product-card:focus {
  box-shadow: 0 0 0 3px var(--color-primary-hover);
}

.hide {
  display: none !important;
}
