/* ===== Oplex sekcje home (oplexcatproducts) ===== */
.oplexcat-section { margin: 3.25rem 0; }
.oplexcat-section__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem;
}
.oplexcat-section__title { font-size: 1.4rem; font-weight: 800; margin: 0; color: #181818; }
.oplexcat-section__more { margin-top: 1.25rem; text-align: center; }

/* --- układ: grid --- */
.oplexcat-list--grid {
  display: grid;
  grid-template-columns: repeat(var(--oplexcat-cols, 5), minmax(0, 1fr));
  gap: 1rem;
}

/* --- układ: slider (scroll-snap, wszystkie elementy w DOM = SEO) --- */
.oplexcat-list--slider {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  /* zapas u góry/dołu by cień kafli nie był przycinany (overflow-x:auto przycina też pion) */
  padding: .5rem 0 1.75rem;
  /* ukryty scrollbar (nadal przewijalny) */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.oplexcat-list--slider > .oplexcat-list__item {
  flex: 0 0 calc((100% - (var(--oplexcat-cols, 5) - 1) * 1rem) / var(--oplexcat-cols, 5));
  scroll-snap-align: start;
}
.oplexcat-list--slider::-webkit-scrollbar { height: 0; width: 0; display: none; }
/* autoplay: bez snap i smooth — inaczej ciągły JS-scroll jest blokowany */
.oplexcat-list--slider[data-autoplay="1"] { scroll-snap-type: none; scroll-behavior: auto; }
.oplexcat-list--slider[data-autoplay="1"] > .oplexcat-list__item { scroll-snap-align: none; }
/* tryb prezentacja: scroll płynny (centrowanie krokowe) */
.oplexcat--showcase .oplexcat-list--slider { scroll-behavior: smooth; }

/* === tryb PREZENTACJA: aktywna karta rośnie, rozpychając sąsiadów === */
.oplexcat--showcase .oplexcat-list { align-items: center; }
.oplexcat--showcase .oplexcat-list__item {
  transition: flex-basis .5s ease, transform .5s ease, box-shadow .5s ease, opacity .5s ease;
  transform-origin: center center;
  opacity: .82;
}
.oplexcat--showcase .oplexcat-list__item.is-active {
  flex-basis: calc(((100% - (var(--oplexcat-cols, 5) - 1) * 1rem) / var(--oplexcat-cols, 5)) * 1.4) !important;
  opacity: 1; z-index: 2;
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
@media (max-width: 1199.98px) {
  .oplexcat--showcase .oplexcat-list__item.is-active { flex-basis: calc((100% - 3rem) / 4 * 1.4) !important; }
}
@media (max-width: 767.98px) {
  .oplexcat--showcase .oplexcat-list__item.is-active { flex-basis: calc((100% - 1rem) / 2 * 1.25) !important; }
}
@media (max-width: 479.98px) {
  .oplexcat--showcase .oplexcat-list__item.is-active { flex-basis: 80% !important; }
}

/* strzałki slidera */
.oplexcat-arrows { display: flex; gap: .4rem; flex: 0 0 auto; }
.oplexcat-arrow {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid #e5e7eb; background: #fff; color: #374151;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
.oplexcat-arrow:hover { border-color: var(--oplex-accent, #f97316); color: var(--oplex-accent, #f97316); }
.oplexcat-arrow .material-icons { font-size: 22px; }

/* --- karty kategorii: zdjęcie u góry + stopka --- */
.oplexcat-card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid #ececec; border-radius: 12px;
  overflow: hidden; text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.oplexcat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.10); border-color: #e2e2e2; }
.oplexcat-card__media {
  display: block; width: 100%; aspect-ratio: 4 / 3;
  background-color: #f3f4f6;
  object-fit: cover;
}
.oplexcat-card__body { display: flex; flex-direction: column; gap: .15rem; padding: .85rem 1rem 1rem; }
.oplexcat-card__label { font-weight: 800; color: #181818; font-size: 1.02rem; line-height: 1.25; }
.oplexcat-card__count { color: #8a8a8a; font-size: .85rem; }

/* --- karty produktów: premium karta (.product-miniature) niesie cały wygląd; wrapper przezroczysty (koniec podwójnego kontenera) --- */
.oplexcat-section:not(.oplexcat-cards) .oplexcat-list__item {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}
.oplexcat-section:not(.oplexcat-cards) .oplexcat-list__item .product-miniature,
.oplexcat-section:not(.oplexcat-cards) .oplexcat-list__item article {
  height: 100%;
}

/* --- responsywność --- */
@media (max-width: 1199.98px) {
  .oplexcat-list--grid { grid-template-columns: repeat(min(var(--oplexcat-cols, 5), 4), minmax(0, 1fr)); }
  .oplexcat-list--slider > .oplexcat-list__item { flex-basis: calc((100% - 3rem) / 4); }
}
@media (max-width: 767.98px) {
  .oplexcat-list--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .oplexcat-list--slider > .oplexcat-list__item { flex-basis: calc((100% - 1rem) / 2); }
  .oplexcat-section__title { font-size: 1.2rem; }
}
@media (max-width: 479.98px) {
  .oplexcat-list--slider > .oplexcat-list__item { flex-basis: 78%; }
}

/* Sekcje logo (marki/producenci) — uploady 500x500, równe skalowanie: kwadrat + contain + padding */
.oplexcat-cards--logos .oplexcat-card__media{aspect-ratio:1/1;object-fit:contain;padding:16px;background:#fff;}
.oplexcat-cards--logos .oplexcat-card__media--text{aspect-ratio:1/1;display:flex;align-items:center;justify-content:center;text-align:center;font-weight:700;color:#333;padding:10px;background:#f7f7f7;}

.oplexcat-cards--contain .oplexcat-card__media{padding:16px;background:#fff;}
.oplexcat-cards--contain .oplexcat-card__media--text{background:#f7f7f7;}
