/* Fiberlogy – Nasze Bestsellery. Boxy jak na stronie Filamenty, strzałki i przyciski spójne z asystentem. */
.flb {
  --flb-blue: #0202cc;
  --flb-dark: #11121f;
  --flb-radius: 32px;
  --flb-ease: cubic-bezier(.22, .61, .36, 1);
  --flb-gap: 20px;
  box-sizing: border-box;
  margin: 3.5rem clamp(16px, 4vw, 72px);
  color: var(--flb-dark);
}
.flb *, .flb *::before, .flb *::after { box-sizing: border-box; }
:where(.flb) button { font: inherit; }

.flb__header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.flb__title { margin: 0; font-size: 40px; font-weight: 600; line-height: 1.1; letter-spacing: -1.8px; color: var(--flb-dark); text-wrap: balance; }

/* Strzałki – jak na banerze: zaokrąglony prostokąt z cienkim konturem i pogrubionym szewronem */
.flb__nav { display: flex; gap: 12px; }
.flb__nav.is-hidden { display: none; }
.flb__arrow {
  display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; cursor: pointer; color: var(--flb-dark);
  background: transparent; border: 1px solid var(--flb-dark); border-radius: 10px; transition: background .3s ease, color .3s ease, opacity .3s ease;
}
.flb__arrow:hover:not(:disabled), .flb__arrow:focus-visible { background: var(--flb-dark); color: #fff; }
.flb__arrow:disabled { opacity: .3; cursor: default; }
.flb__arrow--prev .flb__arrow-inner { transform: rotate(180deg); }
.flb__arrow-inner { display: inline-flex; align-items: center; justify-content: center; }
.flb__arrow-inner svg { width: 16px; height: 16px; }

/* Slider */
.flb__track {
  display: flex; gap: var(--flb-gap); overflow-x: auto; padding: 4px 4px 28px; margin: -4px -4px 0;
  scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
}
.flb__track::-webkit-scrollbar { display: none; }

/* Box produktu (wygląd z boxów Filamenty) */
.flb__box {
  --accent: #818cf8;
  position: relative; isolation: isolate; display: flex; flex: 0 0 min(360px, 82vw); align-items: flex-end; min-height: 440px; overflow: hidden;
  scroll-snap-align: start; color: #fff; background: #0f172a; border-radius: var(--flb-radius); box-shadow: 0 10px 30px rgba(15, 23, 42, .12);
}
.flb__box:nth-child(4n+2) { --accent: #34d399; }
.flb__box:nth-child(4n+3) { --accent: #fbbf24; }
.flb__box:nth-child(4n+4) { --accent: #fb7185; }

.flb__bg { position: absolute; inset: 0; z-index: 0; transform: scale(1); transition: transform 1s var(--flb-ease); }
.flb__bg img { display: block; width: 100%; height: 100%; object-fit: cover; }
.flb__box:hover .flb__bg, .flb__box:focus-within .flb__bg { transform: scale(1.07); }

/* ciemny gradient od dołu, po najechaniu niebieska nakładka #0202cc */
.flb__box::before, .flb__box::after { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; transition: opacity .5s ease; }
.flb__box::before { background: linear-gradient(to top, rgba(2, 6, 23, .9) 0%, rgba(2, 6, 23, .55) 35%, rgba(2, 6, 23, .05) 100%); }
.flb__box::after { background: rgba(2, 2, 204, .82); opacity: 0; }
.flb__box:hover::before, .flb__box:focus-within::before { opacity: 0; }
.flb__box:hover::after, .flb__box:focus-within::after { opacity: 1; }

.flb__link { position: absolute; inset: 0; z-index: 2; border-radius: inherit; }
.flb__link:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

.flb__content { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 32px; pointer-events: none; }
.flb__badge {
  display: inline-block; margin-bottom: 12px; padding: 5px 12px; border: 1px solid var(--accent); border-radius: 999px; background: rgba(255, 255, 255, .08);
  color: var(--accent); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; transition: color .4s ease, border-color .4s ease;
}
.flb__box:hover .flb__badge, .flb__box:focus-within .flb__badge { color: #fff; border-color: #fff; }
.flb__name { margin: 0; color: #fff; font-size: 1.75rem; font-weight: 700; line-height: 1.2; letter-spacing: -.3px; }

/* opis + przycisk: zwinięte do 0 wysokości, po najechaniu rozwijają się, a tytuł (kotwiczony do dołu) płynnie jedzie w górę */
.flb__reveal { display: grid; grid-template-rows: 0fr; width: 100%; opacity: 0; transition: grid-template-rows .6s var(--flb-ease), opacity .4s ease; }
.flb__reveal-inner { min-height: 0; overflow: hidden; padding-top: 14px; }
.flb__box:hover .flb__reveal, .flb__box:focus-within .flb__reveal { grid-template-rows: 1fr; opacity: 1; transition-delay: 0s, .12s; }
.flb__desc { display: -webkit-box; margin: 0; overflow: hidden; color: #fff; font-size: .98rem; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }

/* Przycisk – jak w boksach Filamentów: kontur, wersaliki, białe wypełnienie wjeżdża od lewej */
.flb__cta {
  position: relative; display: inline-block; margin-top: 18px; padding: 12px 35px;
  color: #fff; font-size: 1rem; font-weight: 500; letter-spacing: 1px; text-transform: uppercase;
  text-decoration: none; border: 1px solid #fff; border-radius: 20px; cursor: pointer; pointer-events: auto;
  background: linear-gradient(#fff, #fff) no-repeat 0 0 / 0% 100% transparent;
  transition: color .4s ease, background-size .4s ease;
}
.flb__cta:hover, .flb__cta:focus-visible { color: #000; background-size: 100% 100%; }

/* Ostatni box: „Poznaj pełną gamę” */
.flb__box--cta { background: #02bfff; }
.flb__box--cta::before { background: none; }
.flb__box--cta::after { background: rgba(255, 255, 255, .12); }
.flb__box--cta .flb__name { font-size: 2rem; letter-spacing: -.8px; }
.flb__desc--static { margin-top: 14px; -webkit-line-clamp: unset; display: block; }
.flb__box--cta .flb__cta { margin-top: 24px; }

/* Wejście boxów po wjechaniu sekcji w widok */
.flb.is-ready:not(.is-in) .flb__box { opacity: 0; transform: translate3d(0, 36px, 0); }
.flb.is-ready.is-in .flb__box { animation: flb-rise .8s var(--flb-ease) backwards; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes flb-rise { from { opacity: 0; transform: translate3d(0, 36px, 0); } to { opacity: 1; transform: none; } }

/* Ekrany dotykowe: brak hovera, więc opis i przycisk są od razu widoczne */
@media (hover: none) {
  .flb__reveal { grid-template-rows: 1fr; opacity: 1; }
  .flb__cta { color: #fff; }
}

@media (max-width: 1024px) {
  .flb__title { font-size: 32px; letter-spacing: -1.3px; }
  .flb__box { min-height: 400px; }
}
@media (max-width: 640px) {
  .flb__title { font-size: 28px; }
  .flb__header { margin-bottom: 20px; }
  .flb__content { padding: 24px; }
  .flb__name { font-size: 1.5rem; }
  .flb__box--cta .flb__name { font-size: 1.7rem; }
  .flb__cta { padding: 11px 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .flb *, .flb::before { transition: none !important; animation: none !important; }
  .flb.is-ready:not(.is-in) .flb__box { opacity: 1; transform: none; }
}
