/* ===== ОБЩИЙ КАТАЛОГ ===== */

.catalog {
  padding: 56px 0 80px;
  background: #fff;
}

.catalog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

/* ----- вкладки ----- */

/* Лента вкладок — внешний вид тот же, только поведение */
.catalog-tabs {
    display: flex;
    flex-wrap: nowrap;          /* Запрещаем перенос на вторую строку */
    overflow-x: auto;           /* Включаем горизонтальный скролл */
    overflow-y: hidden;
    gap: 32px;                  /* Увеличиваем расстояние между категориями для чистоты */
    padding: 10px 0 15px;       /* Отступы сверху и снизу */
    border-bottom: 1px solid #f0f0f0;
    
    /* Скрываем стандартный некрасивый скроллбар */
    scrollbar-width: none;      /* Firefox */
    -ms-overflow-style: none;   /* IE/Edge */
    cursor: grab;               /* Курсор "ручка" для десктопа */
}

.catalog-tabs::-webkit-scrollbar {
  display: none;              /* Chrome/Safari — скрыть полосу */
}

.catalog-tabs:active {
  cursor: grabbing;
}

.catalog-tab {
    position: relative;
    white-space: nowrap;        /* Текст не переносится внутри кнопки */
    background: none;
    border: none;
    padding: 0 0 12px 0;
    font-family: "Inter", sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #888;
    transition: color 0.3s ease;
    cursor: pointer;
}

.catalog-tab-count {
    font-size: 11px;
    margin-left: 6px;
    color: #ccc;                /* Делаем скобки менее заметными, чтобы не отвлекали */
    font-weight: 400;
}

.catalog-tab::after {
    content: "";
    position: absolute;
    bottom: -1px;               /* Прижимаем к нижней границе */
    left: 0;
    width: 0;
    height: 1.5px;
    background: #111;
    transition: width 0.3s ease;
}

.catalog-tab.is-active {
    color: #111;                /* Активный текст — черный */
}

.catalog-tab.is-active::after {
    width: 100%;                /* Линия выезжает на всю ширину */
}

.catalog-tab:hover {
    color: #111;
}

/* ----- кнопка "Фильтр" ----- */

.catalog-filter-toggle {
  border: none;
  background: transparent;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #111;
  cursor: pointer;
}

/* ===== СЕТКА ТОВАРОВ ===== */

.catalog-tabs-content {
  margin-top: 16px;
}

:root {
  --transition-smooth: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.catalog-grid {
  display: none; /* По умолчанию скрыто */
  opacity: 0;
  gap: 24px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  transition: opacity 0.4s ease; /* Только opacity для плавности */
}

.catalog-grid.is-active {
  display: grid; /* Включаем отображение */
  opacity: 1;    /* Делаем видимым */
}
/* карточка товара */

.catalog-card {
  border-radius: 12px;
  overflow: hidden;
  transition: var(--transition-smooth);
}

/* большая карточка */

.catalog-card--large {
  grid-column: span 2;
  grid-row: span 2;
}

/* избранное (иконка-сердце заглушка) */

/* .catalog-card-fav {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
} */

/* .catalog-card-fav::before {
  content: "♥";
  display: block;
  font-size: 10px;
  line-height: 20px;
  text-align: center;
  color: #d0d0d0;
} */

/* медиа (фото/видео) */

.catalog-card-media {
  display: block;
  position: relative;
  overflow: hidden;
  background: #f5f5f5;
}

.catalog-card-media img {
  opacity: 1; /* Картинки ВСЕГДА должны быть видны */
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.catalog-card-media video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0; /* Видео скрыто */
  transition: opacity 0.3s ease;
  pointer-events: none; /* Чтобы не мешало кликать по карточке */
}

.catalog-card:hover .catalog-card-media video {
  opacity: 1;
}

.card-actions {
  z-index: 15; /* Выше видео */
}

/* базовое соотношение сторон */

.catalog-card:not(.catalog-card--large) .catalog-card-media {
  aspect-ratio: 4 / 5;
}

.catalog-card--large .catalog-card-media {
  aspect-ratio: 3 / 4;
}

/* бейджи NEW / НЕТ В НАЛИЧИИ */

.catalog-card-badge {
    position: absolute; /* Абсолютное позиционирование относительно .catalog-card-media */
    top: 12px;          /* Отступ сверху */
    left: 12px;         /* Отступ слева */
    z-index: 20;        /* Выше, чем видео и кнопки действий */
    
    padding: 6px 10px;  /* Внутренние отступы для красоты */
    font-size: 10px;
    letter-spacing: 0.05em;
    
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 2px;
    font-weight: 500;
}

.catalog-card-badge--new {
  background: #56348b;
  color: #fff;
}

.catalog-card-badge--out {
    background: rgba(255, 255, 255, 0.9);
    color: #000;
}

/* текстовая часть */

.catalog-card-body {
  padding-top: 10px;
}

.catalog-card-category {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #999;
  margin-bottom: 4px;
}

.catalog-card-title {
  font-family: "Playfair Display", "Times New Roman", serif;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  margin: 0 0 6px;
  color: #111;
}

/* футер карточки: цена + корзина */

.catalog-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.catalog-card-price {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 500;
}

/* .catalog-card-add {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  cursor: pointer;
} */

.catalog-card-add::before {
  content: "";
  display: block;
  width: 14px;
  height: 14px;
  margin: 5px auto;
  border: 2px solid #111;
  border-radius: 2px;
}

/* пустое состояние */

.catalog-empty {
  grid-column: 1 / -1;
  font-size: 14px;
  color: #888;
}

/* кнопка "Показать ещё" */

.catalog-more {
  grid-column: 1 / -1;
  margin: 24px auto 0;
  padding: 10px 32px;
  border-radius: 999px;
  border: 1px solid #111;
  background: transparent;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

/* скрытые карточки для пагинации по 12 */

.catalog-card.is-hidden {
  display: none;
}

/* ===== АДАПТИВ ===== */

@media (max-width: 1199px) {
  .catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .catalog-card--large {
    grid-column: span 2;
    grid-row: span 2;
  }
}

@media (max-width: 900px) {
  .catalog-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-card--large {
    grid-column: span 2;
    grid-row: auto;
  }
}

@media (max-width: 600px) {
  .catalog-grid {
    grid-template-columns: 1fr;
  }
}

.catalog-card {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

/* лёгкий подъём и тень карточки */
.catalog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.06);
}

/* чтобы картинка/видео “сидели” в рамке */
.catalog-card-media {
  overflow: hidden;
  border-radius: 8px;
}

/* плавная анимация самого изображения/видео */
.catalog-card-media img,
.catalog-card-media video {
  transition: transform 0.45s ease;
}

/* лёгкое приближение при наведении */
.catalog-card:hover .catalog-card-media img,
.catalog-card:hover .catalog-card-media video {
  transform: scale(1.06);
}


/* Контейнер для кнопок внутри медиа-блока */
.catalog-card-media {
    position: relative;
}

.card-actions {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Показываем кнопки при наведении на всю карточку */
.catalog-card:hover .card-actions {
    opacity: 1;
    transform: translateX(0);
}

/* Общий стиль кнопок-кружков */
.btn-action {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: var(--transition-smooth);
}

.btn-action:active {
  transform: scale(0.9);
}


.btn-action svg {
    width: 18px;
    height: 18px;
}

.btn-action:hover {
    background: #111;
    color: #fff;
    transform: scale(1.1);
}

/* Адаптив для мобильных: кнопки видны всегда */
@media (max-width: 768px) {
    .card-actions {
        opacity: 1;
        transform: translateX(0);
        bottom: 8px;
        right: 8px;
    }
    .btn-action {
        width: 34px;
        height: 34px;
    }
}

/* ФИЛЬТР */


/* Панель фильтра */
.filter-aside {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}

.filter-aside.is-open {
    opacity: 1;
    pointer-events: auto;
}

.filter-aside__overlay {
    flex: 1;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.filter-aside__content {
    width: 350px;
    background: #fff;
    display: flex;
    flex-direction: column;
    padding: 40px 30px;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    transform: translateX(24px);
    transition: transform 0.34s cubic-bezier(0.23, 1, 0.32, 1);
}

.filter-aside.is-open .filter-aside__overlay {
    opacity: 1;
}

.filter-aside.is-open .filter-aside__content {
    transform: translateX(0);
}

.filter-aside__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.filter-aside__header h3 {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 18px;
}

.filter-aside__close {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
}

/* Группа фильтрации */
.filter-group__title {
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 20px;
    letter-spacing: 0.05em;
}

.price-inputs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.price-inputs input {
    width: 50%;
    padding: 12px;
    border: 1px solid #eee;
    font-size: 14px;
    border-radius: 4px;
}

/* Используем ваш старый класс как обертку */
.price-slider-container {
    position: relative;
    width: 100%;
    height: 20px;
    margin-top: 10px;
}

/* Стили ползунка */
.price-slider-container input[type="range"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-appearance: none; /* Сброс стандартных стилей */
    background: none;         /* Прозрачный фон */
    pointer-events: none;     /* ВАЖНО: клики проходят сквозь полоску */
    z-index: 2;
    margin: 0;
    padding: 0;
    border: none;
}

.price-slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: auto;     /* ВАЖНО: клики работают только на кружке */
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;         /* Белый центр */
    border: 2px solid #111;   /* Черная обводка */
    cursor: pointer;
    margin-top: -6px;         /* Центрирование */
    position: relative;
    z-index: 3;
}


.price-slider-container input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #111;
    cursor: pointer;
    transform: translateY(2px);
    z-index: 3;
}

/* Серая линия (фон) */
.slider-track-bg {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background: #eee;
    transform: translateY(-50%);
    border-radius: 2px;
    z-index: 0;
}

/* Черная линия (активный диапазон) */
.slider-track-fill {
    position: absolute;
    top: 50%;
    height: 4px;
    background: #111;
    transform: translateY(-50%);
    z-index: 1;
    border-radius: 2px;
    /* Ширина и отступ считаются в JS */
}

/* Кнопки в футере */
.filter-aside__footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-filter {
    padding: 15px;
    border: none;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: 0.3s;
}

.btn-filter--apply { background: #111; color: #fff; }
.btn-filter--reset { background: #f5f5f5; color: #111; }
.btn-filter--cancel { background: transparent; color: #888; text-decoration: underline; }
.btn-filter:hover { opacity: 0.8; }

.btn-filter:hover { opacity: 0.8; }


/* БАЗОВОЕ СОСТОЯНИЕ */
.btn-action {
    background: white;
    transition: all 0.2s ease;
}

.btn-action svg {
    stroke: black;
    fill: none;
}

/* АКТИВНОЕ СОСТОЯНИЕ */
.btn-action.in-wishlist,
.btn-action.in-cart {
    background: #56348b;
}

.btn-action.in-wishlist svg,
.btn-action.in-cart svg {
    stroke: white !important;
    fill: white !important;
}

body.filter-open {
  overflow: hidden;
}
