/* =============================================
   HERO SECTION
   Used on: hero.html, oferta-okna.html
   Note: oferta-okna overrides via .offer-page .hero in offer-page.css
   ============================================= */
.hero {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  /* Plaskie kremowe tlo — pomaranczowa poswiata w prawym gornym rogu
     (`radial-gradient(circle at 100% 0%, …0.45…)`) zostala usunieta 2026-08-08
     na zyczenie klienta, na WSZYSTKICH szerokosciach. Nie przywracaj jej tu
     ani w `.offer-page .hero` (offer-page.css) — to byla jedna poswiata
     powtorzona w trzech arkuszach. */
  background: var(--white);
  padding: 180px 24px 0;
  overflow: hidden;
}

/* Navbar wchodzi RAZEM z przyciskiem CTA (3. grupa kaskady hero, 0.9s).
   Ruszone WYLACZNIE `animation-delay` — `fadeInDown 0.6s ease-out both` zostaje
   w navbar.css nietkniete. Regula siedzi tu, a nie w navbar.css, bo dotyczy tylko
   strony glownej: `body.home` jest jedynie na hero.html, a hero.css i tak ladują
   tylko te strony. `.navbar--no-intro` / `.navbar--animated` uzywaja skrotu
   `animation: none`, ktory kasuje takze to opoznienie — czyli wejscie na strone
   przewinieta lub przez przejscie stron dziala jak dotad.
   UWAGA: `js/main.js` dodaje `.navbar--animated` (a ta klasa ZABIJA animacje)
   dopiero po 1600ms wlasnie z powodu tego opoznienia — patrz main.js v29. */
body.home .navbar {
  animation-delay: 0.9s;
}

.hero__container {
  max-width: var(--max-width-wide);
  width: 100%;
  margin: 20px auto 0;
  padding-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 60px;
}

/* Left column */
.hero__content {
  flex: 1;
  min-width: 0;
  position: relative;
  transform: translateY(8px);
  top: 8px;
}

.hero__heading {
  font-size: 66px;
  font-weight: 500;
  line-height: 1.15;
  color: var(--dark-gray);
  letter-spacing: -0.02em;
  margin-bottom: 28px;
  animation: fadeInLeft 0.7s ease-out 0.2s both;
}

/* Text rotator wrapper */
.hero__rotator {
  display: inline-block;
  position: relative;
  overflow: hidden;
  vertical-align: bottom;
  height: 1.15em;
}

.hero__rotator-word {
  display: block;
  background: var(--orange-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transform: translateY(100%);
  animation: none;
  will-change: transform, opacity;
  white-space: nowrap;
}

/* Hero CTA button — size overrides */
.hero .ihb--hero:not(.ihb--secondary) {
  font-size: 19px;
  padding: 18px 44px;
}

.hero .ihb--hero:not(.ihb--secondary) .ihb__circle {
  background-color: var(--white);
}

.hero__rotator-word.active {
  position: relative;
  animation: slideIn 0.5s ease-out forwards;
}

.hero__rotator-word.exit {
  animation: slideOut 0.5s ease-out forwards;
}

.hero__subheading {
  font-size: 18px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--gray-500);
  max-width: 500px;
  margin-bottom: 41px;
  animation: fadeInLeft 0.7s ease-out 0.55s both;
}

.hero__cta-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
  animation: fadeInLeft 0.7s ease-out 0.9s both;
}


/* =============================================
   TRUST BADGE
   ============================================= */
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 9px 0;
  background: transparent;
  border-radius: 6px;
  border: none;
  box-shadow: none;
  text-decoration: none;
  transition: opacity 0.2s ease;
  animation: fadeInLeft 0.7s ease-out 0.9s both;
}

.trust-badge:hover {
  opacity: 0.75;
}

.trust-badge:active {
  opacity: 0.6;
}

.trust-badge__arrow {
  color: var(--gray-500);
  transition: transform 0.2s ease;
}

.trust-badge:hover .trust-badge__arrow {
  transform: translateX(3px);
}

.trust-badge > svg:first-child {
  width: 19px;
  height: 19px;
}

.trust-badge__stars {
  display: flex;
  align-items: center;
  gap: 1px;
  font-size: 16px;
  line-height: 1;
  color: #FBBC04;
}

.trust-badge__rating {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark-gray);
  letter-spacing: -0.01em;
}

.trust-badge__reviews {
  font-size: 14px;
  color: var(--gray-500);
  font-weight: 400;
  white-space: nowrap;
}

.trust-badge__sep {
  width: 1px;
  height: 17px;
  background: #e0e0e0;
  flex-shrink: 0;
}

.trust-badge__clients {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #555;
  font-weight: 500;
  white-space: nowrap;
}

.trust-badge__check {
  width: 18px;
  height: 18px;
  background: #22c55e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Right column */
.hero__image {
  flex: 0 0 520px;
  position: relative;
  animation: slideInRight 0.7s ease-out 0.2s both;
}

.hero__image::before {
  display: none;
}

.hero__image-stack {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 576px;
  border-radius: 11px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.03);
}

.hero__image-photo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.hero__image-photo.active {
  opacity: 1;
}

/* =============================================
   PRODUCT OVERLAY — on hero image
   ============================================= */
.product-overlay {
  position: absolute;
  bottom: -24px;
  left: -28px;
  z-index: 2;
  background: #ffffff;
  border-radius: 10px;
  padding: 24px 32px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
  min-width: 210px;
  animation: fadeInLeft 0.7s ease-out 0.9s both;
}

.product-overlay__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 9px 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-500);
  transition: color 0.4s ease;
  cursor: pointer;
  text-decoration: none;
}

.product-overlay__item.active {
  color: var(--orange);
  font-weight: 600;
}

.product-overlay__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gray-500);
  flex-shrink: 0;
  transition: background 0.4s ease, transform 0.4s ease;
}

.product-overlay__item.active .product-overlay__dot {
  background: var(--orange-gradient);
  transform: scale(1.25);
}

.hero .show-mobile { display: none; }
.hero__heading-br { display: none; }

/* Strona glowna: "i" ma ZAWSZE zaczynac druga linie naglowka, niezaleznie od
   dlugosci slowa z rotatora (Okna vs Ogrodzenia). Dlatego <br> jest tu widoczny,
   a naturalne zawijanie go nie decyduje. Zawezone do body.home, bo te sama klase
   nosi <br> w naglowkach 19 stron oferty, gdzie lamie w calkiem innym miejscu. */
body.home .hero__heading-br { display: inline; }

/* =============================================
   BRANDS MARQUEE
   ============================================= */
.brands {
  width: 100%;
  overflow: hidden;
  padding: 24px 0 18px;
  margin-top: 24px;
  align-self: end;
  animation: fadeInLeft 0.7s ease-out 1.25s both;
  -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
}

.brands__label {
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  margin-bottom: 24px;
}

.brands__track {
  display: flex;
  width: max-content;
  animation: marquee 58.5s linear infinite;
  animation-play-state: paused;
  will-change: transform;
}

.brands.in-view .brands__track {
  animation-play-state: running;
}

/* Removed animation-play-state: paused — causes visual glitch in Safari
   (track snaps right on hover, left on unhover). Individual logo hover
   effects (grayscale → color) still work without pausing the marquee. */

.brands__item {
  flex-shrink: 0;
  padding: 0 38px;
  font-size: 34px;
  font-weight: 700;
  color: var(--dark-gray);
  opacity: 0.18;
  white-space: nowrap;
  line-height: 80px;
  letter-spacing: -0.01em;
  transition: opacity 0.3s ease;
}

.brands__item:hover {
  opacity: 0.45;
}

/* Brand logo images */
.brands__item--logo,
.brands__item--logo:hover {
  display: flex;
  align-items: center;
  opacity: 1;
}

.brands__item--logo img {
  height: 41px;
  width: auto;
  object-fit: contain;
  filter: grayscale(100%) brightness(0.082);
  opacity: 0.75;
  transition: filter 0.4s ease, opacity 0.4s ease;
}

.brands__item--logo:hover img {
  filter: grayscale(0%);
  opacity: 1;
}

/* Indywidualne rozmiary logo + kompensacja przezroczystych obwódek w plikach */
.brands__item--logo-baranski img { height: 84px; margin: 0 -15px; }
.brands__item--logo-agmar img { height: 65px; margin: 0 -14px; }
.brands__item--logo-wisniowski img { height: 88px; margin: 0 -25px; transform: translateY(4px); }
.brands__item--logo-drutex img { height: 41px; }
.brands__item--logo-polskone img { height: 50px; transform: translateY(4px); }
.brands__item--logo-wiked img { height: 59px; margin: 0 -7px; }
.brands__item--logo-aluprof img { height: 81px; margin: 0 -22px; transform: translateY(4px); }
.brands__item--logo-ambasador img { height: 130px; transform: translateY(-13px); margin: 0 -22px; }
.brands__item--logo-selt img { height: 114px; transform: translateY(11px); margin: 0 -14px; }
.brands__item--logo-dre img { height: 42px; margin: 0 -13px; }

/* =============================================
   RESPONSIVE — HERO
   ============================================= */
/* === Wide desktop (≤1200px) === */
@media (max-width: 1200px) {
  .hero__heading {
    font-size: 44px;
  }

  .hero__subheading {
    font-size: 16px;
  }

  .hero__image-stack {
    height: 456px;
  }

  .hero__image {
    flex: 0 0 400px;
  }

  .hero__container {
    gap: 40px;
  }
}

/* ---- Tablet (769–1024px) ---- */
@media (max-width: 1024px) {
  .hero {
    padding: 120px 24px 0;
    min-height: auto;
    grid-template-rows: auto auto auto;
    overflow: visible;
  }

  .hero__container {
    display: contents;
  }

  .hero .hide-mobile { display: none; }
  .hero .show-mobile { display: inline; }

  .hero__content {
    min-width: 0;
    text-align: center;
    order: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .brands {
    order: 2;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    max-height: 96px;
    margin-top: 8px;
    margin-bottom: 8px;
  }

  .brands__item {
    padding: 0 28px;
    line-height: 48px;
  }

  .brands__item--logo img {
    height: 36px;
  }

  .brands__item--logo-baranski img { height: 74px; }
  .brands__item--logo-agmar img { height: 57px; }
  .brands__item--logo-wisniowski img { height: 66px; }
  .brands__item--logo-drutex img { height: 36px; }
  .brands__item--logo-polskone img { height: 44px; }
  .brands__item--logo-wiked img { height: 51px; }
  .brands__item--logo-aluprof img { height: 70px; }
  .brands__item--logo-ambasador img { height: 114px; }
  .brands__item--logo-selt img { height: 100px; transform: translateY(12px); }
  .brands__item--logo-dre img { height: 37px; }

  .hero__image {
    order: 3;
    flex: none;
    width: 86%;
    max-width: 580px;
    margin: 0 auto;
  }

  .hero__image-stack {
    height: auto;
    aspect-ratio: 5 / 4;
  }

  .hero__heading {
    font-size: 44px;
    margin-bottom: 20px;
  }

  .hero__subheading {
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 28px;
  }

  .hero__cta-wrapper {
    justify-content: center;
  }

  .trust-badge {
    order: -1;
    align-self: center;
    margin-top: 0;
    margin-bottom: 16px;
    padding: 9px 0;
    background: transparent;
    border: none;
    box-shadow: none;
    gap: 14px;
  }

  .trust-badge::after {
    content: '';
    display: inline-block;
    width: 17px;
    height: 17px;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2.5 6H9.5M6.5 3L9.5 6L6.5 9' stroke='%23999' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
  }

  .trust-badge:hover::after {
    transform: translateX(3px);
  }

  .trust-badge svg:first-child {
    width: 20px;
    height: 20px;
  }

  .trust-badge__stars {
    font-size: 16px;
  }

  .trust-badge__rating {
    font-size: 16px;
  }

  .trust-badge__reviews {
    font-size: 15px;
  }

  .product-overlay {
    display: none;
  }
}

@media (max-width: 768px) {
  .hero {
    padding: 94px 20px 40px;
  }

  .hero__content {
    min-width: 0;
    text-align: left;
    align-items: flex-start;
  }

  /* Strona glowna: naglowek hero w TRZECH liniach, wysrodkowany i duzo wiekszy.
     Dwie pierwsze linie („Niezawodne" + rotator) ida pelnym rozmiarem, a ogon
     („i Terminowy Montaz") mniejszym — to jedyny uklad, ktory daje DUZY naglowek
     BEZ wymyslania nowego copy. Wszystko zawezone do body.home — 19 stron oferty
     ma tu zupelnie inny naglowek i te same klasy. */
  body.home .hero__content {
    text-align: center;
    align-items: center;
  }

  .hero__heading {
    font-size: 38px;
    line-height: 1.19;
    margin-bottom: 20px;
  }

  /* Trzecia linia: „i Terminowy Montaz". 0.64em to SUFIT wyliczony z pomiaru —
     przy bazie 50.7px (@390) daje 32.4px, a zmierzone maksimum dla tej frazy
     w kolumnie 350px to 35px, czyli ~7% zapasu. Podnoszac ten mnoznik albo
     wydluzajac fraze, przemierz sufit od nowa. */
  body.home .hero__heading-tail {
    display: block;
    font-size: 0.64em;
    line-height: 1.25;
    margin-top: 0.1em;
  }

  /* „Profesjonalny" wypada na telefonie — z nim fraza nie miesci sie w 0.64em. */
  body.home .hero__heading-line3 {
    display: none;
  }

  /* 13vw z sufitem 60px: zmierzone maksimum dla „Ogrodzenia" (najdluzsze slowo
     rotatora) to 45px @320, 57px @390, 63px @430 — clamp zostawia ~10% zapasu. */
  body.home .hero__heading {
    font-size: clamp(38px, 13vw, 60px);
    line-height: 1.15;
    text-align: center;
  }

  .hero__heading-line1,
  .hero__heading-line3 {
    display: block;
  }

  .hero__rotator {
    height: 1.19em;
  }

  body.home .hero__rotator {
    height: 1.15em;
  }

  .hero__heading-br,
  body.home .hero__heading-br {
    display: none;
  }

  .hero__subheading {
    font-size: 16px;
    max-width: 100%;
    margin-bottom: 20px;
  }

  .hero__cta-wrapper {
    justify-content: center;
    flex-wrap: nowrap;
    gap: 10px;
    width: 100%;
  }

  .hero__cta-wrapper .ihb--hero {
    font-size: 13px;
    padding: 11px 16px;
    white-space: nowrap;
    flex: 1;
  }

  .hero__cta-wrapper .ihb__circle {
    left: 4%;
  }

  body.home .trust-badge {
    align-self: center;
  }

  .trust-badge {
    align-self: flex-start;
    flex-wrap: nowrap;
    justify-content: flex-start;
    max-width: none;
    margin-top: 0;
    margin-bottom: 12px;
  }

  .trust-badge__sep {
    display: none;
  }

  body:not(.offer-page) .hero__image {
    display: none;
  }

  .brands__item {
    font-size: 16px;
    padding: 0 17px;
    line-height: 41px;
  }

  .brands__item--logo img {
    height: 34px;
  }

  .brands__item--logo-baranski img { height: 68px; }
  .brands__item--logo-agmar img { height: 53px; }
  .brands__item--logo-wisniowski img { height: 63px; }
  .brands__item--logo-drutex img { height: 34px; }
  .brands__item--logo-polskone img { height: 41px; }
  .brands__item--logo-wiked img { height: 48px; }
  .brands__item--logo-aluprof img { height: 67px; }
  .brands__item--logo-ambasador img { height: 107px; }
  .brands__item--logo-selt img { height: 94px; transform: translateY(12px); }
  .brands__item--logo-dre img { height: 34px; }

  .brands {
    padding: 0;
  }

  .brands__track {
    animation-duration: 30s;
  }

}

/* Small phones — TYLKO strony oferty. Strona glowna ma tu clamp() z bloku
   powyzej (13vw daje ~42px @320), wiec zejscie na 30px cofneloby cala zmiane. */
@media (max-width: 400px) {
  body:not(.home) .hero__heading {
    font-size: 30px;
  }
}
