/* Hummingbird Editor — product page bundle. CSS vars (--hbe-*) come from front.css (always loaded). */

/* ── FAQ accordion ───────────────────────────── */
/* Figma: tidy, enclosed list of expandable rows (packaging / shipping /
   payment) — top divider on every row + a closing bottom divider, with a
   touch more breathing room per row. */
.hbe-faq { margin: 2rem 0; border-bottom: 1px solid var(--c-grey-2); }
.hbe-faq__item { border-top: 1px solid var(--c-grey-2); }
.hbe-faq__question {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; padding: 1.15rem 0;
  font-family: var(--font-body); font-size: var(--fs-body-m); font-weight: 400;
  text-align: left; background: transparent; border: 0; cursor: pointer;
  line-height: 1.4;
}
.hbe-faq__icon { flex-shrink: 0; width: 1.25rem; height: 1.25rem; margin-left: 1rem; position: relative; }
.hbe-faq__icon::before,
.hbe-faq__icon::after { content: ''; position: absolute; background: currentColor; border-radius: 2px; }
.hbe-faq__icon::before { width: 14px; height: 1.5px; top: 50%; left: 50%; transform: translate(-50%,-50%); }
.hbe-faq__icon::after  { width: 1.5px; height: 14px; top: 50%; left: 50%; transform: translate(-50%,-50%); transition: transform 0.2s, opacity 0.2s; }
.hbe-faq__item--open .hbe-faq__icon::after { transform: translate(-50%,-50%) rotate(90deg); opacity: 0; }
.hbe-faq__answer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.25s ease; }
.hbe-faq__item--open .hbe-faq__answer { grid-template-rows: 1fr; }
/* min-height:0 is required for the 0fr→1fr collapse: without it the grid
   child keeps its content-based automatic minimum, so closed answers never
   actually collapse and every item looks permanently open. */
.hbe-faq__answer-inner { min-height: 0; overflow: hidden; margin: 0 0 1rem 0; line-height: normal; }
.hbe-faq__answer-inner p { margin: 0 0 0.75rem; font-family: var(--font-body); font-size: var(--fs-body-s); line-height: 1.6; }
.hbe-faq__answer-inner a { text-decoration: underline; }
.hbe-faq__answer-inner > :last-child { margin-bottom: 1rem; }

/* ── Related products carousel ("Inni kupili również") ─────────────────────── */
.hbe-related {
    margin: 2rem 0 1rem;
}
.hbe-related__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.hbe-related__title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--fs-h4);
    font-weight: 400;
    line-height: normal;
    color: var(--hbe-black);
}
.hbe-related__nav {
    display: flex;
    gap: 0.5rem;
}
.hbe-related__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: var(--hbe-black);
    cursor: pointer;
    background: transparent;
    border: 1px solid rgba(36, 36, 36, 0.25);
    border-radius: 50%;
    transition: border-color 0.2s, opacity 0.2s;
}
.hbe-related__arrow:hover:not(:disabled),
.hbe-related__arrow:focus-visible:not(:disabled) {
    border-color: var(--hbe-black);
}
.hbe-related__arrow:disabled {
    cursor: default;
    opacity: 0.3;
}
.hbe-related__viewport {
    overflow: hidden;
}
.hbe-related__track {
    display: flex;
    transition: transform 0.3s ease;
}
.hbe-related__card {
    display: flex;
    flex: 0 0 100%;
    gap: 1rem;
    align-items: center;
    min-width: 100%;
    padding: 0.75rem;
    background: var(--c-grey-1);
}
.hbe-related__card--skeleton {
    min-height: 136px;
}

/* "Inni kupili również" ładuje produkty lazy-ajaxem (related-carousel.js).
   Zanim JS potwierdzi, że SĄ produkty, blok trzyma miejsce (skeleton daje
   wysokość, nagłówek swoją), ale jest NIEWIDOCZNY — koniec migotania pustym
   szarym boksem, który potem znikał albo się wypełniał. Odsłania się dopiero
   z klasą hbe-related--ready (JS dodaje ją po wczytaniu danych); przy braku
   danych JS usuwa całą sekcję, więc miejsce się zwija. */
.hbe-related:not(.hbe-related--ready) {
    opacity: 0;
    visibility: hidden;
}
.hbe-related {
    transition: opacity 0.25s ease;
}
.hbe-related--ready {
    opacity: 1;
    visibility: visible;
}
.hbe-related__media {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 104px;
    height: 104px;
    background: var(--hbe-white);
}
.hbe-related__media img {
    max-width: 88%;
    max-height: 88%;
    object-fit: contain;
}
.hbe-related__info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}
.hbe-related__name {
    font-family: var(--font-body);
    font-size: var(--fs-body-m);
    font-weight: 400;
    line-height: 1.35;
    color: var(--hbe-black);
    text-decoration: none;
}
.hbe-related__name:hover {
    color: var(--hbe-black);
    text-decoration: underline;
}
.hbe-related__price {
    font-family: var(--font-body);
    font-size: var(--fs-body-m);
    font-weight: 400;
    line-height: normal;
    color: var(--hbe-black);
}
.hbe-related__tax {
    font-size: var(--fs-body-xs);
    color: var(--c-grey-5);
}
.hbe-related__form {
    margin-left: auto;
}
.hbe-related__cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    color: var(--hbe-black);
    cursor: pointer;
    background: var(--hbe-white);
    border: 0;
    transition: opacity 0.2s;
}
.hbe-related__cart:hover {
    opacity: 0.75;
}

/* ── Image + text split section (product page, below description) ──────────── */
.hbe-imgtext {
    display: grid;
    grid-template-columns: 1fr;
    margin: 2.5rem 0;
}
.hbe-imgtext__panel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
}
.hbe-imgtext__title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: var(--fs-h4);
    font-weight: 400;
    line-height: 1.2;
    color: var(--hbe-black);
}
.hbe-imgtext__desc {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--fs-body-s);
    font-weight: 400;
    line-height: 1.55;
    color: var(--c-grey-5);
}
.hbe-imgtext__cta {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.625rem 1rem;
    font-family: var(--font-body);
    font-size: var(--fs-body-xs);
    font-weight: 400;
    line-height: normal;
    color: var(--hbe-black);
    text-decoration: none;
    background: transparent;
    border: 1px solid var(--hbe-black);
    transition: background 0.2s, color 0.2s;
}
.hbe-imgtext__cta:hover,
.hbe-imgtext__cta:focus {
    color: var(--hbe-white);
    background: var(--hbe-black);
}
.hbe-imgtext__media {
    min-height: 220px;
}
.hbe-imgtext__img,
.hbe-imgtext__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
@media (min-width: 768px) {
    .hbe-imgtext {
        grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    }
    .hbe-imgtext__panel {
        padding: 2.5rem;
    }
    .hbe-imgtext__media {
        min-height: 320px;
    }
}


/* ── Zoom na okladce (inner) ──────────────────────────────────────────────
   Warstwa lezy dokladnie na aktywnym slajdzie karuzeli i nosi powiekszone
   zdjecie jako tlo — nic nie wychodzi poza obrys, wiec zoom nie rusza ukladu
   karty. Ladowana leniwie przez product-zoom.js, wiec dopoki klient nie najedzie,
   warstwa jest pusta i przezroczysta. */
.hbe-zoom-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-repeat: no-repeat;
  background-color: var(--c-white, #fff);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.carousel-item.hbe-zoom-on .hbe-zoom-layer.is-ready { opacity: 1; }
.carousel-item.hbe-zoom-on { cursor: crosshair; }

/* Flagi promocji i przycisk galerii zostaja czytelne nad powiekszeniem. */
.js-images-container .product-flags,
.js-images-container .product__zoom,
.js-images-container .carousel-control-prev,
.js-images-container .carousel-control-next { z-index: 2; }

/* Strzalki karuzeli zdjec: motyw daje im 15% szerokosci na calej wysokosci,
   czyli lacznie 30% powierzchni zdjecia. Przy zoomie to sabotaz — kursor
   wjezdza na przycisk zamiast na zdjecie, a na dotyku palec trafia w strzalke
   zamiast w kadr. Zwezamy je do samej ikony, wysrodkowanej w pionie. */
.js-images-container .carousel-control-prev,
.js-images-container .carousel-control-next,
.js-product-images-modal .carousel-control-prev,
.js-product-images-modal .carousel-control-next {
  top: 50%;
  bottom: auto;
  width: 3.5rem;
  height: 3.5rem;
  transform: translateY(-50%);
}
.js-images-container .carousel-control-prev,
.js-product-images-modal .carousel-control-prev { left: 0.5rem; }
.js-images-container .carousel-control-next,
.js-product-images-modal .carousel-control-next { right: 0.5rem; }

/* Podglad pelnoekranowy: pinch dwoma palcami skaluje samo zdjecie. */
.js-product-images-modal .carousel-item img {
  transform-origin: center center;
}
.js-product-images-modal .carousel-item img.is-zoomed {
  will-change: transform;
  touch-action: none;
}
