/* =========================================================
   JAR — Design system
   Odświeżenie marki: fiolet + pomarańcz, nowocześniej.
   Mobile-first. Tokeny -> komponenty -> dark mode.
   ========================================================= */

/* ---------- 1. Tokeny ---------- */
:root {
  /* Marka */
  --violet-900: #3c2f61;
  --violet-800: #54268f;
  --violet-700: #672faf;
  --violet-400: #9484c3;
  --violet-200: #cac1e1;

  --orange-800: #e09443;
  --orange-700: #e4a15a;
  --orange-400: #f0caa1;

  /* Neutralne */
  --white: #ffffff;
  --gray-50: #f7f7f9;
  --gray-100: #e9e9ee;
  --gray-300: #bfbfbf;
  --gray-500: #606060;
  --gray-700: #303036;
  --gray-900: #1b1b20;

  /* Gradient marki */
  --brand-gradient: linear-gradient(120deg, var(--violet-800) 0%, var(--violet-700) 55%, var(--orange-800) 130%);

  /* Tokeny semantyczne (light) */
  --bg: var(--white);
  --surface: var(--gray-50);
  --text: var(--gray-900);
  --text-muted: var(--gray-500);
  --border: var(--gray-100);
  --brand: var(--violet-800);
  --accent: var(--orange-800);
  --accent-hover: var(--orange-700);
  --nav-bg: rgba(28, 21, 46, 0.85);
  --nav-text: var(--white);
  --footer-bg: var(--violet-900);
  --footer-text: rgba(255, 255, 255, 0.65);
  --footer-text-hover: var(--white);

  /* Typografia — płynna */
  --font: 'Roboto', system-ui, -apple-system, sans-serif;
  --fs-h1: clamp(2rem, 5vw, 3.25rem);
  --fs-h2: clamp(1.6rem, 3.5vw, 2.5rem);
  --fs-h3: clamp(1.2rem, 2.2vw, 1.5rem);
  --fs-body: clamp(1rem, 1.4vw, 1.125rem);
  --fs-small: 0.875rem;

  /* Skala odstępów */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;
  --space-7: 6rem;

  /* Promienie, cienie, ruch */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.18);
  --transition: 0.25s ease;

  --nav-height: 72px;
  --container: 1200px;
}

/* Dark mode */
[data-theme='dark'] {
  --bg: #18181b;
  --surface: #232328;
  --text: #ededf0;
  --text-muted: #a9a9b2;
  --border: #2e2e35;
  --brand: var(--violet-400);
  --nav-bg: rgba(12, 9, 20, 0.9);
  --footer-bg: #100d18;
}

/* ---------- 2. Reset / baza ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 300;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  transition: background-color var(--transition), color var(--transition);
}

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

a {
  text-decoration: none;
  color: inherit;
}

h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
  color: var(--text);
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

::selection {
  background: var(--accent);
  color: var(--white);
}

/* Pasek przewijania */
body::-webkit-scrollbar { width: 10px; }
body::-webkit-scrollbar-thumb {
  background: var(--violet-700);
  border-radius: 5px;
}

/* ---------- 3. Layout / kontener ---------- */
main {
  min-height: 60vh;
  padding-top: var(--nav-height);
}

.section-container {
  max-width: var(--container);
  margin-inline: auto;
  padding: var(--space-6) var(--space-4);
}

.section-container > h1,
.section-container > h2 {
  margin-bottom: var(--space-3);
}

.section-container > p {
  color: var(--text-muted);
  max-width: 65ch;
}

/* ---------- 4. Przyciski ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.7rem 1.4rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--white);
  font-family: inherit;
  font-size: var(--fs-small);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.btn--ghost {
  background: transparent;
  border: 2px solid currentColor;
  color: var(--brand);
}

.btn--ghost:hover {
  background: var(--brand);
  color: var(--white);
}

/* ---------- 5. Nawigacja ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-inline: var(--space-4);
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  z-index: 999;
}

.nav-logo {
  height: calc(var(--nav-height) - 24px);
  width: auto;
}

.nav-container {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.nav-menu {
  display: flex;
  gap: var(--space-4);
  list-style: none;
}

.nav-menu a {
  color: var(--nav-text);
  font-size: var(--fs-small);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.nav-menu a:hover {
  color: var(--orange-700);
}

.nav-menu li.active a {
  color: var(--orange-700);
  border-bottom-color: var(--orange-700);
}

/* Przełącznik dark mode — pigułka */
.dark-switch {
  position: relative;
  width: 52px;
  height: 28px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
  transition: background var(--transition);
}

.dark-switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--orange-700);
  transition: transform var(--transition);
}

[data-theme='dark'] .dark-switch-thumb {
  transform: translateX(24px);
  background: var(--violet-200);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
}

.hamburger span {
  display: block;
  height: 3px;
  border-radius: 2px;
  background: var(--nav-text);
  transition: transform var(--transition), opacity var(--transition);
}

.nav--open .hamburger span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
.nav--open .hamburger span:nth-child(2) { opacity: 0; }
.nav--open .hamburger span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

/* ---------- 6. Stopka ---------- */
.footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding: var(--space-6) var(--space-4) var(--space-4);
}

.footer-container {
  max-width: var(--container);
  margin-inline: auto;
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}

.footer-logo {
  height: 60px;
  width: auto;
}

.footer h4 {
  color: var(--white);
  margin-bottom: var(--space-2);
}

.footer-col p {
  font-size: var(--fs-small);
  margin-bottom: var(--space-1);
}

.footer-col a {
  color: var(--footer-text);
  transition: color var(--transition);
}

.footer-col a:hover {
  color: var(--footer-text-hover);
}

/* ---------- 7. Modal cookies ---------- */
.cookie-modal {
  position: fixed;
  bottom: var(--space-4);
  left: 50%;
  transform: translateX(-50%);
  width: min(92%, 560px);
  z-index: 1000;
}

.cookie-modal.hidden {
  display: none;
}

.cookie-modal-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-small);
}

.cookie-modal-box a {
  color: var(--accent);
  font-weight: 700;
}

.cookie-modal-box button {
  margin-left: auto;
  padding: 0.5rem 1.2rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--white);
  font-weight: 700;
  cursor: pointer;
}

/* ---------- 8. Dostępność ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 9. Responsywność (desktop) ---------- */
@media (min-width: 768px) {
  .footer-container {
    grid-template-columns: auto 1fr 1fr 1fr;
    align-items: start;
  }
}

/* Mobile: menu chowane pod hamburger */
@media (max-width: 767px) {
  .hamburger {
    display: flex;
  }

  .nav-container {
    position: fixed;
    inset: var(--nav-height) 0 auto 0;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-5) var(--space-4);
    /* Prawie pełne krycie — rozwijane menu musi być czytelne nad treścią. */
    background: var(--violet-900);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform var(--transition);
  }

  [data-theme='dark'] .nav-container {
    background: var(--footer-bg);
  }

  .nav--open .nav-container {
    transform: translateX(0);
  }

  .nav-menu {
    flex-direction: column;
    width: 100%;
    text-align: center;
    gap: var(--space-3);
  }
}

/* =========================================================
   KOMPONENTY STRON (Etap 2)
   ========================================================= */

/* ---------- Hero ---------- */
.hero {
  background: var(--brand-gradient);
  color: var(--white);
  padding: var(--space-7) var(--space-4) var(--space-6);
  text-align: center;
}

.hero-inner {
  max-width: 780px;
  margin-inline: auto;
}

.hero h1 {
  color: var(--white);
  margin-bottom: var(--space-3);
}

.hero-lead {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  opacity: 0.92;
  margin-bottom: var(--space-4);
}

/* ---------- Slider kategorii ---------- */
.slider {
  position: relative;
  max-width: var(--container);
  margin: var(--space-5) auto 0;
  padding-inline: var(--space-5);
}

.slider-track {
  display: flex;
  gap: var(--space-3);
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: var(--space-2);
}

.slider-track::-webkit-scrollbar {
  display: none;
}

.slide {
  flex: 0 0 80%;
  scroll-snap-align: start;
}

.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  height: 100%;
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius);
  color: var(--white);
  backdrop-filter: blur(4px);
  transition: background var(--transition), transform var(--transition);
}

.cat-card:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-4px);
}

.cat-card-icon svg {
  width: 56px;
  height: 56px;
}

.cat-card-name {
  font-weight: 700;
  text-align: center;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--white);
  color: var(--violet-800);
  font-size: 1.6rem;
  line-height: 1;
  box-shadow: var(--shadow);
  cursor: pointer;
  z-index: 2;
}

.slider-btn--prev { left: 0; }
.slider-btn--next { right: 0; }

/* ---------- Sekcja alternatywna ---------- */
.section-container--alt {
  background: var(--surface);
  max-width: none;
  padding-inline: max(var(--space-4), calc((100% - var(--container)) / 2));
}

/* ---------- Karty wartości (poznaj nas) ---------- */
.values-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(2, 1fr);
  margin: var(--space-5) 0;
}

.value-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.value-icon {
  color: var(--brand);
}

.value-icon svg {
  width: 48px;
  height: 48px;
}

.value-card h3 {
  font-size: 1.1rem;
}

/* ---------- Grid produktów (kategorie) ---------- */
.products-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(2, 1fr);
  margin-top: var(--space-5);
}

.product-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-4);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.product-cat:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}

.product-cat-icon {
  color: var(--brand);
}

.product-cat-icon svg {
  width: 64px;
  height: 64px;
}

.product-cat h3 {
  font-size: 1.15rem;
  text-align: center;
}

/* ---------- Nagłówek podstrony ---------- */
.page-header {
  background: var(--brand-gradient);
  color: var(--white);
  padding: var(--space-6) var(--space-4) var(--space-5);
}

.page-header h1 {
  color: var(--white);
}

.page-header .hero-lead {
  margin-bottom: 0;
  /* Nadpisuje szary `.section-container > p` — na gradiencie musi być biały. */
  color: var(--white);
}

/* ---------- Wiersze „O nas" ---------- */
.about-row {
  padding: var(--space-6) var(--space-4);
}

.about-row:nth-child(even) {
  background: var(--surface);
}

.about-row-inner {
  display: grid;
  gap: var(--space-4);
  align-items: center;
  grid-template-columns: 1fr;
}

.about-icon {
  color: var(--brand);
  display: flex;
  justify-content: center;
}

.about-icon svg {
  width: 80px;
  height: 80px;
}

.about-text h2 {
  margin-bottom: var(--space-3);
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}

/* ---------- Kontakt ---------- */
.contact-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
  margin-top: var(--space-4);
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4);
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.contact-icon {
  color: var(--accent);
}

.contact-card h3 {
  font-size: 1.05rem;
}

.contact-card a {
  color: var(--brand);
  font-weight: 700;
}

.map-container {
  margin-top: var(--space-3);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.map-container iframe {
  display: block;
  width: 100%;
  height: 420px;
  border: 0;
}

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

.privacy-link a {
  color: var(--accent);
  font-weight: 700;
}

/* ---------- Polityka cookies / treść prawna ---------- */
.legal {
  max-width: 820px;
}

.legal h2 {
  font-size: 1.4rem;
  margin: var(--space-5) 0 var(--space-2);
}

.legal ul {
  padding-left: var(--space-4);
  margin-bottom: var(--space-3);
}

.legal li {
  margin-bottom: var(--space-2);
  color: var(--text-muted);
}

.legal .accent,
.accent {
  color: var(--accent);
  font-weight: 500;
}

/* ---------- Responsywność komponentów ---------- */
@media (min-width: 600px) {
  .slide { flex-basis: 45%; }
}

@media (min-width: 768px) {
  .slide { flex-basis: 31%; }

  .values-grid { grid-template-columns: repeat(4, 1fr); }
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .contact-grid { grid-template-columns: repeat(2, 1fr); }

  .about-row-inner {
    grid-template-columns: 160px 1fr;
    gap: var(--space-5);
  }

  /* Odwrócony wiersz: szablon kolumn też musi się odwrócić,
     inaczej tekst wpada w wąską kolumnę ikony. */
  .about-row--reverse .about-row-inner {
    grid-template-columns: 1fr 160px;
  }

  .about-row--reverse .about-icon { order: 2; }
}

@media (min-width: 1024px) {
  .contact-grid { grid-template-columns: repeat(4, 1fr); }
}

/* =========================================================
   PRODUKTY (Etap 3)
   ========================================================= */
.product-category {
  /* Kotwica z menu nie chowa się pod przyklejoną nawigacją. */
  scroll-margin-top: calc(var(--nav-height) + var(--space-3));
}

.product-category > p {
  margin-bottom: var(--space-4);
  color: var(--text-muted);
}

.category-empty {
  color: var(--text-muted);
  font-style: italic;
}

.product-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}

.product-card {
  display: flex;
  flex-direction: column;
  padding-bottom: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.product-card-img {
  display: flex;
  align-items: center;
  justify-content: center;
  /* Stała wysokość -> wszystkie karty mają identyczne miejsce na zdjęcie. */
  height: 220px;
  padding: var(--space-3);
  /* Czyste tło dla zdjęć produktów — czytelne też w dark mode. */
  background: #fff;
}

/* <picture> musi wypełnić ramkę, bo to względem niego liczy się rozmiar <img>. */
.product-card-img picture {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.product-card-img img {
  /* Wypełnia całą ramkę (skaluje też w górę), zachowując proporcje. */
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Placeholder, gdy produkt nie ma jeszcze zdjęcia. */
.product-no-img {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--gray-300);
  font-size: var(--fs-small);
}

.product-no-img svg {
  width: 56px;
  height: 56px;
}

.product-card h3 {
  font-size: 1.15rem;
  padding: var(--space-3) var(--space-3) 0;
}

.product-desc {
  flex-grow: 1;
  padding: var(--space-2) var(--space-3);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.product-meta {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  /* Linia oddzielająca dane techniczne od opisu — lepsza czytelność. */
  margin: var(--space-3) var(--space-3) 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  font-size: 1rem;
}

.product-meta li {
  font-weight: 700;
}

.product-meta span {
  display: block;
  margin-bottom: 2px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.product-certs {
  padding: var(--space-3) var(--space-3) 0;
  font-size: var(--fs-small);
}

.product-certs a {
  color: var(--accent);
  font-weight: 700;
}

@media (min-width: 600px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 992px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}

/* =========================================================
   PRZYCISK „POWRÓT NA GÓRĘ"
   ========================================================= */
.back-to-top {
  position: fixed;
  right: var(--space-4);
  bottom: var(--space-4);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  box-shadow: var(--shadow);
  cursor: pointer;
  z-index: 900;
  /* Domyślnie ukryty — pojawia się po przewinięciu (klasa .visible z JS). */
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity var(--transition), visibility var(--transition),
              transform var(--transition), background var(--transition);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent-hover);
  transform: translateY(-3px);
}
