/* ==========================================================================
   Catalog Page CSS — Единый файл стилей страницы «Каталог оборудования»
   Подключает общую базу (shared-base.css) и содержит все стили страницы
   ========================================================================== */
@import url("shared-base.css");

/* ==========================================================================
   1. Хлебные крошки (копия из contacts.css)
   ========================================================================== */
.breadcrumbs {
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 20px;
}

.breadcrumbs__list {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.breadcrumbs__link {
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.breadcrumbs__link:hover {
  color: var(--text-white);
}

.breadcrumbs__separator {
  color: var(--text-muted);
  user-select: none;
}

.breadcrumbs__current {
  color: var(--accent-green);
  font-weight: 700;
}

/* ==========================================================================
   2. Catalog Hero — секция с хлебными крошками и баннером
   ========================================================================== */
.catalog-hero {
  padding: 120px 0 0 0;
  position: relative;
  z-index: 5;
  background-color: var(--bg-main);
}

.catalog-hero .container {
  max-width: 1200px;
  width: 100%;
  padding: 0 40px;
}

.catalog-combined-block {
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   3. Рекламный баннер
   ========================================================================== */
.catalog-banner {
  width: 100%;
  aspect-ratio: 16 / 5;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  background-color: var(--bg-card);
}

.catalog-banner__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ==========================================================================
   4. Лента категорий (Slider) — по механизму projects__slider
   ========================================================================== */
.catalog-categories {
  padding: 24px 48px 20px 48px;
  position: relative;
  z-index: 5;
  background: var(--accent-gradient);
  border-radius: 0 0 12px 12px;
}

.catalog-categories__slider-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.catalog-categories__slider {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  padding: 10px 0 15px 0;
  scrollbar-width: none;
}

.catalog-categories__slider::-webkit-scrollbar {
  display: none;
}

/* Стрелки навигации — идеальная центровка ровно посередине между гранью блока и первой/последней карточкой */
.catalog-categories__arrow {
  position: absolute;
  top: 50%;
  width: 24px;
  height: 44px;
  background: transparent;
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  padding: 0;
  opacity: 0.85;
}

.catalog-categories__arrow--prev {
  left: -24px;
  transform: translate(-50%, -50%);
}

.catalog-categories__arrow--next {
  right: -24px;
  transform: translate(50%, -50%);
}

.catalog-categories__arrow:hover {
  background-color: transparent;
  color: #ffffff;
  box-shadow: none;
  opacity: 1;
}

.catalog-categories__arrow--prev:hover {
  transform: translate(-50%, -50%) scale(1.15);
}

.catalog-categories__arrow--next:hover {
  transform: translate(50%, -50%) scale(1.15);
}

.catalog-categories__arrow--prev:active {
  transform: translate(-50%, -50%) scale(0.95);
}

.catalog-categories__arrow--next:active {
  transform: translate(50%, -50%) scale(0.95);
}

/* Точки-пагинаторы категорий */
.catalog-categories__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.catalog-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0;
  cursor: pointer;
  transition: all 0.3s ease;
}

.catalog-dot:hover {
  background-color: rgba(0, 0, 0, 0.5);
}

.catalog-dot--active {
  background-color: #0b0e0f;
  border-color: #0b0e0f;
  transform: scale(1.25);
}

/* ==========================================================================
   5. Карточка категории в слайдере (catalog-category-card)
   ========================================================================== */
.catalog-category-card {
  flex: 0 0 calc((100% - 60px) / 4);
  width: calc((100% - 60px) / 4);
  background-color: rgba(0, 0, 0, 0.2);
  background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.0) 100%);
  backdrop-filter: blur(2px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  scroll-snap-align: start;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
  opacity: 0.9; /* Слегка повысил непрозрачность по просьбе (с 0.7 до 0.9) */
}

.catalog-category-card--active {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
}

.catalog-category-card:hover {
  transform: translateY(-4px);
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.3);
}

.catalog-category-card--active:hover {
  opacity: 1;
}

.catalog-category-card__image-wrap {
  width: 100%;
  height: 220px; /* Жестко фиксируем высоту, чтобы белая подложка была всегда одинаковой */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-sizing: border-box;
  background-color: #ffffff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.catalog-category-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.catalog-category-card__title {
  display: flex;
  flex-grow: 1;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-white);
  line-height: 1.3;
  letter-spacing: 0.3px;
  margin: 0;
}

/* ==========================================================================
   6. Товары каталога — сетка карточек
   ========================================================================== */
.catalog-products {
  padding: 30px 0 60px 0;
  position: relative;
  z-index: 5;
  background-color: var(--bg-main);
}

.catalog-products .container {
  max-width: 1200px;
  width: 100%;
  padding: 0 40px;
}

.catalog-products__title {
  margin-bottom: 24px;
}

.catalog-products__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* Карточки товаров (по образцу equipment-card из style.css) */
.catalog-product-card {
  background-color: rgba(255, 255, 255, 0.02);
  background-image: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.0) 100%);
  backdrop-filter: blur(2px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}

.catalog-product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(210, 236, 43, 0.3);
  box-shadow: 0 0 25px rgba(210, 236, 43, 0.3);
}

.catalog-product-card__image-wrap {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  background-color: #ffffff;
  padding: 16px;
  box-sizing: border-box;
}

.catalog-product-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border: none;
  background: transparent;
  transform: none;
}

.catalog-product-card__content {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  padding: 16px 18px;
}

.catalog-product-card__title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 4px 0;
  color: var(--text-white);
}

.catalog-product-card__desc {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-muted);
  margin: 0;
}

.catalog-product-card__link {
  font-size: 12px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  transition: color 0.3s ease;
  margin-top: auto;
  padding-top: 12px;
}

.catalog-product-card__link .arrow {
  transition: transform 0.3s ease;
}

.catalog-product-card:hover .catalog-product-card__link {
  color: var(--accent-green);
}

.catalog-product-card:hover .catalog-product-card__link .arrow {
  transform: translateX(4px);
}

/* ==========================================================================
   7. Модальное окно товара (Popup)
   ========================================================================== */
.product-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  visibility: hidden;
  opacity: 0;
  transition: visibility 0.3s ease, opacity 0.3s ease;
  box-sizing: border-box;
}

.product-modal--active {
  visibility: visible;
  opacity: 1;
}

.product-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
}

.product-modal__content {
  position: relative;
  background-color: var(--bg-main);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow: hidden;
  z-index: 10;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.product-modal--active .product-modal__content {
  transform: scale(1) translateY(0);
}

.product-modal__body::-webkit-scrollbar {
  width: 6px;
}
.product-modal__body::-webkit-scrollbar-track {
  background: var(--bg-card);
  border-radius: 0 16px 16px 0;
}
.product-modal__body::-webkit-scrollbar-thumb {
  background: var(--accent-green);
  border-radius: 4px;
}

.product-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  transition: background-color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.product-modal__close:hover {
  background: var(--bg-card);
  border-color: var(--accent-green);
  color: var(--accent-green);
  transform: scale(1.1);
}

.product-modal__body {
  display: flex;
  flex-direction: column;
  padding: 40px;
  overflow-y: auto;
}

/* Верхняя часть: Галерея и краткая инфа */
.product-modal__top {
  display: flex;
  flex-direction: row;
  gap: 40px;
}

/* Галерея */
.product-modal__gallery {
  flex: 0 0 50%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.product-modal__main-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background-color: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.product-modal__main-image {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Чтобы медицинское оборудование не обрезалось */
}

.product-modal__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.3);
  border: none;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s ease, opacity 0.3s ease;
}

.product-modal__arrow:hover {
  background-color: var(--accent-green);
  color: #0b0e0f;
}

.product-modal__arrow--prev {
  left: 8px;
}

.product-modal__arrow--next {
  right: 8px;
}

.product-modal__arrow svg {
  width: 16px;
  height: 16px;
}

.product-modal__thumbnails {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
}

.product-modal__thumbnails::-webkit-scrollbar {
  height: 4px;
}
.product-modal__thumbnails::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}
.product-modal__thumbnails::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.product-modal__thumbnail {
  flex: 0 0 70px;
  height: 70px;
  background-color: #ffffff;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  padding: 4px;
}

.product-modal__thumbnail:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.product-modal__thumbnail--active {
  border-color: var(--accent-green);
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 196, 140, 0.2);
}

.product-modal__thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Краткая информация (справа от галереи) */
.product-modal__info-short {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-modal__title {
  font-size: 26px;
  margin-top: 0;
  margin-bottom: 24px;
  color: var(--text-white);
  line-height: 1.3;
  font-weight: 700;
}

.product-modal__short-features {
  list-style: none;
  padding: 0;
  margin: 0 0 32px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-modal__short-features li {
  font-size: 15px;
  color: #ccc;
  position: relative;
  padding-left: 20px;
  line-height: 1.4;
}

.product-modal__short-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-green);
}

/* Нижняя часть (подробности) */
.product-modal__details {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.product-modal__desc {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 40px;
}

.product-modal__subtitle {
  font-size: 18px;
  color: var(--text-white);
  margin-bottom: 12px;
  font-weight: 600;
}

.product-modal__features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 24px;
}

.product-modal__features li {
  font-size: 14px;
  color: #ccc;
  position: relative;
  padding-left: 20px;
  line-height: 1.4;
}

.product-modal__features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-green);
}

.product-modal__btn {
  margin-top: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--accent-green);
  color: var(--bg-main);
  font-weight: 600;
  padding: 16px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 16px;
}

.product-modal__btn:hover {
  background-color: #00e0a0;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 196, 140, 0.4);
}

.product-modal__btn svg {
  margin-left: 4px;
}

/* ==========================================================================
   8. Адаптивные стили
   ========================================================================== */

/* Планшет — 992px */
@media (max-width: 992px) {
  .catalog-hero {
    padding: 110px 0 0 0;
  }

  .catalog-hero .container,
  .catalog-products .container {
    max-width: 100%;
    width: 100%;
    padding: 0 20px;
    box-sizing: border-box;
  }

  .breadcrumbs {
    padding-top: 0;
    margin-bottom: 16px;
  }

  .catalog-banner {
    aspect-ratio: 16 / 6;
  }

  .catalog-categories {
    padding: 24px 36px 20px 36px;
  }

  .catalog-categories__arrow--prev {
    left: -18px;
  }

  .catalog-categories__arrow--next {
    right: -18px;
  }

  .catalog-category-card {
    flex: 0 0 calc((100% - 40px) / 3);
    width: calc((100% - 40px) / 3);
  }

  .catalog-products__grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

  .section-title {
    font-size: 28px;
    margin-bottom: 12px;
  }
}

/* Мобильный — 576px */
@media (max-width: 576px) {
  .catalog-hero {
    padding: 85px 0 0 0;
  }

  .catalog-hero .container,
  .catalog-products .container {
    padding: 0 16px;
  }

  .breadcrumbs {
    padding-top: 0;
    margin-bottom: 14px;
  }

  .breadcrumbs__list {
    font-size: 11px;
  }

  .catalog-banner {
    aspect-ratio: 16 / 9;
    border-radius: 10px 10px 0 0;
  }

  .catalog-categories {
    padding: 20px 16px 16px 16px;
  }

  /* Прячем стрелки слайдера на мобильных */
  .catalog-categories__arrow {
    display: none !important;
  }

  .catalog-category-card {
    flex: 0 0 calc((100% - 20px) / 2);
    width: calc((100% - 20px) / 2);
    scroll-snap-align: center;
  }

  .catalog-category-card__image-wrap {
    height: 120px;
  }

  .catalog-category-card__title {
    font-size: 11px;
    padding: 8px 6px 4px;
  }

  .catalog-categories__dots {
    display: flex;
  }

  .catalog-products {
    padding: 20px 0 40px 0;
  }

  .catalog-products__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .catalog-product-card {
    padding: 0;
  }

  .catalog-product-card__content {
    padding: 10px 12px 12px 12px;
  }

  .catalog-product-card__image-wrap {
    height: 120px;
  }

  .catalog-product-card__title {
    font-size: 14px;
  }

  .catalog-product-card__desc {
    font-size: 11px;
  }

  .section-title {
    font-size: 24px;
  }

  /* Адаптация модального окна товара (Popup) */
  .product-modal__content {
    max-height: 85vh;
  }

  .product-modal__top {
    flex-direction: column;
    gap: 24px;
  }

  .product-modal__gallery {
    flex: none;
    width: 100%;
  }

  .product-modal__info-short {
    flex: none;
    width: 100%;
  }

  .product-modal__features {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .product-modal__title {
    font-size: 20px;
    margin-bottom: 8px;
  }

  .product-modal__desc {
    font-size: 14px;
  }

  .product-modal__subtitle {
    font-size: 16px;
  }

  .product-modal__features li,
  .product-modal__short-features li {
    font-size: 14px;
  }

  .product-modal__close {
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
  }

  .product-modal__arrow {
    width: 28px;
    height: 28px;
  }

  .product-modal__arrow svg {
    width: 14px;
    height: 14px;
  }
}
