:root {
  /* Color Palette - Playful, Vibrant, Trustworthy */
  --color-background: #f9fafc;
  --color-background-alt: #ffffff;
  --color-surface: #ffffff;
  --color-surface-muted: #f3f4f8;

  --color-text: #1f2933;
  --color-text-muted: #6b7280;
  --color-text-soft: #9ca3af;

  /* Primary playful hues */
  --color-primary: #ff6b35;       /* warm, energetic orange */
  --color-primary-soft: #ffe4d6;
  --color-primary-strong: #e25523;

  --color-success: #16a34a;       /* safe, positive green */
  --color-success-soft: #dcfce7;

  --color-warning: #f59e0b;       /* friendly amber */
  --color-warning-soft: #fef3c7;

  --color-danger: #e11d48;        /* clear, not harsh red */
  --color-danger-soft: #ffe4e6;

  /* Neutral grays */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2933;
  --color-gray-900: #111827;

  /* Supporting playful accents (for toys, tags, badges) */
  --color-accent-blue: #1d4ed8;
  --color-accent-blue-soft: #dbeafe;
  --color-accent-yellow: #facc15;
  --color-accent-yellow-soft: #fef9c3;
  --color-accent-green: #22c55e;
  --color-accent-green-soft: #dcfce7;

  /* Typography */
  --font-family-base: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-family-display: "Baloo 2", "Fredoka", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-family-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --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.25rem;   /* 20px */
  --font-size-2xl: 1.5rem;   /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem;  /* 36px */
  --font-size-5xl: 3rem;     /* 48px */

  --line-height-tight: 1.2;
  --line-height-snug: 1.35;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.7;

  /* Spacing scale (0–96px) */
  --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.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-10: 2.5rem;  /* 40px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  --space-20: 5rem;    /* 80px */
  --space-24: 6rem;    /* 96px */

  /* Radius (slightly rounded, friendly) */
  --radius-xs: 0.25rem;   /* 4px */
  --radius-sm: 0.375rem;  /* 6px */
  --radius-md: 0.75rem;   /* 12px */
  --radius-lg: 1rem;      /* 16px */
  --radius-xl: 1.5rem;    /* 24px */
  --radius-full: 9999px;

  /* Shadows (soft, airy for cards & toys) */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 12px 30px rgba(15, 23, 42, 0.18);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-base: 180ms ease-out;
  --transition-slow: 250ms ease-out;

  /* Layout */
  --layout-max-width: 1120px;
  --layout-gutter: var(--space-4);

  /* Component tokens */
  --btn-height: 2.75rem;
  --input-height: 2.75rem;
}

/*
======================================================================
  RESET / NORMALIZE
======================================================================
*/

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
}

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

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

button {
  border: none;
  background: none;
  padding: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure {
  margin: 0;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

:focus {
  outline: none;
}

/*
======================================================================
  BASE STYLES
======================================================================
*/

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  display: block;
}

/* Headings: friendly, display-like for main titles */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family-display);
  font-weight: 700;
  color: var(--color-text);
  line-height: var(--line-height-tight);
}

h1 {
  font-size: clamp(var(--font-size-3xl), 3vw, var(--font-size-5xl));
  margin-bottom: var(--space-4);
}

h2 {
  font-size: clamp(var(--font-size-2xl), 2.2vw, var(--font-size-4xl));
  margin-bottom: var(--space-3);
}

h3 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-2);
}

h4 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-2);
}

h5 {
  font-size: var(--font-size-base);
  margin-bottom: var(--space-1);
}

h6 {
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Paragraphs - comfortable reading, product descriptions in Polish */

p {
  margin-bottom: var(--space-3);
  line-height: var(--line-height-relaxed);
  color: var(--color-text-muted);
}

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

strong,
b {
  font-weight: 600;
}

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

/* Links - cheerful but clean */

a {
  text-decoration: none;
  color: var(--color-primary);
  transition: color var(--transition-base);
}

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

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

/* Lists */

ul,
ol {
  padding-left: 1.25rem;
  margin-bottom: var(--space-3);
}

li + li {
  margin-top: 0.25rem;
}

/* Form basics */

label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--font-size-sm);
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

textarea {
  resize: vertical;
}

/* Tables (for order summaries) */

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 0.75rem 0.5rem;
}

th {
  text-align: left;
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--color-text);
}

/*
======================================================================
  ACCESSIBILITY & MOTION
======================================================================
*/

:focus-visible {
  outline: 3px solid var(--color-accent-blue);
  outline-offset: 3px;
}

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

/*
======================================================================
  UTILITIES
======================================================================
*/

/* Layout container - central column for product listings & content */

.container {
  width: 100%;
  max-width: var(--layout-max-width);
  margin-inline: auto;
  padding-inline: var(--layout-gutter);
}

.container-wide {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--layout-gutter);
}

/* Flex helpers */

.flex {
  display: flex;
}

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

.flex-row {
  flex-direction: row;
}

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

.flex-wrap {
  flex-wrap: wrap;
}

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

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

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

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

/* Grid helpers (for category cards, toy grids) */

.grid {
  display: grid;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
}

.grid-auto-fit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-4);
}

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

@media (max-width: 480px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Spacing utilities (commonly used) */

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }

.pt-4 { padding-top: var(--space-4); }
.pb-4 { padding-bottom: var(--space-4); }
.px-4 {
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }

/* Visually hidden, for Polish accessibility labels */

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

/*
======================================================================
  BASIC COMPONENTS
======================================================================
*/

/* Buttons: primary CTA for "Dodaj do koszyka", "Kup teraz" */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--btn-height);
  padding-inline: var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: var(--font-size-sm);
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    background-color var(--transition-base),
    color var(--transition-base),
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), #ff9f1c);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  filter: brightness(1.03);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

.btn-secondary {
  background-color: var(--color-background-alt);
  color: var(--color-text);
  border-color: var(--color-gray-200);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background-color: var(--color-gray-50);
  border-color: var(--color-gray-300);
}

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

.btn-ghost:hover {
  background-color: var(--color-primary-soft);
}

.btn-sm {
  min-height: 2.25rem;
  padding-inline: var(--space-3);
  font-size: var(--font-size-xs);
}

.btn-lg {
  min-height: 3.25rem;
  padding-inline: var(--space-5);
  font-size: var(--font-size-base);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

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

/* Inputs: for search, filters, checkout forms */

.input,
select,
textarea {
  width: 100%;
  min-height: var(--input-height);
  padding-inline: var(--space-3);
  padding-block: 0.6rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-gray-200);
  background-color: #ffffff;
  font-size: var(--font-size-sm);
  color: var(--color-text);
  transition:
    border-color var(--transition-base),
    box-shadow var(--transition-base),
    background-color var(--transition-base);
}

.input::placeholder,
textarea::placeholder {
  color: var(--color-text-soft);
}

.input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--color-accent-blue);
  box-shadow: 0 0 0 3px var(--color-accent-blue-soft);
  outline: none;
}

.input[aria-invalid="true"],
.input.input-error {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 2px var(--color-danger-soft);
}

.input--pill {
  border-radius: var(--radius-full);
}

/* Search input variant (header search bar) */

.input-search {
  border-radius: var(--radius-full);
  background-color: var(--color-surface);
}

.input-search:focus-visible {
  box-shadow: 0 0 0 3px var(--color-primary-soft);
  border-color: var(--color-primary);
}

/* Card: for toy product tiles, category cards, reviews */

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background-color: var(--color-surface);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(148, 163, 184, 0.12);
  transition:
    box-shadow var(--transition-base),
    transform var(--transition-base),
    border-color var(--transition-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: rgba(148, 163, 184, 0.2);
}

.card-header {
  margin-bottom: var(--space-2);
}

.card-title {
  font-family: var(--font-family-display);
  font-size: var(--font-size-lg);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-1);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--color-text-soft);
}

.card-body {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
}

.card-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.card-badge {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--color-accent-yellow);
  color: #1f2933;
  font-size: var(--font-size-xs);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* Promotional ribbon / playful tag variant */

.card-badge--primary {
  background: var(--color-primary);
  color: #ffffff;
}

/*
======================================================================
  MISCELLANEOUS & HELPER STATES
======================================================================
*/

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.badge-success {
  background-color: var(--color-success-soft);
  color: var(--color-success);
}

.badge-warning {
  background-color: var(--color-warning-soft);
  color: var(--color-warning);
}

.badge-danger {
  background-color: var(--color-danger-soft);
  color: var(--color-danger);
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: var(--radius-full);
  background-color: var(--color-primary-soft);
  color: var(--color-primary-strong);
  font-size: var(--font-size-xs);
  font-weight: 500;
}

/* Helper for subtle section backgrounds (hero, banners) */

.section-soft {
  background: radial-gradient(circle at top left, #ffe4d6 0, transparent 45%),
    radial-gradient(circle at bottom right, #dbeafe 0, transparent 45%),
    var(--color-background);
}

.section-alt {
  background-color: var(--color-surface-muted);
}

/* Shadow helpers */

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Rounded helpers */

.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

/* Status text helpers */

.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }

/*
End of base.css for playful, trustworthy Polish toy store
*/
