/* ============================================================
   WŁASTAL — Design Tokens
   Źródło: design-system.md (wyekstrahowany z makiet v4)
   ============================================================ */
:root {
  /* Kolory główne */
  --navy:       #3E408F;
  --navy-deep:  #2A2C66;
  --red:        #EA3235;
  --red-deep:   #C82428;
  --yellow:     #FEF013;
  --yellow-deep:#D9CE0A;

  /* Neutralne ciemne */
  --black:      #14151C;
  --black-soft: #1F2129;
  --black-2:    #292B36;

  /* Tekst i linie */
  --ink:        #14151C;
  --steel:      #5C5E70;
  --line:       #E6E4DC;

  /* Jasne tła */
  --paper:      #FFFFFF;
  --bone:       #F6F4EC;
  --white:      #FFFFFF;

  /* Typografia */
  --serif: 'Barlow Condensed', Impact, sans-serif;
  --sans:  'Inter', system-ui, sans-serif;

  /* Animacje */
  --transition-fast: 0.2s ease;
  --transition-med:  0.3s ease;
  --transition-slow: 0.6s ease;
}

/* ============================================================
   RESET I BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; font-family: var(--sans); }

/* ============================================================
   LAYOUT
   ============================================================ */
.container {
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 28px;
}
section.block { padding: 90px 0; }
@media (max-width: 600px) { section.block { padding: 56px 0; } }

/* ============================================================
   TYPOGRAFIA — EYEBROW
   ============================================================ */
.eyebrow {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--red);
  font-weight: 800;
  margin-bottom: 16px;
  padding-left: 14px;
  border-left: 3px solid var(--red);
  line-height: 1.2;
}
.eyebrow::before { display: none; }
.eyebrow--yellow { color: var(--yellow); border-left-color: var(--yellow); }

/* ============================================================
   SECTION HEADER
   ============================================================ */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 44px;
  gap: 40px;
}
.section-header h2 {
  font-family: var(--serif);
  font-weight: 800;
  font-size: clamp(38px, 4.6vw, 58px);
  line-height: 0.98;
  color: var(--black);
  text-transform: uppercase;
}
.section-header h2 .y { background: var(--yellow); padding: 0 10px; }
.section-header p {
  color: var(--steel);
  margin-top: 14px;
  font-size: 16px;
  max-width: 560px;
  line-height: 1.6;
}
.section-link {
  color: var(--black);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 3px solid var(--yellow);
  padding-bottom: 4px;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.section-link:hover { color: var(--red); border-color: var(--red); }
@media (max-width: 1024px) { .section-header { flex-direction: column; align-items: flex-start; } }

/* ============================================================
   PRZYCISKI
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 24px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: all 0.22s ease;
  font-family: var(--sans);
  border-radius: 3px;
  text-decoration: none;
}
.btn-lg { padding: 17px 32px; font-size: 15px; }

.btn-cta {
  background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%);
  color: white;
  box-shadow: 0 4px 14px rgba(234,50,53,0.32);
  position: relative;
  overflow: hidden;
}
.btn-cta::before {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
  transition: left 0.5s;
}
.btn-cta:hover::before { left: 100%; }
.btn-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(234,50,53,0.42); color: white; }

.btn-yellow { background: var(--yellow); color: var(--black); }
.btn-yellow:hover { background: #FFF52B; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(254,240,19,0.45); color: var(--black); }

.btn-navy { background: var(--navy); color: white; }
.btn-navy:hover { background: var(--navy-deep); transform: translateY(-2px); color: white; }

.btn-black { background: var(--black); color: white; }
.btn-black:hover { background: var(--black-soft); transform: translateY(-2px); color: white; }

.btn-outline { background: transparent; color: white; border: 2px solid rgba(255,255,255,0.55); }
.btn-outline:hover { background: white; color: var(--black); border-color: white; }

.btn-ghost { background: white; color: var(--ink); border: 2px solid var(--line); }
.btn-ghost:hover { border-color: var(--black); }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: var(--steel);
  padding: 18px 0;
}
body:not(.home) .breadcrumb { padding-top: 46px; }
.breadcrumb a { color: var(--steel); transition: color var(--transition-fast); }
.breadcrumb a:hover { color: var(--navy); }
.breadcrumb .sep { opacity: 0.4; }
.breadcrumb .cur { color: var(--ink); font-weight: 600; }
@media (max-width: 1024px) {
  /* Wszystkie non-home breadcrumby: zawijanie do nowego wiersza, kompaktowy font */
  body:not(.home) .breadcrumb {
    flex-wrap: wrap;
    font-size: 12px;
    gap: 4px 5px;
    row-gap: 6px;
  }

  /* Breadcrumb samodzielny (w .container, NIE wewnątrz page-hero/info-hero) */
  .container > .breadcrumb {
    padding: 60px 14px 14px;
    margin-left: -28px;
    margin-right: -28px;
    flex-wrap: wrap;
    gap: 4px 5px;
    background: var(--bone);
    border-bottom: 1px solid var(--line);
  }

  /* Strona produktu — aktualna pozycja pogrubiona */
  .breadcrumb--product .bc-last { font-weight: 700; color: var(--navy); }
}

/* ============================================================
   PAGE HERO (lista produktów i podstrony)
   ============================================================ */
.page-hero {
  background: var(--black);
  color: white;
  position: relative;
  overflow: hidden;
}
.post-type-archive-product .page-hero,
.tax-product_cat .page-hero {
  background:
    linear-gradient(90deg, rgba(20,21,28,0.97) 0%, rgba(20,21,28,0.82) 50%, rgba(20,21,28,0.25) 100%),
    linear-gradient(180deg, rgba(20,21,28,0.08), rgba(20,21,28,0.72)),
    url('../images/page-headers/header-oferta.jpg') center/cover no-repeat,
    var(--black);
}
.page-hero::after {
  content: '';
  position: absolute;
  right: -80px; top: -80px;
  width: 320px; height: 320px;
  background: var(--yellow);
  opacity: 0.05;
  transform: rotate(45deg);
  pointer-events: none;
}
.page-hero-inner {
  max-width: 1340px;
  margin: 0 auto;
  padding: 48px 28px;
  position: relative;
  z-index: 2;
}
.page-hero h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 5vw, 64px);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 0.95;
  margin-bottom: 14px;
}
.page-hero h1 .y { color: var(--yellow); }
.page-hero p {
  font-size: 16px;
  color: rgba(255,255,255,0.7);
  max-width: 600px;
  line-height: 1.6;
}
.page-hero .breadcrumb { margin-bottom: 18px; }
.page-hero .breadcrumb, .page-hero .breadcrumb a { color: rgba(255,255,255,0.5); }
.page-hero .breadcrumb a:hover { color: var(--yellow); }
.page-hero .breadcrumb .cur { color: var(--yellow); }

/* ============================================================
   TRUST SEKCJA — premium redesign
   ============================================================ */
.trust {
  background: var(--black-soft);
  color: white;
  position: relative;
  overflow: hidden;
}

.trust::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(20,21,28,0.52), rgba(20,21,28,0.12) 46%, rgba(20,21,28,0.52)),
    linear-gradient(180deg, rgba(20,21,28,0.08), rgba(20,21,28,0.38)),
    url('../images/trust-section-bg.jpg');
  background-size: cover;
  background-position: center;
  z-index: 0;
}

/* ── Animowane tło ── */
.trust-bg { position: absolute; inset: 0; pointer-events: none; z-index: 1; }

/* Subtelna siatka diagonalna */
.trust-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: trustGridDrift 24s linear infinite;
}
@keyframes trustGridDrift {
  0%   { background-position: 0 0; }
  100% { background-position: 48px 48px; }
}

/* Plamki rozproszonego światła */
.trust-bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0;
  animation: trustGlowPulse 8s ease-in-out infinite;
}
.trust-bg-glow--1 {
  width: 420px; height: 280px;
  background: radial-gradient(ellipse, rgba(62,64,143,0.35) 0%, transparent 70%);
  top: -60px; left: 10%;
  animation-delay: 0s;
}
.trust-bg-glow--2 {
  width: 360px; height: 240px;
  background: radial-gradient(ellipse, rgba(254,240,19,0.12) 0%, transparent 70%);
  top: 20px; left: 50%;
  transform: translateX(-50%);
  animation-delay: 2.8s;
}
.trust-bg-glow--3 {
  width: 380px; height: 260px;
  background: radial-gradient(ellipse, rgba(62,64,143,0.28) 0%, transparent 70%);
  top: -40px; right: 8%;
  animation-delay: 5.2s;
}
@keyframes trustGlowPulse {
  0%, 100% { opacity: 0; transform: scale(0.9) translateY(0); }
  50%       { opacity: 1; transform: scale(1.08) translateY(-12px); }
}

/* ── Layout ── */
.trust-inner {
  max-width: 1340px;
  margin: 0 auto;
  padding: 72px 28px 80px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
  position: relative;
  z-index: 2;
}

/* ── Karta ── */
.trust-item {
  text-align: center;
  padding: 40px 24px 36px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  transition: background 0.3s ease;
}
/* Delikatna pionowa linia-separator */
.trust-item + .trust-item::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.08) 40%, rgba(255,255,255,0.08) 60%, transparent);
}
.trust-item:hover { background: rgba(62,64,143,0.08); }

/* ── Ikona ── */
.trust-icon {
  width: 52px; height: 52px;
  color: var(--yellow);
  margin-bottom: 18px;
  position: relative;
  flex-shrink: 0;
}
.trust-icon svg {
  width: 100%; height: 100%;
  display: block;
}
/* Halo za ikoną */
.trust-icon::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(254,240,19,0.12) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.35s;
}
.trust-item:hover .trust-icon::before { opacity: 1; }

/* ── Liczba ── */
.ti-num {
  font-family: var(--serif);
  font-size: 58px;
  font-weight: 800;
  color: var(--yellow);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  /* subtelne metaliczne highlight */
  text-shadow: 0 2px 12px rgba(254,240,19,0.22);
}

/* ── Etykieta ── */
.ti-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1.4;
  max-width: 120px;
}

/* ── Animate-in przy scroll ── */
.trust-item {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.55s ease, transform 0.55s ease, background 0.3s ease;
}
.trust-item.trust-visible {
  opacity: 1;
  transform: translateY(0);
}
.trust-item:nth-child(1) { transition-delay: 0s; }
.trust-item:nth-child(2) { transition-delay: 0.1s; }
.trust-item:nth-child(3) { transition-delay: 0.2s; }
.trust-item:nth-child(4) { transition-delay: 0.3s; }
.trust-item:nth-child(5) { transition-delay: 0.4s; }

@media (max-width: 1024px) {
  .trust-inner { grid-template-columns: repeat(3, 1fr); gap: 0; }
  .trust-item:nth-child(3)::before { display: none; }
}
@media (max-width: 600px) {
  .trust-inner { grid-template-columns: repeat(2, 1fr); }
  .trust-item:nth-child(2)::before { display: none; }
  .ti-num { font-size: 46px; }
}

/* ============================================================
   CONFIG SECTION (żółte CTA)
   ============================================================ */
.config {
  background:
    linear-gradient(90deg, rgba(20,21,28,0.82) 0%, rgba(20,21,28,0.58) 46%, rgba(20,21,28,0.82) 100%),
    linear-gradient(180deg, rgba(20,21,28,0.18), rgba(20,21,28,0.68)),
    url('../images/roofing-calculation-banner-1920x520.jpg') center/cover no-repeat;
  position: relative;
  overflow: hidden;
}
.config::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  opacity: 0.55;
  pointer-events: none;
}
.config::after {
  content: '';
  position: absolute;
  right: -100px; bottom: -100px;
  width: 340px; height: 340px;
  background: var(--yellow);
  opacity: 0.12;
  transform: rotate(45deg);
  pointer-events: none;
}
.config-inner {
  max-width: 1340px;
  margin: 0 auto;
  padding: 70px 28px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 50px;
  align-items: center;
  position: relative;
  z-index: 2;
}
.config .eyebrow { color: var(--yellow); border-left-color: var(--yellow); }
.config h2 {
  font-family: var(--serif);
  font-size: clamp(36px, 4.4vw, 56px);
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1;
  color: white;
  margin-bottom: 16px;
}
.config p { font-size: 16px; color: rgba(255,255,255,0.82); line-height: 1.6; max-width: 520px; }
.config-actions { display: flex; flex-direction: column; gap: 12px; }
.config .btn-black {
  background: var(--yellow);
  color: var(--black);
  border-color: var(--yellow);
}
.config .btn-outline {
  color: white;
  border-color: rgba(255,255,255,0.72);
}
.config .btn-outline:hover {
  background: white;
  color: var(--black);
}
@media (max-width: 1024px) { .config-inner { grid-template-columns: 1fr; gap: 28px; } }

/* ============================================================
   INSPIRACJE GRID
   ============================================================ */
.insp { background: var(--bone); }
.insp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.insp-card {
  background: white;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: all var(--transition-med);
  border-radius: 4px;
}
.insp-card:hover { transform: translateY(-5px); box-shadow: 0 18px 40px rgba(20,21,28,0.12); }
.insp-img { aspect-ratio: 4/3; background-size: cover; background-position: center; position: relative; }
.insp-img .tag {
  position: absolute;
  top: 14px; left: 14px;
  background: var(--black);
  color: white;
  font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 5px 11px;
}
.insp-body { padding: 22px; }
.insp-body h3 {
  font-family: var(--serif);
  font-size: 24px; font-weight: 700; text-transform: uppercase;
  color: var(--black); line-height: 1; margin-bottom: 6px;
}
.insp-body span { font-size: 13px; color: var(--steel); }
@media (max-width: 1200px) { .insp-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .insp-grid { grid-template-columns: 1fr; } }

/* ============================================================
   NEWS GRID
   ============================================================ */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.news-card {
  background: white;
  border: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-med);
  border-radius: 4px;
}
.news-card:hover { border-color: var(--black); transform: translateY(-4px); }
.news-img { aspect-ratio: 16/9; background-size: cover; background-position: center; position: relative; }
.news-img .cat {
  position: absolute; top: 14px; left: 14px;
  background: var(--yellow); color: var(--black);
  font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 5px 10px;
}
.news-img .cat.red { background: var(--red); color: white; }
.news-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.news-date { font-size: 12px; color: var(--steel); letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600; margin-bottom: 12px; }
.news-card h3 {
  font-family: var(--serif);
  font-size: 21px; font-weight: 700; text-transform: uppercase;
  color: var(--black); line-height: 1.05;
}

/* Karty bez zdjęcia (wpisy SEO z miejscowościami) */
.news-card--text {
  border-top: 3px solid var(--navy);
  box-shadow: 0 2px 10px rgba(20,21,28,0.04);
}
.news-card--text:hover { border-top-color: var(--navy); border-color: var(--navy); box-shadow: 0 12px 32px rgba(20,21,28,0.10); }
.news-card--text .news-body { padding: 28px 28px 24px; justify-content: space-between; gap: 14px; min-height: 160px; }
.news-loc-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--navy); background: rgba(62,64,143,0.08);
  padding: 4px 10px; border-radius: 2px;
  align-self: flex-start;
}
.news-card--text h3 {
  font-size: 18px; line-height: 1.25; flex: 1;
  margin: 0;
}
.news-card--text .news-card-arr {
  font-size: 12px; font-weight: 700; color: var(--navy);
  letter-spacing: 0.04em; align-self: flex-end;
  display: flex; align-items: center; gap: 5px;
}
.news-card--text .news-card-arr svg { transition: transform 0.2s; }
.news-card--text:hover .news-card-arr svg { transform: translateX(4px); }

/* Na stronie miejscowości — więcej kolumn bo karty są czysto tekstowe */
.news-grid--locality { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1200px) { .news-grid--locality { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 1024px) { .news-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px)  { .news-grid--locality { grid-template-columns: 1fr; } }

/* ============================================================
   PAGE CONTENT — szablon page.php i artykuły
   ============================================================ */
.page-content {
  max-width: 860px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
}
.page-content h2 {
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 800;
  text-transform: uppercase;
  margin: 48px 0 16px;
  color: var(--black);
}
.page-content h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  text-transform: uppercase;
  margin: 32px 0 12px;
  color: var(--navy);
}
.page-content p { margin-bottom: 18px; }
.page-content ul, .page-content ol {
  margin: 0 0 18px 24px;
}
.page-content li { margin-bottom: 8px; }
.page-content a { color: var(--navy); text-decoration: underline; }
.page-content a:hover { color: var(--red); }
.page-content strong { font-weight: 700; }
.page-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 14px;
}
.page-content th {
  background: var(--navy);
  color: white;
  padding: 10px 16px;
  text-align: left;
  font-family: var(--serif);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.05em;
}
.page-content td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
.page-content tr:nth-child(even) td { background: var(--bone); }

/* Plik do pobrania */
.file-download-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.file-download-row svg { flex-shrink: 0; color: var(--navy); }
.file-download-row .file-name { font-weight: 600; flex: 1; }
.file-download-row .btn { white-space: nowrap; }
