/* ============================================================
   Strona produktu (single) — szablon woocommerce/content-single-product.php
   Layout wg mockupu „Collibre Produkt standalone": galeria + info + blok zakupu.
   F1: górna sekcja + 3 karty zakupu. (Sekcje treści F3.)
   ============================================================ */

.tech-product,
.tech-product__crumbs {
  max-width: var(--tech-container);
  margin-inline: auto;
  padding-inline: var(--tech-gutter);
}

/* ---- Breadcrumbs (Start / Sklep / Produkt) ----
   Wygląd = components/breadcrumbs.css (WC breadcrumb ma teraz klasę .tech-breadcrumbs).
   Offset od navbara daje padding-top kontenera .ast-woocommerce-container (sklep.css) — tak jak
   na sklepie i sekcji hero stron page-builder. Tu wrapper okruszków ma padding-top:0 (żeby nie
   zdublować z paddingiem kontenera). Odstęp DO treści pod spodem daje margin-bottom nawigacji
   (breadcrumbs.css: .tech-breadcrumbs.woocommerce-breadcrumb → 1.5rem), tu bez własnego marginesu. */
.tech-product__crumbs { padding-top: 0; }

/* ---- Górna sekcja: galeria | info ---- */
.tech-product__top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  padding-block: 2.5rem;
}
@media (min-width: 1024px) {
  .tech-product__top { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4rem; align-items: start; }
}

/* Galeria — WŁASNA (bez galerii Astry/WC): główne zdjęcie + rząd 4 miniatur.
   UWAGA: Astra wiesza kwadratowy box-shadow na `figure` i `img:not(figure img)`
   (.ast-article-single …) — daje białe/szare rogi pod zaokrągleniem. Zerujemy. */
.tech-gallery__main {
  margin: 0;
  line-height: 0;
  border-radius: var(--tech-radius-lg);
  overflow: hidden;
  box-shadow: none !important;
}
.tech-gallery__main-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--tech-radius-lg);
  display: block;
  box-shadow: none !important;
}
.tech-gallery__thumb img { box-shadow: none !important; }
.tech-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .75rem;
  margin-top: .75rem;
}
.tech-gallery__thumb {
  padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: var(--tech-radius); overflow: hidden; line-height: 0;
  transition: box-shadow .2s;
}
.tech-gallery__thumb img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--tech-radius);
  display: block;
  opacity: .6;
  transition: opacity .2s;
}
.tech-gallery__thumb:hover img,
.tech-gallery__thumb.is-active img { opacity: 1; }
.tech-gallery__thumb.is-active { box-shadow: 0 0 0 2px var(--tech-ink); }

@media (min-width: 1024px) {
  .tech-product__gallery { position: sticky; top: 6rem; }
}

/* ---- Info ---- */
.tech-product__rating-wrap { margin-bottom: 1rem; }
.tech-product__rating-wrap .tech-produkt__rating { width: 150px; height: 24px; border: 0; }

.tech-product__title {
  margin: 0 0 1rem;
  font-size: clamp(1.875rem, 3.5vw, 2.5rem);
  font-weight: var(--tech-fw-bold);
  letter-spacing: var(--tech-tracking-tight);
  color: var(--tech-ink);
  line-height: var(--tech-lh-snug);
}
.tech-product__lead {
  margin: 0 0 1.5rem;
  color: var(--tech-slate);
  font-size: var(--tech-fs-lg);
  line-height: var(--tech-lh-normal);
}
.tech-product__lead p { margin: 0; }

/* Mini-cechy (pigułki) */
.tech-product__mini { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.tech-product__mini-item {
  font-size: var(--tech-fs-sm);
  font-weight: var(--tech-fw-medium);
  color: var(--tech-ink);
  background: var(--tech-mist);
  border-radius: var(--tech-radius-pill);
  padding: .375rem .875rem;
}

/* ============================================================
   BLOK ZAKUPU
   ============================================================ */
.tech-buy__head { margin-bottom: 1.25rem; }
.tech-buy__heading {
  margin: 0;
  font-size: var(--tech-fs-xl);
  font-weight: var(--tech-fw-bold);
  color: var(--tech-ink);
}

/* Lista kart */
.tech-buy__opts { display: flex; flex-direction: column; gap: .75rem; }

/* Karta opcji */
.tech-buyopt {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "radio body pricing"
    "radio foot foot";
  gap: .25rem 1rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--tech-border);
  border-radius: var(--tech-radius);
  cursor: pointer;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.tech-buyopt:hover { border-color: var(--tech-gray-300); }

/* Subskrypcja gdy NIE wybrana → tło mist (mockup: „inny kolor" wyróżniający ofertę) */
.tech-buyopt.is-sub:not(:has(input:checked)) {
  background: var(--tech-mist);
}

/* Zaznaczona karta → białe tło + ink border + obrys (mockup) */
.tech-buyopt:has(input:checked) {
  border-color: var(--tech-ink);
  background: var(--tech-white);
  box-shadow: 0 0 0 1px var(--tech-ink) inset;
}

/* Ukryty natywny radio */
.tech-buyopt__radio-input { position: absolute; opacity: 0; pointer-events: none; }

/* Kropka radio */
.tech-buyopt__radio {
  grid-area: radio;
  align-self: start;
  width: 1.25rem; height: 1.25rem;
  margin-top: .15rem;
  border: 1px solid var(--tech-gray-400);
  border-radius: 50%;
  position: relative;
  transition: border-color .2s;
}
.tech-buyopt:has(input:checked) .tech-buyopt__radio { border-color: var(--tech-ink); }
.tech-buyopt:has(input:checked) .tech-buyopt__radio::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: .625rem; height: .625rem; border-radius: 50%;
  background: var(--tech-ink);
}

/* Flaga „najczęściej wybierane" */
.tech-buyopt__flag {
  position: absolute; top: -.7rem; left: 1.5rem;
  font-size: .625rem; font-weight: var(--tech-fw-bold); letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--tech-white); background: var(--tech-ink);
  padding: .2rem .6rem; border-radius: var(--tech-radius-pill);
}

/* Treść karty */
.tech-buyopt__body { grid-area: body; }
.tech-buyopt__title { font-weight: var(--tech-fw-bold); color: var(--tech-ink); }
.tech-buyopt__sub { margin-top: .25rem; font-size: var(--tech-fs-sm); color: var(--tech-slate); }
/* Opis wariantu subskrypcji (promocje sklepu) — widoczny zawsze, także gdy opcja nie jest zaznaczona. */
.tech-buyopt__desc { margin-top: .5rem; font-size: var(--tech-fs-sm); line-height: 1.45; color: var(--tech-ink); }
.tech-buyopt__desc p { margin: 0; }
.tech-buyopt__desc p + p { margin-top: .35rem; }
/* Korzyści subskrypcji: ukryte; widoczne TYLKO gdy karta zaznaczona (mockup .opt-extra) */
.tech-buyopt__benefits {
  margin: .75rem 0 0; padding: 0; list-style: none;
  display: none; flex-direction: column; gap: .375rem;
  font-size: var(--tech-fs-sm); color: var(--tech-ink);
}
.tech-buyopt:has(input:checked) .tech-buyopt__benefits { display: flex; }
.tech-buyopt__benefits li { display: flex; align-items: center; gap: .5rem; }
.tech-buyopt__check { flex: 0 0 auto; width: 1rem; height: 1rem; color: var(--tech-ink); }

/* Ceny (prawa kolumna) */
.tech-buyopt__pricing { grid-area: pricing; text-align: right; }
.tech-buyopt__badge {
  display: inline-block; margin-bottom: .35rem;
  font-size: .6875rem; font-weight: var(--tech-fw-bold);
  color: var(--tech-white); background: var(--tech-ink);
  padding: .1rem .5rem; border-radius: var(--tech-radius-pill);
}
.tech-buyopt__price { font-weight: var(--tech-fw-bold); color: var(--tech-ink); white-space: nowrap; }
.tech-buyopt__price del { font-weight: var(--tech-fw-medium); color: var(--tech-slate); margin-right: .25rem; }
.tech-buyopt__price ins { text-decoration: none; }
.tech-buyopt__perday { margin-top: .25rem; font-size: var(--tech-fs-xs); color: var(--tech-slate); }

/* Stopka karty (oszczędność + omnibus) */
.tech-buyopt__foot {
  grid-area: foot; margin-top: .5rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
}
.tech-buyopt__save {
  font-size: var(--tech-fs-sm); font-weight: var(--tech-fw-semibold); color: var(--tech-ink);
  background: var(--tech-white); border: 1px solid var(--tech-border);
  border-radius: var(--tech-radius-pill); padding: .15rem .65rem;
}
.tech-buyopt__omnibus { font-size: var(--tech-fs-xs); color: var(--tech-slate); }
.tech-buyopt__omnibus p { margin: 0; }

/* ---- CTA: ilość + dodaj do koszyka ---- */
.tech-buy__cta { display: flex; gap: .75rem; margin-top: 1.5rem; }
.tech-qty {
  display: inline-flex; align-items: center; gap: .25rem;
  border: 1px solid var(--tech-border); border-radius: var(--tech-radius-pill);
  padding: .25rem;
}
/* !important + reset min-width/padding/border: Astra styluje gołe <button> (border, padding,
   min-width) → robiło owale zamiast kółek. Wymuszamy kwadrat 2.25rem. */
.tech-qty__btn {
  width: 2.25rem !important; height: 2.25rem !important; min-width: 0 !important;
  padding: 0 !important; border: 0 !important; box-shadow: none !important;
  background: transparent !important;
  font-size: 1.25rem; line-height: 1; color: var(--tech-ink); cursor: pointer;
  border-radius: 50% !important;
  display: grid; place-items: center; transition: background-color .2s;
}
.tech-qty__btn:hover,
.tech-qty__btn:focus { background: var(--tech-mist) !important; }
.tech-qty__val { min-width: 2rem; text-align: center; font-weight: var(--tech-fw-semibold); color: var(--tech-ink); }

.tech-buy__add {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 0; cursor: pointer;
  background: var(--tech-ink); color: var(--tech-white);
  font-weight: var(--tech-fw-semibold); font-size: var(--tech-fs-base);
  border-radius: var(--tech-radius-pill); padding: 0 1.75rem; min-height: 3.25rem;
  transition: background-color .2s;
}
.tech-buy__add:hover { background: var(--tech-ink-hover); }
.tech-buy__dot { opacity: .5; }

/* Stan „myślenia" po kliknięciu — spinner zamiast tekstu */
.tech-buy__add.loading { color: transparent !important; pointer-events: none; position: relative; }
.tech-buy__add.loading > * { visibility: hidden; }
.tech-buy__add.loading::after {
  content: ""; position: absolute; top: 50%; left: 50%;
  width: 1.25rem; height: 1.25rem; margin: -.625rem 0 0 -.625rem;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  border-radius: 50%; visibility: visible;
  animation: tech-spin .7s linear infinite;
}
@keyframes tech-spin { to { transform: rotate(360deg); } }

/* Link „Zobacz koszyk" doklejany przez Woo po dodaniu — niepotrzebny w bloku */
.tech-buy .added_to_cart,
.tech-buy a.wc-forward,
.tech-buy__cta .added_to_cart { display: none !important; }

/* (usunięto martwą regułę .tech-product__sections — wrapper zniknął w F3) */

/* Formularz bloku zakupu (fallback bez JS) — przezroczysty dla układu. */
.tech-buy__form { display: contents; }

/* Brak dostępnych opcji zakupu (wszystkie warianty wyczerpane) */
.tech-buy__unavailable {
  margin: 1.5rem 0 0; padding: 1rem 1.25rem;
  border-radius: var(--tech-radius); background: var(--tech-mist);
  color: var(--tech-ink); font-weight: var(--tech-fw-medium);
}

/* ---- Reasekuracja (ikony z mockupu zamiast kropek) ---- */
.tech-buy__assure {
  display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; margin-top: 1.25rem;
  font-size: var(--tech-fs-sm); color: var(--tech-slate);
}
.tech-buy__assure-item { display: inline-flex; align-items: center; gap: .5rem; }
.tech-buy__assure-ico { flex: 0 0 auto; width: 1.25rem; height: 1.25rem; color: var(--tech-ink); }

/* ============================================================
   F4 — Opinie o produkcie (TrustMate per-produkt)
   Widget injectuje .tm-* → kolory dziedziczy z components/opinie.css (wrapper
   .tech-opinie__widget). Tu tylko sekcja + nagłówek.
   ============================================================ */
/* Ten sam breakout co .tech-psec (produkt-sekcje.css): bez niego sekcja siedziała w kontenerze
   Astry z jego paddingiem i nagłówek był 24px bardziej w prawo niż sekcje powyżej. */
.tech-popinie {
  padding-block: 3.5rem;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
}
.tech-popinie__inner {
  max-width: var(--tech-container);
  margin-inline: auto;
  padding-inline: var(--tech-gutter);
}
.tech-popinie__title {
  margin: 0 0 2rem;
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  font-weight: var(--tech-fw-bold);
  letter-spacing: var(--tech-tracking-tight);
  color: var(--tech-ink);
}
@media (min-width: 1024px) { .tech-popinie { padding-block: 4rem; } }

/* ============================================================
   F4 — „Inni kupili również" (related)
   ============================================================ */
.tech-related {
  padding-block: 4rem;
  background: var(--tech-mist);
  border-top: 1px solid var(--tech-border);
  /* full-bleed: Astra trzyma single-product w kontenerze max-width → tło inaczej „boxed". */
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  margin-bottom: 0;
}

/* Sekcja related = ostatni element przed stopką → zdejmij dolny padding/margines
   kontenera treści Astry (inaczej biała przerwa między szarą sekcją a stopką). */
body.single-product .site-content,
body.single-product .ast-container,
body.single-product #primary,
body.single-product #main,
body.single-product article.product {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}
.tech-related__inner {
  max-width: var(--tech-container);
  margin-inline: auto;
  padding-inline: var(--tech-gutter);
}
.tech-related__head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.75rem;
}
.tech-related__title {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw, 1.875rem);
  font-weight: var(--tech-fw-bold);
  letter-spacing: var(--tech-tracking-tight);
  color: var(--tech-ink);
}
.tech-related__all {
  font-size: var(--tech-fs-sm); font-weight: var(--tech-fw-semibold);
  color: var(--tech-ink); text-decoration: none; white-space: nowrap;
}
.tech-related__all:hover { opacity: .7; }

.tech-related__grid {
  display: grid; gap: 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 640px)  { .tech-related__grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; } }
@media (min-width: 1024px) { .tech-related__grid { grid-template-columns: repeat(4, 1fr); } }

/* Karta 1:1 z mockupem: biała, border gray-100, rounded-3xl, padding 1rem, hover-shadow. */
.tech-related__card {
  display: flex; flex-direction: column;
  background: var(--tech-white);
  border: 1px solid var(--tech-border);
  border-radius: var(--tech-radius-lg);
  padding: 1rem;
  transition: box-shadow .25s ease;
}
.tech-related__card:hover { box-shadow: 0 10px 30px rgba(56, 63, 69, .1); }

/* Zdjęcie: kwadrat, rounded-2xl, badge w lewym górnym rogu. */
.tech-related__media {
  position: relative; display: block; line-height: 0;
  border-radius: var(--tech-radius); overflow: hidden;
  margin-bottom: 1rem;
}
.tech-related__media .tech-produkt__img,
.tech-related__media img {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block;
  box-shadow: none !important;
}
.tech-related__badge {
  position: absolute; top: .75rem; left: .75rem;
  font-size: var(--tech-fs-xs); font-weight: var(--tech-fw-bold);
  padding: .375rem .75rem; border-radius: var(--tech-radius-pill);
  line-height: 1;
}
.tech-related__badge--promo { background: var(--tech-ink); color: var(--tech-white); }
.tech-related__badge--feat  { background: var(--tech-white); color: var(--tech-ink); border: 1px solid var(--tech-ink); }

/* Gwiazdki (TrustMate iframe) — rząd jak w mockupie, mb-1. */
.tech-related__rating { margin-bottom: .25rem; }
.tech-related__rating .tech-produkt__rating { width: 130px; height: 22px; border: 0; }

.tech-related__name {
  margin: 0 0 .5rem; font-size: var(--tech-fs-lg);
  font-weight: var(--tech-fw-bold); letter-spacing: var(--tech-tracking-tight);
  line-height: var(--tech-lh-snug);
  /* Rezerwacja 2 linii — ceny i przyciski wyrównane między kartami (1- i 2-liniowe nazwy). */
  min-height: calc(2 * var(--tech-lh-snug) * var(--tech-fs-lg));
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.tech-related__name a { color: var(--tech-ink); text-decoration: none; }
.tech-related__name a:hover { opacity: .7; }

.tech-related__price {
  color: var(--tech-ink); font-size: var(--tech-fs-xl); font-weight: var(--tech-fw-extrabold);
  line-height: 1.2; margin-bottom: 1rem;
}
.tech-related__price del { color: var(--tech-slate); font-size: var(--tech-fs-sm); font-weight: var(--tech-fw-medium); margin-left: .35rem; }
.tech-related__price ins { text-decoration: none; }

/* Przycisk: pełna szerokość, ciemny, „Sprawdź" (mockup). margin-top:auto = zawsze dół karty
   (karty równej wysokości przez grid stretch → guziki w jednej linii). */
.tech-related__btn {
  margin-top: auto; display: block; text-align: center;
  font-size: var(--tech-fs-sm); font-weight: var(--tech-fw-semibold);
  color: var(--tech-white); text-decoration: none;
  background: var(--tech-ink); border-radius: var(--tech-radius-pill);
  padding: .75rem 1.25rem; transition: background-color .2s;
}
.tech-related__btn:hover { background: var(--tech-slate); color: var(--tech-white); }

/* ============================================================
   F4 — Sticky pasek mobilny (poniżej 1024px; ukryty na desktopie)
   ============================================================ */
.tech-sticky {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; gap: .875rem;
  padding: .75rem 1rem;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-top: 1px solid var(--tech-border);
  transform: translateY(110%);
  transition: transform .3s ease;
  padding-bottom: calc(.75rem + env(safe-area-inset-bottom, 0px));
}
.tech-sticky.is-visible { transform: translateY(0); }
.tech-sticky__info { line-height: 1.2; min-width: 0; }
.tech-sticky__name { font-size: var(--tech-fs-xs); color: var(--tech-slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tech-sticky__price { font-weight: var(--tech-fw-bold); color: var(--tech-ink); white-space: nowrap; }
.tech-sticky__price del { color: var(--tech-slate); font-weight: var(--tech-fw-medium); margin-right: .25rem; }
.tech-sticky__price ins { text-decoration: none; }
.tech-sticky__add {
  flex: 1; min-height: 3.25rem; border: 0; cursor: pointer;
  background: var(--tech-ink); color: var(--tech-white);
  font-weight: var(--tech-fw-semibold); font-size: var(--tech-fs-base);
  border-radius: var(--tech-radius-pill);
  transition: background-color .2s;
}
.tech-sticky__add:hover { background: var(--tech-ink-hover); }
@media (min-width: 1024px) { .tech-sticky { display: none; } }

/* ============================================================
   F4 — Lightbox galerii (klik głównego zdjęcia)
   ============================================================ */
body.tech-lightbox-open { overflow: hidden; }
.tech-lightbox {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  background: rgba(56, 63, 69, .85);
  opacity: 0; transition: opacity .2s ease;
  cursor: zoom-out;
}
.tech-lightbox.is-open { opacity: 1; }
.tech-lightbox__img {
  max-width: min(92vw, 880px); max-height: 88vh;
  object-fit: contain; border-radius: var(--tech-radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
}
.tech-lightbox__close {
  position: absolute; top: 1rem; right: 1.25rem;
  width: 2.75rem; height: 2.75rem; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .15); color: #fff;
  font-size: 1.75rem; line-height: 1; border-radius: 50%;
  display: grid; place-items: center; transition: background-color .2s;
}
.tech-lightbox__close:hover { background: rgba(255, 255, 255, .3); }
.tech-gallery__main-img { cursor: zoom-in; }
/* Obrys WEWNĄTRZ (ujemny offset) — figura galerii ma overflow:hidden i ucinała obrys zewnętrzny (pi r14b).
   (inset box-shadow na <img> rysuje się POD obrazem, więc tylko outline). */
.tech-gallery__main-img:focus-visible { outline: 3px solid var(--tech-ink); outline-offset: -3px; }
