/* ========================================================================== 
   Variables
   ========================================================================== */

:root {
  /* Color palette - modern, tech-forward */
  --color-background: #050608; /* deep near-black */
  --color-surface: #0f1115; /* elevated surface */
  --color-surface-alt: #181b20;
  --color-text: #f5f5f7; /* primary text on dark */
  --color-text-muted: #a0a4af;
  --color-border-subtle: #252832;
  --color-border-strong: #383c47;

  --color-primary: #2f6bff; /* electric blue */
  --color-primary-soft: rgba(47, 107, 255, 0.15);
  --color-primary-strong: #1a4de0;

  --color-success: #28c977;
  --color-success-soft: rgba(40, 201, 119, 0.15);
  --color-warning: #ffb444;
  --color-warning-soft: rgba(255, 180, 68, 0.15);
  --color-danger: #ff4b5c;
  --color-danger-soft: rgba(255, 75, 92, 0.15);

  /* Neutral grays (graphite / metallic) */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5f5;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2933;
  --gray-900: #111827;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Roboto", "Segoe UI", sans-serif;
  --font-mono: "SF Mono", ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  /* Font sizes (rem) */
  --font-size-xs: 0.75rem;   /* 12px */
  --font-size-sm: 0.875rem;  /* 14px */
  --font-size-md: 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 */

  /* Line heights */
  --line-height-tight: 1.2;
  --line-height-snug: 1.35;
  --line-height-normal: 1.6;

  /* Spacing scale (px) converted to rem at 16px base */
  --space-0: 0;
  --space-4: 0.25rem;  /* 4px */
  --space-8: 0.5rem;   /* 8px */
  --space-12: 0.75rem; /* 12px */
  --space-16: 1rem;    /* 16px */
  --space-20: 1.25rem; /* 20px */
  --space-24: 1.5rem;  /* 24px */
  --space-32: 2rem;    /* 32px */
  --space-40: 2.5rem;  /* 40px */
  --space-48: 3rem;    /* 48px */
  --space-64: 4rem;    /* 64px */
  --space-80: 5rem;    /* 80px */
  --space-96: 6rem;    /* 96px */

  /* Radius */
  --radius-sm: 0.25rem;   /* 4px */
  --radius-md: 0.5rem;    /* 8px */
  --radius-lg: 0.75rem;   /* 12px */
  --radius-xl: 1rem;      /* 16px */
  --radius-full: 999px;

  /* Shadows - subtle, modern, layer-like */
  --shadow-sm: 0 6px 12px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 25px 60px rgba(0, 0, 0, 0.65);

  /* Transitions */
  --transition-fast: 120ms ease-out;
  --transition-base: 180ms cubic-bezier(0.22, 0.61, 0.36, 1);
  --transition-slow: 240ms cubic-bezier(0.22, 0.61, 0.36, 1);

  /* Layout */
  --container-max-width: 1200px;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-fast: 0ms;
    --transition-base: 0ms;
    --transition-slow: 0ms;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ========================================================================== 
   Reset / Normalize
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  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;
  padding-left: 0;
}

body {
  min-height: 100vh;
}

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

img {
  height: auto;
}

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

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

textarea {
  resize: vertical;
}

/* Remove default link underline */
a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

/* Improve text rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================================================== 
   Base Styles
   ========================================================================== */

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-md);
  line-height: var(--line-height-normal);
  background-color: var(--color-background);
  color: var(--color-text);
}

main {
  min-height: 60vh;
}

/* Headings - bold, high-contrast, modern scale */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

h1 {
  font-size: clamp(2.25rem, 1.8rem + 1.5vw, 3rem);
  letter-spacing: 0.02em;
  margin-bottom: var(--space-24);
}

h2 {
  font-size: clamp(1.875rem, 1.6rem + 0.8vw, 2.25rem);
  margin-bottom: var(--space-20);
}

h3 {
  font-size: clamp(1.5rem, 1.3rem + 0.5vw, 1.875rem);
  margin-bottom: var(--space-16);
}

h4 {
  font-size: var(--font-size-xl);
  margin-bottom: var(--space-12);
}

h5 {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-8);
}

h6 {
  font-size: var(--font-size-sm);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: var(--space-8);
  color: var(--color-text-muted);
}

p {
  margin-bottom: var(--space-16);
  }

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

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

strong {
  font-weight: 600;
}

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

/* Links - subtle default, clear hover */
a {
  color: var(--color-primary);
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

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

/* ========================================================================== 
   Accessibility & Focus States
   ========================================================================== */

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

:focus {
  outline: none;
}

/* Screen reader only utility */
.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;
}

/* ========================================================================== 
   Utilities
   ========================================================================== */

/* Container */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-16);
  padding-right: var(--space-16);
}

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

/* Flex utilities */
.flex {
  display: flex;
}

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

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

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

/* Grid utilities */
.grid {
  display: grid;
}

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

/* Spacing utilities (common subset) */
.mt-16 { margin-top: var(--space-16); }
.mb-16 { margin-bottom: var(--space-16); }
.mt-24 { margin-top: var(--space-24); }
.mb-24 { margin-bottom: var(--space-24); }
.mt-32 { margin-top: var(--space-32); }
.mb-32 { margin-bottom: var(--space-32); }

.pt-16 { padding-top: var(--space-16); }
.pb-16 { padding-bottom: var(--space-16); }
.pt-24 { padding-top: var(--space-24); }
.pb-24 { padding-bottom: var(--space-24); }
.pt-32 { padding-top: var(--space-32); }
.pb-32 { padding-bottom: var(--space-32); }

/* Text utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--color-text-muted); }

/* Width utilities */
.w-100 { width: 100%; }

/* ========================================================================== 
   Components
   ========================================================================== */

/* Buttons - modern, high contrast */
.button,
button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  font-weight: 500;
  font-size: var(--font-size-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  background: var(--color-primary);
  color: #ffffff!important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02), var(--shadow-sm);
  transition:
    background-color var(--transition-base),
    box-shadow var(--transition-base),
    transform var(--transition-fast),
    border-color var(--transition-fast),
    color var(--transition-fast),
    opacity var(--transition-fast);
}

.button:hover,
button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover {
  background: var(--color-primary-strong);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(47, 107, 255, 0.4), var(--shadow-md);
}

.button:active,
button:active,
input[type="button"]:active,
input[type="submit"]:active,
input[type="reset"]:active {
  transform: translateY(0);
  box-shadow: 0 0 0 1px rgba(47, 107, 255, 0.25), var(--shadow-sm);
}

.button:disabled,
button:disabled,
input[type="button"]:disabled,
input[type="submit"]:disabled,
input[type="reset"]:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

/* Ghost / secondary button variant */
.button--ghost {
  background: transparent;
  color: var(--color-text)!important;
  border-color: var(--color-border-strong);
  box-shadow: none;
}

.button--ghost:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-primary);
}

/* Inputs & form controls */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
  background-color: #080a0e;
  color: var(--color-text);
  outline: none;
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast);
}

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

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px rgba(47, 107, 255, 0.4), 0 14px 30px rgba(0, 0, 0, 0.6);
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Card - for products & content blocks */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top left, rgba(47, 107, 255, 0.15), transparent 55%),
              var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-20);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    border-color var(--transition-fast),
    background var(--transition-slow);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(47, 107, 255, 0.5);
}

.card__header {
  margin-bottom: var(--space-16);
}

.card__body {
  flex: 1 1 auto;
}

.card__footer {
  margin-top: var(--space-16);
}

/* Badge - useful for promo labels (e.g., "Nowość", "Bestseller") */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

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

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

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

/* Simple tag-like pill for filters */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-subtle);
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  background-color: rgba(15, 17, 21, 0.95);
  cursor: pointer;
  transition:
    border-color var(--transition-fast),
    background-color var(--transition-fast),
    color var(--transition-fast),
    box-shadow var(--transition-fast);
}

.pill--active,
.pill:hover {
  border-color: var(--color-primary);
  background-color: var(--color-primary-soft);
  color: var(--color-text);
  box-shadow: 0 0 0 1px rgba(47, 107, 255, 0.25);
}

/* Price emphasis */
.price {
  font-size: var(--font-size-2xl);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.price--old {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  text-decoration: line-through;
}

/* ========================================================================== 
   Media & Imagery
   ========================================================================== */

/* Responsive, contained product imagery */
.img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.img-contain {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Utility for high-resolution hero imagery */
.hero-media {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 10% 0%, rgba(47, 107, 255, 0.35), transparent 50%),
              radial-gradient(circle at 90% 100%, rgba(148, 163, 184, 0.4), transparent 55%);
  mix-blend-mode: soft-light;
  pointer-events: none;
}

/* ========================================================================== 
   Scrollbars (WebKit) - subtle for modern feel
   ========================================================================== */

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: #050608;
}

*::-webkit-scrollbar-thumb {
  background: #262a33;
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: #333846;
}
