/* ---------- Zmienne ---------- */
:root {
  --gray-900: #262422;
  --gray-800: #3a3733;
  --gray-700: #57534d;
  --gray-500: #8a857e;
  --gray-300: #d8d3cc;
  --gray-200: #e8e4dd;
  --gray-100: #f4f1ec;
  --white: #ffffff;

  --accent: #c17a45;
  --accent-dark: #a3612f;
  --accent-light: #f0ded0;

  --font:
    system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --max-width: 1180px;
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--white);
  line-height: 1.55;
}

h1,
h2,
h3 {
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.6em;
}

h2 {
  font-size: 1.9rem;
}

h3 {
  font-size: 1.2rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: inherit;
}

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

section[id] {
  scroll-margin-top: 84px;
}

.section {
  padding: 4rem 0;
}

.section-alt {
  background: var(--gray-100);
}

.section-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.section-intro {
  max-width: 62ch;
  color: var(--gray-700);
  font-size: 1.05rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
  border: 1px solid var(--accent);
}

.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.btn-secondary {
  background: transparent;
  color: var(--gray-900);
  border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
  border-color: var(--gray-900);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo img {
  height: 65px;
  width: auto;
}

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 18px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 110;
}

.hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--gray-900);
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.hamburger[aria-expanded='true'] span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger[aria-expanded='true'] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded='true'] span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

.main-nav {
  position: fixed;
  top: 0;
  right: 0;
  height: 80vh;
  width: min(78vw, 320px);
  background: var(--white);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 5.5rem 1.5rem 2rem;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.08);
}

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

.nav-link {
  display: block;
  padding: 0.75rem 0;
  text-decoration: none;
  color: var(--gray-800);
  font-weight: 600;
  border-bottom: 1px solid var(--gray-200);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--gray-800);
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-content {
  position: relative;
  z-index: 2;
  color: var(--white);
  padding: 2.5rem 1.25rem;
  width: 100%;
  background: linear-gradient(
    to top,
    rgba(20, 18, 16, 0.75),
    rgba(20, 18, 16, 0)
  );
}

.hero-content h1 {
  font-size: 2rem;
  max-width: 18ch;
}

.hero-subtitle {
  max-width: 46ch;
  font-size: 1.05rem;
  color: var(--gray-200);
}

/* ---------- Benefits grid ---------- */
.benefits-grid {
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.benefit-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.benefit-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.4em;
}

.benefit-card p {
  margin: 0;
  color: var(--gray-700);
  font-size: 0.95rem;
}

.benefit-card--featured {
  grid-column: 1 / -1;
  background: var(--accent-light);
  border-color: var(--accent);
}

.benefit-card--featured h3 {
  font-size: 1.3rem;
  color: var(--accent-dark);
}

.benefit-card--featured p {
  color: var(--gray-800);
  font-size: 1rem;
}

/* ---------- Product cards ---------- */
.product-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.product-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-card-image {
  aspect-ratio: 7 / 5;
  width: 100%;
  overflow: hidden;
  background: var(--gray-200);
  position: relative;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-image {
  width: 100%;
  height: 100%;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.75);
  color: var(--gray-900);
  font-size: 1.5rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.gallery-arrow:hover {
  background: var(--white);
}

.gallery-arrow--prev {
  left: 0.5rem;
}

.gallery-arrow--next {
  right: 0.5rem;
}

.gallery-dots {
  position: absolute;
  bottom: 0.6rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.4rem;
}

.gallery-dot {
  width: 9px;
  height: 9px;
  border: none;
  border-radius: 50%;
  padding: 0;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.gallery-dot.is-active {
  background: var(--accent);
}

.is-hidden {
  display: none;
}

.product-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.product-card-body h4 {
  margin: 0;
  font-size: 1.1rem;
}

.product-card-body p {
  margin: 0;
  color: var(--gray-700);
  font-size: 0.95rem;
}

.product-applications {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--gray-700);
  font-size: 0.9rem;
}

.product-dimensions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.85rem;
  color: var(--gray-700);
  border-top: 1px solid var(--gray-200);
  padding-top: 0.75rem;
}

.product-dimensions dt {
  display: inline;
  font-weight: 600;
  color: var(--gray-900);
}

.product-dimensions dt::after {
  content: ': ';
}

.product-dimensions dd {
  display: inline;
  margin: 0;
}

.product-dimensions .dim-pair {
  white-space: nowrap;
}

/* ---------- Color picker ---------- */
.color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--gray-300);
}

.color-swatch.is-active {
  border-color: var(--gray-900);
  box-shadow:
    0 0 0 1px var(--white),
    0 0 0 3px var(--gray-900);
}

.color-name {
  font-size: 0.85rem;
  color: var(--gray-700);
  margin-top: 0.35rem;
}

/* ---------- Documents ---------- */
.documents-grid {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.document-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--gray-900);
  font-weight: 600;
  transition: border-color 0.15s ease;
}

.document-link:hover {
  border-color: var(--accent);
}

.document-link .download-hint {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--accent-dark);
  white-space: nowrap;
}

/* ---------- Dystrybutorzy ---------- */
.province-heading {
  margin: 2rem 0 1rem;
  color: var(--gray-800);
}

#distributors-list > .province-heading:first-child {
  margin-top: 0;
}

.distributors-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.distributor-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.distributor-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Wyższa specyficzność niż samo .image-fallback, żeby brakujące logo
   nie rozciągało się na 100% i nie zasłaniało sąsiedniej wizytówki. */
.distributor-logo.image-fallback {
  width: 64px;
  height: 64px;
  min-height: 0;
  padding: 0.25rem;
  font-size: 0.55rem;
  line-height: 1.15;
}

.distributor-info {
  min-width: 0;
}

.distributor-info p {
  margin: 0.2rem 0;
  font-size: 0.9rem;
  color: var(--gray-700);
  overflow-wrap: break-word;
}

.distributor-name {
  font-weight: 700;
  color: var(--gray-900);
  font-size: 1.05rem;
  margin-bottom: 0.35rem !important;
}

.distributor-info a {
  text-decoration: none;
  color: var(--accent-dark);
  font-weight: 600;
}

.distributors-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
  text-align: center;
}

.distributors-footer h3 {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--gray-800);
  margin: 0;
}

.distributors-footer a {
  text-decoration: none;
  color: var(--accent-dark);
  font-weight: 700;
}

.distributors-footer a:hover {
  color: var(--accent);
}

/* ---------- Producent ---------- */
.producer-logo {
  width: 100px;
  height: 100px;
  object-fit: contain;
  flex-shrink: 0;
}

.producer-layout {
  margin-top: 1.5rem;
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 2rem;
}

.producer-messages {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.producer-message h3 {
  margin-bottom: 0.4em;
}

.producer-message p {
  margin: 0;
  color: var(--gray-700);
}

.producer-message a {
  text-decoration: none;
  color: var(--accent-dark);
  font-weight: 600;
}

.producer-message a:hover {
  color: var(--accent);
}

/* ---------- Image fallback ---------- */
.image-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 120px;
  background: var(--gray-200);
  color: var(--gray-700);
  font-size: 0.8rem;
  text-align: center;
  padding: 0.75rem;
  border-radius: var(--radius);
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: break-word;
}

.hero-image.image-fallback {
  position: absolute;
  inset: 0;
  border-radius: 0;
}

.product-card-image .image-fallback {
  min-height: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 2.5rem 0;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
  font-size: 0.9rem;
}

.footer-documents {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 1rem 0;
}

.footer-documents a {
  color: var(--gray-300);
  text-decoration: underline;
}

.footer-company {
  color: var(--gray-500);
}

/* ---------- Desktop breakpoint ---------- */
@media (min-width: 768px) {
  .hamburger {
    display: none;
  }

  .main-nav {
    position: static;
    height: auto;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 1.75rem;
    padding: 0;
    transform: none;
    box-shadow: none;
    background: transparent;
  }

  .nav-link {
    padding: 0;
    border-bottom: none;
    font-weight: 500;
  }

  .nav-link:hover {
    color: var(--accent-dark);
  }

  .hero {
    min-height: 560px;
  }

  .hero-content h1 {
    font-size: 2.75rem;
  }

  .benefits-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .benefit-card--featured {
    grid-column: span 2;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .documents-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .distributors-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .distributor-card {
    flex-direction: row;
    align-items: flex-start;
    gap: 1.5rem;
  }

  .producer-layout {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
}

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

  .distributors-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
