/* ============================================================
   Fiberglass World — Product page styles
   (extends css/style.css — shares header, footer, product cards;
    reuses .categories / .filter-box / .breadcrumb from category page)
   ============================================================ */

/* Active category highlight (shared element states, same as categories.css) */
.cat-tile.active span { color: var(--navy); font-weight: 700; }
.cat-tile.active { background: var(--bg); }
.subcat li a.active { color: var(--red); font-weight: 600; }

.product-page { padding: 26px 0 56px; }
.product-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 24px;
  align-items: start;
}

/* ---------- Sidebar (reuses .categories + .filter-box) ---------- */
.pd-sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ---------- Main column ---------- */
.pd-main { min-width: 0; }
.pd-main .breadcrumb { margin-bottom: 18px; }

/* ---------- Product detail (gallery + purchase) ---------- */
.pd-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

/* Gallery */
.pd-gallery { display: flex; flex-direction: column; gap: 14px; }
.pd-main-img {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.pd-main-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity .2s;
}
.pd-thumbs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.pd-thumb {
  width: 86px; height: 86px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s, background .2s;
}
.pd-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pd-thumb:hover { border-color: #b9c0cc; }
.pd-thumb.is-active { border: 1px solid var(--muted-2); background: #f6f7f9; }
.pd-main-img img { cursor: zoom-in; }

/* ===== Lightbox powiększenia zdjęcia produktu (strzałki lewo/prawo) ===== */
.pd-lb { position: fixed; inset: 0; z-index: 1300; display: flex; align-items: center; justify-content: center; padding: 40px; }
.pd-lb[hidden] { display: none; }
.pd-lb-overlay { position: absolute; inset: 0; background: rgba(10,14,24,.9); animation: pdLbFade .18s ease; }
@keyframes pdLbFade { from { opacity: 0; } to { opacity: 1; } }
.pd-lb-fig { position: relative; z-index: 1; margin: 0; max-width: 92vw; max-height: 88vh; display: flex; flex-direction: column; align-items: center; gap: 12px; }
/* contain — całe zdjęcie widoczne, niezależnie od proporcji (pion/poziom nie ucinane). */
.pd-lb-img { max-width: 92vw; max-height: 82vh; width: auto; height: auto; object-fit: contain; border-radius: 10px; box-shadow: 0 24px 70px rgba(0,0,0,.55); background: #fff; }
.pd-lb-cap { color: #e6e9ef; font-size: 13.5px; text-align: center; opacity: .9; }
.pd-lb-close { position: absolute; top: 22px; right: 26px; z-index: 2; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s; }
.pd-lb-close:hover { background: var(--red, #e1352b); }
.pd-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 52px; height: 52px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s; }
.pd-lb-nav:hover { background: rgba(255,255,255,.28); }
.pd-lb-prev { left: 26px; }
.pd-lb-next { right: 26px; }
.pd-lb-count { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 2; color: #fff; font-size: 13px; font-weight: 600; background: rgba(255,255,255,.12); padding: 5px 14px; border-radius: 999px; }
@media (max-width: 560px) {
  .pd-lb { padding: 16px; }
  .pd-lb-nav { width: 42px; height: 42px; }
  .pd-lb-prev { left: 10px; } .pd-lb-next { right: 10px; }
  .pd-lb-close { top: 14px; right: 14px; }
}

/* Assurance cards (Termin realizacji / Transport) — full width under the detail */
.pd-assurances {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 26px;
}
.pd-assurance {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f6f7f9;
  padding: 20px 24px;
}
.pd-assurance svg { color: var(--navy); flex: none; margin-top: 1px; }
.pd-assurance strong { display: block; font-size: 14px; font-weight: 700; color: var(--ink); }
.pd-assurance p { margin: 6px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); max-width: 460px; }

@media (min-width: 1200px) {
  .pd-assurances { gap: 22px; }
  .pd-assurance { padding: 24px 30px; gap: 18px; }
  .pd-assurance svg { width: 32px; height: 32px; }
  .pd-assurance strong { font-size: 15px; }
  .pd-assurance p { font-size: 13px; }
}

/* Purchase column */
.pd-purchase { min-width: 0; }
.pd-title {
  font-size: 23px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
  margin: 0 0 18px;
}
.pd-meta {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}
.pd-meta span {
  flex: 1;
  background: #f6f7f9;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--muted);
}
.pd-meta span strong { color: var(--ink); font-weight: 700; }

.pd-price {
  font-size: 34px;
  font-weight: 800;
  color: var(--red);
  line-height: 1;
  margin-bottom: 22px;
}
.pd-price small { font-size: 16px; font-weight: 700; vertical-align: top; }
.pd-price .pd-vat { font-size: 12px; font-weight: 500; color: #6b7385; vertical-align: top; margin-left: 8px; }
.pd-price-net { font-size: 13px; font-weight: 500; color: #15233b; margin: -16px 0 22px; }

/* Primary action row: quantity + add to cart + wishlist */
.pd-cart-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 12px;
}
.pd-qty {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex: none;
}
.pd-qty button {
  width: 40px; height: 48px;
  border: none;
  background: #fff;
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  transition: background .2s, color .2s;
}
.pd-qty button:hover { background: var(--navy); color: #fff; }
.pd-qty input {
  width: 44px; height: 48px;
  border: none;
  border-left: 1.5px solid var(--line);
  border-right: 1.5px solid var(--line);
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  -moz-appearance: textfield;
}
.pd-qty input::-webkit-outer-spin-button,
.pd-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.pd-add-cart {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: none;
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  padding: 0 18px;
  transition: background .2s;
}
.pd-add-cart:hover { background: var(--navy-2); }
.pd-add-cart svg { flex: none; }

/* Wishlist heart — compact icon button */
.pd-wish-btn {
  width: 48px;
  flex: none;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--red);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s, color .2s;
}
.pd-wish-btn svg { fill: none; transition: fill .2s; }
.pd-wish-btn:hover { border-color: var(--red); background: #fff5f5; }
.pd-wish-btn.is-active { background: var(--red); border-color: var(--red); color: #fff; }
.pd-wish-btn.is-active svg { fill: currentColor; }

/* Buy now — secondary, full width, outlined */
.pd-buy-now {
  width: 100%;
  border: 1.5px solid var(--navy);
  background: #fff;
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  transition: background .2s, color .2s;
}
.pd-buy-now:hover { background: var(--navy); color: #fff; }

/* Social share */
.pd-share {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.pd-share a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  transition: filter .2s, transform .15s;
}
.pd-share a:hover { filter: brightness(1.08); transform: translateY(-1px); }
.pd-share svg { flex: none; }
.sh-fb  { background: #3b5998; }
.sh-tw  { background: #1da1f2; }
.sh-pin { background: #e60023; }

/* Ask about product */
.pd-ask {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 12px 16px;
  text-align: left;
  transition: border-color .2s, box-shadow .2s, transform .15s;
}
.pd-ask:hover { border-color: #b9c0cc; box-shadow: var(--shadow); transform: translateY(-1px); }
.pd-ask-icon {
  width: 44px; height: 44px;
  flex: none;
  border-radius: 50%;
  background: #1f8ff0;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pd-ask-text strong { display: block; font-size: 14px; font-weight: 700; color: var(--ink); letter-spacing: .3px; }
.pd-ask-text span { font-size: 12px; color: var(--muted); }

/* ---------- Tabs ---------- */
.pd-tabs { margin-top: 34px; }
.pd-tab-nav {
  display: flex;
  gap: 6px;
}
.pd-tab-btn {
  padding: 12px 22px;
  border: 1px solid var(--line);
  border-bottom: none;
  background: #f6f7f9;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color .2s, background .2s;
}
.pd-tab-btn:hover { color: var(--ink); }
.pd-tab-btn .tab-short { display: none; }   /* skrócona etykieta — tylko na mobile */
.pd-tab-btn.is-active {
  background: #fff;
  color: var(--ink);
  position: relative;
  z-index: 2;
}
.pd-tab-btn.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: var(--red);
  border-radius: 3px 3px 0 0;
}
.pd-tab-body {
  border: 1px solid var(--line);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  background: #fff;
  padding: 26px;
  margin-top: -1px;
}
.pd-tab-panel { display: none; }
.pd-tab-panel.is-active { display: block; }

/* Opis produktu — ta sama czcionka co placeholder „Opis produktu zostanie dodany wkrótce."
   (14px, krój dziedziczony, kolor #6b7385, bez pogrubienia bazowego) */
.pd-tab-panel .pd-lead,
.pd-desc { font-size: 14px; line-height: 1.65; color: #6b7385; font-weight: 400; }
.pd-desc > *:first-child { margin-top: 0; }
.pd-desc p { margin: 0 0 12px; }
.pd-desc p:last-child { margin-bottom: 0; }
.pd-desc ul, .pd-desc ol { margin: 0 0 12px; padding-left: 20px; }
.pd-desc li { margin-bottom: 5px; }
.pd-desc h2, .pd-desc h3, .pd-desc h4 { font-size: 14px; font-weight: 700; color: #6b7385; margin: 16px 0 8px; }
.pd-desc a { color: #e1352b; }
.pd-desc img { max-width: 100%; height: auto; border-radius: 8px; margin: 8px 0; }

/* Description feature list */
.pd-features {
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.pd-feature {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.pd-feature-ico {
  width: 36px; height: 36px;
  flex: none;
  color: var(--navy);
}
.pd-feature h4 { margin: 0 0 5px; font-size: 14.5px; font-weight: 700; color: var(--ink); }
.pd-feature p  { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); max-width: 720px; }

/* Dimensions spec table */
.pd-specs { width: 100%; border-collapse: collapse; max-width: 560px; }
.pd-specs tr { border-bottom: 1px solid var(--line); }
.pd-specs tr:last-child { border-bottom: none; }
.pd-specs th {
  text-align: left;
  padding: 12px 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  width: 45%;
}
.pd-specs td {
  padding: 12px 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

/* ---------- Related products ---------- */
.related-section {
  background: var(--bg);
  padding: 34px 0 46px;
  margin-top: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .related-section .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 980px) {
  .product-layout { grid-template-columns: 1fr; }
  .pd-main { order: 1; }
  .pd-sidebar { order: 2; }
  /* avoid duplicating the top icon bar */
  .pd-sidebar .categories { display: none; }
}

@media (max-width: 760px) {
  .pd-top { grid-template-columns: 1fr; gap: 22px; }
  .related-section .product-grid { grid-template-columns: repeat(2, 1fr); }
  /* Wąski ekran: „Termin realizacji” i „Transport” jedno pod drugim — tekst dostaje pełną szerokość. */
  .pd-assurances { grid-template-columns: 1fr; }
  /* 3-4 zakładki na wąskim ekranie: zawijają się do „pigułek" — wszystkie widoczne, bez ukrytego przewijania. */
  /* Taby produktu na mobile: JEDEN rząd „prawdziwych" zakładek (jak na desktopie),
     ale ze skróconymi etykietami — mieszczą się ładnie nawet przy ~360–390 px. */
  .pd-tab-nav { flex-wrap: nowrap; gap: 4px; }
  /* flex-basis: auto → szerokość zależna od długości etykiety (różne szerokości),
     grow 1 → wspólnie wypełniają rząd. Dłuższy „Dane techniczne" dostaje więcej miejsca. */
  .pd-tab-btn { flex: 1 1 auto; min-width: 0; padding: 11px 8px; font-size: 12.5px; text-align: center; white-space: nowrap; }
  .pd-tab-btn .tab-full { display: none; }
  .pd-tab-btn .tab-short { display: inline; }
  .pd-tab-body { padding: 20px; }
}

@media (max-width: 480px) {
  .pd-title { font-size: 20px; }
  .pd-price { font-size: 30px; }
  .pd-meta { flex-direction: column; gap: 8px; }
  .related-section .product-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .pd-thumb { width: 72px; height: 72px; }
  /* Koszyk: stepper + serce w jednym rzędzie, „Dodaj do koszyka" pełna szerokość niżej
     (zamiast ściśniętego przycisku zawijającego napis na 3 linie). */
  .pd-cart-row { flex-wrap: wrap; }
  .pd-qty { order: 1; }
  .pd-wish-btn { order: 2; margin-left: auto; }
  .pd-add-cart { order: 3; flex: 1 0 100%; height: 50px; letter-spacing: .3px; }
}

/* ===== Opinie i oceny (gwiazdki + zakładka „Opinie") ===== */
.stars { position: relative; display: inline-flex; line-height: 0; vertical-align: middle; }
.stars svg { fill: currentColor; flex: none; }
.stars .stars-bg { color: #d5dbe4; display: inline-flex; }
.stars .stars-fg { position: absolute; top: 0; left: 0; overflow: hidden; white-space: nowrap; color: #f5a623; display: inline-flex; }

.pd-rating-link { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 2px 0; cursor: pointer; margin: 2px 0 4px; }
.pd-rating-num { font-weight: 700; color: var(--ink); font-size: 14px; }
.pd-rating-count { font-size: 13px; color: var(--muted); text-decoration: underline; }
.pd-rating-link:hover .pd-rating-count { color: var(--ink); }

.rv-flash { padding: 11px 14px; border-radius: 9px; font-size: 13.5px; margin: 0 0 16px; }
.rv-flash.ok { background: #e9f7ef; color: #1a7f47; border: 1px solid #bfe8cf; }
.rv-flash.err { background: #fdecec; color: #b42318; border: 1px solid #f6cfca; }

.rv-summary { display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: center; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.rv-avg { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rv-avg-num { font-size: 40px; font-weight: 800; color: var(--ink); line-height: 1; }
.rv-avg .stars svg { width: 18px; height: 18px; }
.rv-avg-count { font-size: 12.5px; color: var(--muted); }
.rv-dist { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 5px; }
.rv-dist-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--muted); }
.rv-dist-star { width: 30px; flex: none; color: #f5a623; font-weight: 600; }
.rv-bar { flex: 1; height: 8px; background: #eceff4; border-radius: 99px; overflow: hidden; }
.rv-bar span { display: block; height: 100%; background: #f5a623; border-radius: 99px; }
.rv-dist-c { width: 22px; flex: none; text-align: right; }

.rv-note { background: #f6f7f9; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font-size: 13.5px; color: var(--muted); }
.rv-note a { color: var(--navy); font-weight: 600; }

.rv-form { background: #f6f7f9; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 24px; }
.rv-form h4 { margin: 0 0 12px; font-size: 15px; color: var(--ink); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rv-verified { font-size: 11.5px; font-weight: 700; color: #1a7f47; background: #e9f7ef; border: 1px solid #bfe8cf; border-radius: 99px; padding: 2px 9px; }
.rv-stars-input { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; margin-bottom: 12px; }
.rv-stars-input input { position: absolute; opacity: 0; width: 0; height: 0; }
.rv-stars-input label { color: #d5dbe4; cursor: pointer; line-height: 0; transition: color .12s; }
.rv-stars-input label svg { fill: currentColor; }
.rv-stars-input label:hover, .rv-stars-input label:hover ~ label, .rv-stars-input input:checked ~ label { color: #f5a623; }
.rv-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 11px 13px; font-size: 14px; font-family: inherit; resize: vertical; background: #fff; box-sizing: border-box; }
.rv-status { font-size: 12.5px; color: var(--muted); margin: 8px 0 0; }
.rv-form button { margin-top: 12px; background: var(--navy); color: #fff; border: 0; border-radius: 9px; padding: 11px 22px; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s; }
.rv-form button:hover { background: var(--navy-2, #232d47); }

.rv-list { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.rv-item { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fff; }
.rv-item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.rv-author { font-weight: 700; color: var(--ink); font-size: 14px; }
.rv-verified-tag { font-size: 11px; font-weight: 700; color: #1a7f47; background: #e9f7ef; border-radius: 99px; padding: 1px 8px; }
.rv-date { font-size: 12px; color: var(--muted-2, #98a2b3); margin-left: auto; }
.rv-item .stars svg { width: 15px; height: 15px; }
.rv-content { margin: 8px 0 0; font-size: 13.5px; line-height: 1.6; color: #374151; }
