/* ============================================================
   oplex-gallery.css — własna galeria produktu (czesci24)
   Sticky main stage + pionowe miniatury + fullscreen lightbox.
   Akcent per shop przez --oplex-accent (body.shop-1/2/3).
   ============================================================ */

.oplex-gallery-root { position: relative; }

.oplex-gallery {
  display: flex;
  align-items: stretch;            /* miniatury rozciągają się do wysokości stage */
  gap: .75rem;
}

/* ---------- Miniatury (pionowo z boku) ---------- */
.oplex-gallery__thumbs {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  flex: 0 0 84px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--oplex-accent, #f97316) transparent;
  padding-right: 2px;
}
.oplex-gallery__thumbs::-webkit-scrollbar { width: 5px; }
.oplex-gallery__thumbs::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,.18);
  border-radius: 4px;
}

.oplex-gallery__thumb {
  position: relative;
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  padding: 3px;
  margin: 0;
  background: #fff;
  border: 1.5px solid #e6e6e6;
  border-radius: 10px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}

/* Kafelek "+N" — otwiera pełny lightbox */
.oplex-gallery__thumb.is-more { cursor: zoom-in; }
.oplex-gallery__thumb.is-more .oplex-gallery__thumb-img { filter: brightness(.4); }
.oplex-gallery__more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
  background: rgba(0,0,0,.3);
  border-radius: 8px;
  pointer-events: none;
}
.oplex-gallery__thumb.is-more:hover .oplex-gallery__more { background: color-mix(in srgb, var(--oplex-accent, #f97316) 55%, rgba(0,0,0,.3)); }
.oplex-gallery__thumb:hover { border-color: var(--oplex-accent, #f97316); }
.oplex-gallery__thumb.is-active {
  border-color: var(--oplex-accent, #f97316);
  box-shadow: 0 0 0 1px var(--oplex-accent, #f97316);
}
.oplex-gallery__thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ---------- Sticky main stage ---------- */
.oplex-gallery__stage {
  position: sticky;
  top: 1rem;
  flex: 1 1 auto;
  min-width: 0;
  align-self: flex-start;
}

.oplex-gallery__viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 14px;
  overflow: hidden;
  cursor: zoom-in;
  outline: none;
}
.oplex-gallery__viewport:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--oplex-accent, #f97316) 45%, transparent);
}

.oplex-gallery__slide {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease;
  pointer-events: none;
}
.oplex-gallery__slide.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.oplex-gallery__slide-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ---------- Nawigacja (strzałki) ---------- */
.oplex-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  color: #222;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s ease, background .15s ease;
  z-index: 5;
}
.oplex-gallery__stage:hover .oplex-gallery__nav { opacity: 1; }
.oplex-gallery__nav:hover { background: var(--oplex-accent, #f97316); color: #fff; }
.oplex-gallery__nav--prev { left: .6rem; }
.oplex-gallery__nav--next { right: .6rem; }
.oplex-gallery__nav .material-icons { font-size: 26px; }

/* ---------- Licznik + zoom ---------- */
.oplex-gallery__counter {
  position: absolute;
  top: .6rem;
  right: .6rem;
  z-index: 5;
  padding: .15rem .55rem;
  font-size: .8rem;
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,.55);
  border-radius: 999px;
  pointer-events: none;
}
.oplex-gallery__zoom {
  position: absolute;
  bottom: .6rem;
  right: .6rem;
  z-index: 5;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.92);
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  color: #222;
  cursor: zoom-in;
  transition: background .15s ease, color .15s ease;
}
.oplex-gallery__zoom:hover { background: var(--oplex-accent, #f97316); color: #fff; }
.oplex-gallery__zoom .material-icons { font-size: 22px; }

/* ---------- Lightbox ---------- */
html.oplex-lb-lock { overflow: hidden; }

.oplex-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.oplex-lightbox[hidden] { display: none; }
.oplex-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8,8,10,.92);
  cursor: zoom-out;
}
.oplex-lightbox__stage {
  position: relative;
  z-index: 1;
  max-width: 94vw;
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.oplex-lightbox__img {
  max-width: 94vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform .2s ease;
  transform-origin: 50% 50%;
  user-select: none;
}
.oplex-lightbox__img.is-zoomed {
  transform: scale(2.4);
  cursor: zoom-out;
  transition: transform-origin 0s, transform .15s ease;
}

.oplex-lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 3;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
  transition: background .15s ease;
}
.oplex-lightbox__close:hover { background: var(--oplex-accent, #f97316); }

.oplex-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
  transition: background .15s ease;
}
.oplex-lightbox__nav:hover { background: var(--oplex-accent, #f97316); }
.oplex-lightbox__nav--prev { left: 1.2rem; }
.oplex-lightbox__nav--next { right: 1.2rem; }
.oplex-lightbox__nav .material-icons,
.oplex-lightbox__close .material-icons { font-size: 30px; }

.oplex-lightbox__counter {
  position: absolute;
  top: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  padding: .25rem .8rem;
  font-size: .9rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255,255,255,.12);
  border-radius: 999px;
}

/* ---------- Mobile (≤ 767px): stage na górze, miniatury w wiersz ---------- */
@media (max-width: 767.98px) {
  .oplex-gallery { flex-direction: column; gap: .6rem; }
  .oplex-gallery__stage { position: static; order: 1; width: 100%; }
  .oplex-gallery__thumbs {
    flex-direction: row;
    flex: 0 0 auto;
    width: 100%;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    order: 2;
    padding-bottom: 4px;
  }
  .oplex-gallery__thumb { width: 64px; height: 64px; }
  .oplex-gallery__nav { opacity: 1; width: 36px; height: 36px; }
  .oplex-lightbox__nav { width: 44px; height: 44px; }
}

/* ============================================================
   oplex-trust — mikro-trust pod przyciskiem koszyka
   ============================================================ */
.oplex-trust {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid #ececec;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem 1rem;
}
.oplex-trust__item {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  line-height: 1.25;
  color: #444;
}
.oplex-trust__item .material-icons {
  font-size: 21px;
  flex: 0 0 auto;
  color: var(--oplex-accent, #f97316);
}
.oplex-trust__item--stock.is-in .material-icons,
.oplex-trust__item--stock.is-in span { color: #16a34a; }
.oplex-trust__item--stock.is-in span { font-weight: 600; }
.oplex-trust__item--stock.is-order .material-icons,
.oplex-trust__item--stock.is-order span { color: #d97706; font-weight: 600; }
.oplex-trust__item--stock.is-out .material-icons,
.oplex-trust__item--stock.is-out span { color: #8a8a8a; }

@media (max-width: 480px) {
  .oplex-trust { grid-template-columns: 1fr; gap: .5rem; }
}

/* Banner cut-off — wysyłka tego samego dnia */
.oplex-cutoff {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: .75rem;
  padding: .65rem .85rem;
  font-size: .9rem;
  line-height: 1.3;
  color: #1f2937;
  background: color-mix(in srgb, var(--oplex-accent, #f97316) 12%, #fff);
  border: 1px solid color-mix(in srgb, var(--oplex-accent, #f97316) 35%, transparent);
  border-radius: 10px;
}
.oplex-cutoff .material-icons {
  font-size: 22px;
  flex: 0 0 auto;
  color: var(--oplex-accent, #f97316);
}
.oplex-cutoff strong { font-weight: 700; }

/* ============================================================
   oplex-stickybar — przyklejony pasek koszyka (tylko mobile)
   ============================================================ */
.oplex-stickybar { display: none; }

@media (max-width: 767.98px) {
  .oplex-stickybar {
    display: flex;
    align-items: center;
    gap: .6rem;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1050;
    padding: .5rem .75rem;
    padding-bottom: calc(.5rem + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid #e6e6e6;
    box-shadow: 0 -4px 16px rgba(0,0,0,.12);
    transform: translateY(110%);
    transition: transform .22s ease;
  }
  .oplex-stickybar.is-visible { transform: translateY(0); }

  .oplex-stickybar__img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border: 1px solid #eee;
    border-radius: 8px;
    flex: 0 0 auto;
    background: #fff;
  }
  .oplex-stickybar__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1 1 auto;
    line-height: 1.2;
  }
  .oplex-stickybar__name {
    font-size: .8rem;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .oplex-stickybar__price {
    font-size: 1.05rem;
    font-weight: 700;
    color: #111;
  }
  .oplex-stickybar__btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    white-space: nowrap;
  }
  .oplex-stickybar__btn .material-icons { font-size: 20px; }
}

/* Gdy widoczny sticky bar — ukryj globalny mobilny pasek nawigacji, by się nie nakładały */
@media (max-width: 767.98px) {
  body.oplex-sticky-on .oplex-mbar { display: none; }
}

/* ============================================================
   Buy-box hero — sekcja tytuł/cena/koszyk jako karta
   ============================================================ */
.oplex-meta-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .5rem;
  margin: .55rem 0 1rem;
}
.oplex-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .32rem .66rem;
  font-size: .85rem;
  line-height: 1;
  border-radius: 999px;
  border: 1px solid #e4e4e4;
  background: #fafafa;
  color: #444;
  text-decoration: none;
  white-space: nowrap;
}
.oplex-chip--brand { font-weight: 600; color: #222; }
.oplex-chip--brand:hover { border-color: var(--oplex-accent, #f97316); color: var(--oplex-accent, #f97316); }
.oplex-chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--oplex-accent, #f97316); flex: 0 0 auto; }
.oplex-chip--code .product__meta-label { color: #777; }
.oplex-chip--code strong { color: #111; font-variant-numeric: tabular-nums; }

.oplex-buybox {
  margin-top: 1rem;
  padding: 1.15rem 1.25rem 1.25rem;
  border: 1px solid #e8e8e8;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.055);
}
/* cena XXL */
.oplex-buybox .product__prices { margin-bottom: .35rem; }
.oplex-buybox .product__price {
  font-size: 2.15rem;
  font-weight: 800;
  color: #111;
  line-height: 1.05;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.oplex-buybox .product__regular-price { font-size: 1.15rem; color: #9aa0a6; }
.oplex-buybox .product__discount-percentage {
  font-size: .9rem;
  font-weight: 700;
  color: #fff;
  background: var(--oplex-accent, #f97316);
  padding: .12rem .5rem;
  border-radius: 6px;
}
.oplex-buybox .product__tax-label,
.oplex-buybox .product__tax-infos { font-size: .8rem; color: #8a8a8a; }

/* odstęp nad akcjami (ilość + koszyk) */
.oplex-buybox .product__actions { margin-top: .9rem; }

/* opis krótki nad buy-boxem — luźniej */
.product__description-short { margin: .25rem 0 .25rem; color: #555; }

@media (max-width: 767.98px) {
  .oplex-buybox { padding: 1rem; border-radius: 14px; }
  .oplex-buybox .product__price { font-size: 1.9rem; }
}

/* VIN-form (vincontact) pod buy-boxem — odstęp */
.oplex-buybox + .product__additional-info,
.product__additional-info { margin-top: 1rem; }

/* ============================================================
   Tytuł nad galerią + cień galerii + meta w buy-boxie
   ============================================================ */
.oplex-product-title {
  margin: 0 0 1.1rem;
  line-height: 1.15;
}

/* Cień głównego zdjęcia — spójny z buy-boxem (karta) */
.oplex-gallery__viewport {
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
}

/* Producent / Kod produktu — plain text na górze buy-boxa */
.oplex-buybox__meta {
  margin-bottom: .85rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid #eee;
  font-size: .92rem;
  color: #333;
}
.oplex-buybox__meta-row { line-height: 1.55; }
.oplex-buybox__meta-row .product__meta-label { color: #777; }
.oplex-buybox__meta-row strong { color: #111; font-variant-numeric: tabular-nums; }
.oplex-buybox__meta-row a { font-weight: 600; }

/* Wyrównanie kolumn do góry: buy-box (prawo) na poziomie góry tytułu (lewo) */
.product__container { align-items: start; }

/* Logo nagłówka — proporcjonalne skalowanie niezależnie od atrybutów width/height */
.oplex-featurebar__logo img,
.oplex-featurebar__logo .logo { height: auto; object-fit: contain; }
