/* =============================================================================
   styles-catalog.css — Живой лавандовый стиль с золотыми акцентами
   ============================================================================= */

/* === 1. ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ (Светлая живая тема) === */
:root {
  /* Фоны */
  --cat-bg: #f4efe9; /* Лёгкий, воздушный лавандово-пастельный фон с капелькой света */
  --cat-surface: #ffffff; /* Чистые белые карточки */
  --cat-surface-hover: #faf7fc; /* Плавный фон при наведении */

  /* Акценты (Фиолетовый + Золото/Желтый) */
  --cat-primary: #7c3aed; /* Благородный, глубокий фиолетовый (элегантный и насыщенный) */
  --cat-primary-hover: #6d28d9; /* Более густой фиолетовый для ховеров */
  --cat-badge-bg: #d97706; /* Теплый золотисто-желтый акцент для бейджей скидок (оживляет страницу) */

  /* Текст */
  --cat-text-main: #231b2e; /* Насыщенный сливово-темный текст */
  --cat-text-muted: #6b5d7d; /* Приглушенный лавандово-серый */

  /* Линии и Тени */
  --cat-border: #e9e2f0; /* Изящные лиловые обводки */
  --cat-shadow-sm: 0 4px 12px rgba(124, 58, 237, 0.06); /* Легкая фиолетовая тень */
  --cat-shadow-md: 0 10px 25px rgba(124, 58, 237, 0.12);

  /* Футер */
  --cat-footer-bg: #231b2e;
  --cat-footer-text: #d8cfe3;
  --cat-footer-border: rgba(255, 255, 255, 0.08);

  /* Скругления */
  --cat-radius-sm: 8px;
  --cat-radius-md: 16px;
  --cat-radius-pill: 99px;

  /* Отступы */
  --cat-space-sm: 0.5rem;
  --cat-space-md: 1rem;
  --cat-space-lg: 1.5rem;
  --cat-space-xl: 2.5rem;

  /* Шрифты */
  --cat-font: "Inter", -apple-system, sans-serif;
}

/* === 2. ТЕМНАЯ ТЕМА (Черничное ночное небо + Золото) === */
html[data-theme="dark"] {
  --cat-bg: #130f1c; /* Глубокий темный чернично-фиолетовый фон */
  --cat-surface: #1e1729; /* Карточки с красивым темным фиолетовым отливом */
  --cat-surface-hover: #292036;

  --cat-primary: #a78bfa; /* Светящийся мягкий фиолетовый для темной темы */
  --cat-primary-hover: #c4b5fd;
  --cat-badge-bg: #f59e0b; /* Насыщенное золото/яннтарь для бейджей в темной теме */

  --cat-text-main: #f5f2fa; /* Чистый светлый текст */
  --cat-text-muted: #9a8ba8; /* Лавандово-серый текст */
  --cat-border: #322642; /* Тёмные контуры карточек */

  --cat-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.4);
  --cat-shadow-md: 0 12px 30px rgba(167, 139, 250, 0.15); /* Цветная тень */

  /* Футер */
  --cat-footer-bg: #0b0810;
  --cat-footer-text: #9a8ba8;
  --cat-footer-border: rgba(255, 255, 255, 0.05);
}

/* === 3. БАЗОВЫЕ СТИЛИ === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: var(--cat-font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--cat-text-main);
  background-color: var(--cat-bg);
  -webkit-font-smoothing: antialiased;
}
a {
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}
img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.d-flex-right {
  display: flex;
  justify-content: flex-end;
}

/* === 4. КНОПКА ПЕРЕКЛЮЧЕНИЯ ТЕМЫ === */
.theme-switch-wrapper {
  background: var(--cat-surface);
  padding: 10px 0 0 0;
}
.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--cat-border);
  border-radius: var(--cat-radius-pill);
  color: var(--cat-text-main);
  padding: 6px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-family: inherit;
  transition: all 0.2s;
}
.theme-toggle-btn:hover {
  background: var(--cat-surface-hover);
  border-color: var(--cat-primary);
  color: var(--cat-primary);
}

/* === 5. ШАПКА === */
.header {
  background: var(--cat-surface);
  color: var(--cat-text-main);
  padding: 20px 20px 40px;
  text-align: center;
  border-bottom: 1px solid var(--cat-border);
}
.header__title {
  font-size: clamp(1.8rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: var(--cat-space-sm);
}
.header__subtitle {
  font-size: 1rem;
  color: var(--cat-text-muted);
}

/* Социальные сети под шапкой */
.socials-bar {
  background: var(--cat-surface);
  padding: 12px 0;
  border-bottom: 1px solid var(--cat-border);
}
.socials-bar__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--cat-space-md);
  flex-wrap: wrap;
}
.socials-bar__label {
  font-size: 0.9rem;
  color: var(--cat-text-muted);
  font-weight: 500;
}
.socials-bar__icons {
  display: flex;
  gap: 10px;
  align-items: center;
}
.socials-bar__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--cat-text-muted);
  border-radius: var(--cat-radius-pill);
  border: 1px solid var(--cat-border);
  transition: all 0.2s ease;
}
.socials-bar__icon:hover {
  border-color: var(--cat-primary);
  color: var(--cat-primary);
  transform: translateY(-2px);
}

/* === 6. ФИЛЬТРЫ И ПОИСК === */
.catalog__title {
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  margin-top: var(--cat-space-xl);
  margin-bottom: var(--cat-space-xl);
}
.catalog-filters {
  margin-bottom: var(--cat-space-xl);
}
.catalog-filters__row {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Скрываем старую кнопку, которая ломала вид */
#catalogFiltersToggle {
  display: none !important;
}

/* Кастомный селект */
.custom-select {
  position: relative;
  min-width: 180px;
}
.custom-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 16px;
  background: var(--cat-surface);
  border: 1px solid var(--cat-border);
  border-radius: var(--cat-radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--cat-text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}
.custom-select__trigger:hover {
  border-color: var(--cat-primary);
}
.custom-select__arrow {
  color: var(--cat-text-muted);
  transition: transform 0.2s ease;
}
.custom-select.open .custom-select__arrow {
  transform: rotate(180deg);
}

.custom-select__dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--cat-surface);
  border: 1px solid var(--cat-border);
  border-radius: var(--cat-radius-md);
  box-shadow: var(--cat-shadow-md);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.2s ease;
  overflow: hidden;
}
.custom-select.open .custom-select__dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.custom-select__option {
  padding: 10px 16px;
  font-size: 0.9rem;
  color: var(--cat-text-main);
  cursor: pointer;
}
.custom-select__option:hover {
  background: var(--cat-surface-hover);
  color: var(--cat-primary);
}
.custom-select__option[data-selected="true"] {
  font-weight: 600;
  color: var(--cat-primary);
}

/* Поиск */
.catalog-chip--search {
  position: relative;
}
.search-wrapper {
  position: relative;
  width: 100%;
}
.search-wrapper .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cat-text-muted);
}
.catalog-chip__control--search {
  padding: 10px 16px 10px 38px;
  border: 1px solid var(--cat-border);
  border-radius: var(--cat-radius-pill);
  font-size: 0.9rem;
  width: 220px;
  outline: none;
  font-family: inherit;
  background: var(--cat-surface);
  color: var(--cat-text-main);
}
.catalog-chip__control--search:focus {
  border-color: var(--cat-primary);
}

.catalog-filters__reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 0.9rem;
  color: var(--cat-text-muted);
  background: transparent;
  border-radius: var(--cat-radius-pill);
}
.catalog-filters__reset:hover {
  color: var(--cat-text-main);
  background: var(--cat-border);
}

/* === 7. СЕТКА КАТАЛОГА И КАРТОЧКИ === */
.catalog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: var(--cat-space-xl);
}
.catalog__empty {
  text-align: center;
  grid-column: 1 / -1;
  color: var(--cat-text-muted);
  padding: 40px 0;
}

.catalog-card {
  background: var(--cat-surface);
  border-radius: var(--cat-radius-md);
  overflow: hidden;
  border: 1px solid var(--cat-border);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}
.catalog-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--cat-shadow-md);
}
.catalog-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.catalog-card__image-wrap {
  position: relative;
  overflow: hidden;
}
.catalog-card__image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}
.catalog-card__image--placeholder {
  background-color: var(--cat-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cat-text-muted);
  font-size: 0.9rem;
}
.catalog-card__badge {
  position: absolute;
  left: 12px;
  top: 12px;
  background: var(--cat-badge-bg);
  color: #fff;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--cat-radius-pill);
}

.catalog-card__body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.catalog-card__category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cat-text-muted);
  margin-bottom: 6px;
}
.catalog-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
}
.catalog-card__descr {
  font-size: 0.85rem;
  color: var(--cat-text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.catalog-card__price-block {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.catalog-card__price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cat-primary); /* Цвет цены сделан сочным акцентным */
}
.catalog-card__price-old {
  font-size: 0.85rem;
  color: var(--cat-text-muted);
  text-decoration: line-through;
}
.catalog-card__price-alt {
  font-size: 0.8rem;
  color: var(--cat-text-muted);
}
.catalog-card__price-alt span {
  font-weight: 600;
  color: var(--cat-text-main);
}
.catalog-card__more-btn {
  margin-top: 16px;
  padding: 10px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--cat-radius-pill);
  background: var(--cat-bg);
  color: var(--cat-primary); /* Кнопка переведена в акцентный цвет */
  transition: all 0.2s ease;
}
.catalog-card__link:hover .catalog-card__more-btn {
  background: var(--cat-primary);
  color: #fff;
}

/* === 8. ПАГИНАЦИЯ === */
.catalog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 40px 0;
}
.catalog-pagination__numbers {
  display: flex;
  gap: 8px;
}
.catalog-pagination__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-width: 40px;
  padding: 0 16px;
  border-radius: var(--cat-radius-pill);
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--cat-surface);
  border: 1px solid var(--cat-border);
  color: var(--cat-text-main);
  cursor: pointer;
}
.catalog-pagination__btn:hover {
  border-color: var(--cat-primary);
  color: var(--cat-primary);
}
.catalog-pagination__btn.is-active {
  background: var(--cat-primary);
  color: #fff;
  border-color: var(--cat-primary);
}
.catalog-pagination__btn--prev,
.catalog-pagination__btn--next {
  background: transparent;
  border: none;
  padding: 0 10px;
  color: var(--cat-text-muted);
}
.catalog-pagination__btn--prev:hover,
.catalog-pagination__btn--next:hover {
  background: transparent;
  color: var(--cat-text-main);
}

/* === 9. О МАГАЗИНЕ === */
.about-store {
  padding: 60px 20px;
  background: var(--cat-surface);
  border-top: 1px solid var(--cat-border);
}
.about-store__inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}
.about-store__title {
  font-size: 1.3rem;
  margin-bottom: 16px;
}
.about-store__text {
  font-size: 0.95rem;
  color: var(--cat-text-muted);
  margin-bottom: 12px;
}

/* === 10. ПЛАВАЮЩИЕ КОНТАКТЫ === */
.floating-contacts {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
}
.floating-btn {
  width: 56px;
  height: 56px;
  background: var(--cat-primary);
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  box-shadow: var(--cat-shadow-md);
  transition: 0.2s;
}
.floating-btn:hover {
  transform: scale(1.05);
}
.floating-menu {
  position: absolute;
  bottom: 70px;
  right: 0;
  background: var(--cat-surface);
  border: 1px solid var(--cat-border);
  border-radius: var(--cat-radius-md);
  padding: 12px;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: 0.2s;
}
.floating-contacts.active .floating-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.social-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--cat-radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
}
.social-link:hover {
  background: var(--cat-bg);
}
.social-link__icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cat-bg);
  border-radius: 8px;
}
.social-link--contacts {
  margin-top: 8px;
  border-top: 1px solid var(--cat-border);
  padding-top: 12px;
}

/* === 11. ФУТЕР === */
.footer {
  background: var(--cat-footer-bg);
  color: var(--cat-footer-text);
  padding: 60px 20px 40px;
  text-align: center;
}
.footer__hours {
  color: #fff;
  font-size: 1.1rem;
  margin-bottom: 24px;
}
.footer__info p {
  margin-bottom: 6px;
  font-size: 0.85rem;
}
.footer__info a {
  color: var(--cat-primary);
}
.footer__section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--cat-footer-border);
}
.footer__section-title {
  color: #fff;
  font-size: 0.9rem;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.footer__list {
  list-style: none;
  padding: 0;
  font-size: 0.85rem;
}
.footer__list li {
  margin-bottom: 4px;
}
.footer__links {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}
.footer__links a {
  font-size: 0.85rem;
}
.footer__links a:hover {
  color: #fff;
}

/* === 12. МОБИЛЬНАЯ АДАПТАЦИЯ И МОДАЛКА === */
.mobile-filters-bar {
  display: none;
}
.catalog-filters-modal {
  display: none;
}

@media (max-width: 768px) {
  .catalog__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .catalog-card__body {
    padding: 12px;
  }
  .catalog-card__title {
    font-size: 0.9rem;
  }
  .catalog-card__price {
    font-size: 1rem;
  }
  .catalog-card__descr {
    display: none;
  }
  .catalog-filters {
    display: none;
  }

  /* Красивая мобильная панель поиска и фильтров */
  .mobile-filters-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
  }
  .mobile-filters-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 16px;
    border-radius: var(--cat-radius-pill);
    border: 1px solid var(--cat-border);
    background: var(--cat-surface);
    color: var(--cat-text-main);
    font-weight: 500;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    flex-shrink: 0;
  }
  .mobile-search-form {
    flex: 1;
  }
  .mobile-search-input {
    width: 100%;
    height: 44px;
    padding: 0 16px 0 38px;
    border-radius: var(--cat-radius-pill);
    border: 1px solid var(--cat-border);
    background: var(--cat-surface);
    color: var(--cat-text-main);
    font-family: inherit;
    outline: none;
  }

  .catalog-filters-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: flex-end;
    justify-content: center;
  }
  .catalog-filters-modal.is-open {
    display: flex;
  }
  .catalog-filters-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
  }
  .catalog-filters-modal__panel {
    position: relative;
    width: 100%;
    background: var(--cat-surface);
    padding: 20px;
    border-radius: 20px 20px 0 0;
  }
  .catalog-filters-modal__header {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--cat-text-main);
  }
  .catalog-filters-modal__close {
    background: none;
    border: none;
    color: var(--cat-text-main);
    font-size: 1.2rem;
  }
  .catalog-filters-modal__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  .catalog-filters__submit {
    background: var(--cat-primary);
    color: #fff;
    padding: 12px;
    border: none;
    border-radius: var(--cat-radius-pill);
    font-weight: 500;
    margin-top: 10px;
  }
}
