/* ────────────────────────────────────────────────
 * Categories carousel
 * Source: extracted from index.css lines 1609–1800
 * ──────────────────────────────────────────────── */

/* Categories — Compact Carousel */
.categories {
  position: relative;
  padding: 16px 0 32px 0;
}

.categories .wrapper {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: 100%;
}

/* Компактная карусель — padding для рамок */
.categoriesSlider {
  position: relative;
  padding: 0.75rem 0 1.5rem 0;
  /* Раніше було margin: 0 -1.25rem + width: calc(100% + 2.5rem) — slider
     виходив за межі wrapper'а. Внизу видно як останній слайд обрізається
     viewport-ом. Тримаємо у wrapper-width, peek-effect через padding-right
     на swiper якщо треба. */
  max-width: 100%;
  min-width: 0;
  min-height: 6rem;
  overflow: hidden;
}

.categoriesSlider .swiper-wrapper {
  display: flex;
}

.categoriesNav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.categories .categoriesNav .swiper-button-prev,
.categories .categoriesNav .swiper-button-next {
  position: relative !important;
  left: unset !important;
  right: unset !important;
  top: unset !important;
  transform: none !important;
  margin: 0;
}

.categoriesSlider .swiper-button-prev svg,
.categoriesSlider .swiper-button-next svg,
.categoriesNav .swiper-button-prev svg,
.categoriesNav .swiper-button-next svg {
  width: 24px !important;
  height: 24px !important;
  flex-shrink: 0 !important;
  display: block !important;
}

.swiper-wrapper {
  height: unset;
}

/* Category Cards — Balanced Carousel.
   Use inset box-shadow as "border" so overflowing icons (negative margin-top)
   don't get crossed by a real border line. */
.categoriesSlider .swiper-slide {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--overlay-light-10);
  border-radius: 0;
  transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  height: auto;
  min-height: 5rem;
  background: rgba(255,255,255,0.02);
  width: auto;
  min-width: 16rem;
  flex-shrink: 0;
  overflow: visible;
}

.categoriesSlider .swiper-slide:hover {
  box-shadow: inset 0 0 0 1px var(--color-accent);
  background: var(--overlay-accent-05);
}

.categoriesSlider .swiper-slide:hover img,
.categoriesSlider .swiper-slide:hover svg {
  transform: scale(1.08);
}

.categoriesSlider .swiper-slide:hover .categoriesInfo div {
  transform: translateX(0.375rem);
}

.categoriesSlider img,
.categoriesSlider svg {
  width: 3rem;
  height: 3rem;
  object-fit: contain;
  object-position: center;
  transition: transform 0.3s ease, opacity 0.3s ease, color 0.3s ease, background-color 0.3s ease;
  flex-shrink: 0;
}
/* Category icons — uniform silhouette via brightness(0) + invert.
   Без цього кожна іконка має свій оригінальний колір/деталі (різні
   дизайнери) → візуальна "збірна солянка". brightness(0) робить будь-яку
   іконку чорним силуетом — гарантована консистентність. На тёмній темі
   плюс invert(1) щоб були білі. На hover — accent-color через invert+sepia. */
.categoriesInfo img {
  width: 4.5rem;
  height: 4.5rem;
  margin-top: -1.5rem;
  position: relative;
  z-index: 2;
  /* Чорний силует, потім invert у dark theme */
  filter: brightness(0) invert(1);
  opacity: 0.55;
  transition: filter 0.3s ease, opacity 0.3s ease;
}
.categoriesSlider .swiper-slide:hover .categoriesInfo img {
  /* Accent-color на hover: brightness(0) → black silhouette,
     invert(0.6) → grey, sepia(1) → orange-tinted, hue-rotate тонко
     підгонить під brand accent #C78C47 */
  filter: brightness(0) saturate(100%) invert(63%) sepia(20%) saturate(950%) hue-rotate(355deg) brightness(95%) contrast(85%);
  opacity: 1;
}
/* White theme: іконки чорні (без invert), на hover accent-orange */
.white_fon .categoriesInfo img {
  filter: brightness(0);
  opacity: 0.5;
}
.white_fon .categoriesSlider .swiper-slide:hover .categoriesInfo img {
  filter: brightness(0) saturate(100%) invert(63%) sepia(20%) saturate(950%) hue-rotate(355deg) brightness(95%) contrast(85%);
  opacity: 1;
}

/* Arrow icon (external SVG) */
.categoriesSlider .swiper-slide > svg {
  width: 1.25rem;
  height: 1.25rem;
  opacity: 0.3;
  transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease, background-color 0.2s ease;
  flex-shrink: 0;
}

.categoriesSlider .swiper-slide:hover > svg {
  opacity: 1;
  transform: translateX(0.25rem);
}

.categoriesSlider .swiper-slide > svg path {
  stroke: currentColor;
}

.categoriesInfo {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
  overflow: visible;
}

.categoriesInfo div {
  transition: transform 0.3s ease, opacity 0.3s ease, color 0.3s ease, background-color 0.3s ease;
  min-width: 0;
}

.categoriesInfo h3,
.categoriesInfo h5 {
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.3;
  margin-bottom: 0.25rem;
}

.categoriesInfo p {
  font-weight: 500;
  font-size: 0.8125rem;
  line-height: 1;
  color: var(--overlay-light-50);
  white-space: nowrap;
}
