/* Дополнительные стили темы: фича «Подборка товаров» + стили, вынесенные из инлайнов шаблонов */

/* ==================== Подборка товаров ==================== */

.fav-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0;
  transition: color 0.2s, border-color 0.2s, transform 0.2s, opacity 0.2s;
}

/* Звезда появляется по наведению на карточку, отмеченная видна всегда */
.product-card:hover .fav-toggle,
.fav-toggle.is-active {
  opacity: 1;
}

@media (hover: none) {
  .fav-toggle {
    opacity: 1;
  }
}

.fav-toggle:hover {
  color: var(--accent-red);
  border-color: var(--accent-red);
  transform: scale(1.08);
}

.fav-toggle.is-active {
  color: var(--accent-red);
  border-color: var(--accent-red);
}

.fav-add-product {
  display: inline-flex;
  align-self: flex-start;
  width: max-content;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 16px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 15px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.fav-add-product:hover,
.fav-add-product.is-active {
  color: var(--accent-red);
  border-color: var(--accent-red);
}

/* Плавающая кнопка подборки: плашка с подписью, по одной оси с desktop-cta */
.fav-bar {
  position: fixed;
  right: 30px;
  bottom: 100px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 16px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 26px;
  color: var(--accent-red);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(49, 49, 49, 0.2);
  transition: transform 0.2s;
}

.fav-bar:hover {
  transform: scale(1.04);
}

.fav-bar--empty {
  display: none;
}

.fav-bar__label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.fav-bar__count {
  min-width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  background: var(--accent-red);
  border-radius: 11px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.fav-bar--pulse .fav-bar__count {
  animation: fav-pop 0.35s ease;
}

@keyframes fav-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* Тост «Добавлено в подборку» */
.fav-toast {
  position: fixed;
  right: 30px;
  bottom: 165px;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--text-headings);
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.25);
  font-size: 14px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.fav-toast.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.fav-toast__open {
  background: none;
  border: none;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

/* Панель подборки живёт на нативной базе .popup, чтобы выглядеть как родные попапы сайта */
.popup.fav-panel {
  position: relative;
  width: 620px;
  max-width: 92%;
  padding: 50px 40px 40px;
  text-align: left;
}

.fav-panel__close {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 34px;
  height: 34px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}

.fav-panel__close:hover {
  color: var(--accent-red);
}

/* Внутри Fancybox есть собственный крестик, свой прячем */
.fancybox__content .fav-panel__close {
  display: none;
}

.fav-panel__empty {
  margin-bottom: 0;
}

.fav-panel__list {
  margin: 0 0 25px;
  padding: 0;
  list-style: none;
  max-height: 45vh;
  overflow-y: auto;
}

.fav-panel__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.fav-panel__thumb {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: #fff;
}

.fav-panel__link {
  flex: 1 1 auto;
  color: var(--text-primary);
  text-decoration: none;
}

.fav-panel__link:hover {
  color: var(--accent-red);
}

.fav-panel__article {
  flex: 0 0 auto;
  color: var(--text-secondary);
  font-size: 14px;
  white-space: nowrap;
}

.fav-panel__remove {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.fav-panel__remove:hover {
  color: var(--accent-red);
}

.fav-panel__actions {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.fav-panel__clear {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
}

.fav-panel__clear:hover {
  color: var(--accent-red);
}

/* Фолбэк на случай отсутствия Fancybox */
.fav-panel--static {
  display: block;
  position: fixed;
  inset: 0;
  margin: auto;
  z-index: 1200;
  height: max-content;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

/* ==================== Попапы (общее) ==================== */

.popup__actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ==================== Подвал ==================== */

.footer__tel {
  display: inline-block;
}

.footer__tel-label {
  display: block;
  font-size: 14px;
  opacity: 0.7;
  margin-top: 4px;
  font-weight: normal;
  line-height: 1.2;
  text-align: right;
}

.footer__contact-email {
  margin-top: 15px;
}

.footer__messengers {
  display: flex;
  gap: 15px;
  margin-top: 15px;
  justify-content: flex-end;
}

.footer__messenger-link {
  width: 24px;
  height: 24px;
  display: inline-block;
  transition: transform 0.3s;
}

.footer__messenger-link:hover {
  transform: scale(1.1);
}

.footer__messenger-link img {
  width: 100%;
  height: 100%;
}

.footer__legal {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 15px;
}

.footer__legal-links {
  text-align: right;
}

.footer__legal-links a {
  color: inherit;
  text-decoration: underline;
  opacity: 0.85;
  transition: opacity 0.3s;
}

.footer__legal-links a:hover {
  opacity: 1;
}

.footer__cookie {
  margin-top: 25px;
  margin-bottom: 15px;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
}

.footer__offer {
  font-size: 11px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  padding-bottom: 10px;
}

/* ==================== Шапка / мобильное меню ==================== */

.mobile-menu__phone-label {
  font-size: 14px;
  opacity: 0.7;
}

/* ==================== Главная ==================== */

.home-section-subtitle {
  font-size: 1.125rem;
  color: #666;
  margin-top: -15px;
  margin-bottom: 40px;
  line-height: 1.4;
}

.home-section-subtitle.center {
  text-align: center;
}

.productions__catalog-link-wrapper {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

.productions-popup__link--outline {
  background: transparent;
  color: var(--color-red);
  border: 1px solid var(--color-red);
}

/* ==================== Мобильные ==================== */

@media (max-width: 768px) {
  .fav-bar {
    right: 15px;
    bottom: 85px;
    width: 46px;
    height: 46px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .fav-bar__label {
    display: none;
  }
  .fav-bar__count {
    position: absolute;
    top: -6px;
    right: -6px;
  }
  .fav-toast {
    right: 15px;
    bottom: 145px;
    max-width: calc(100% - 30px);
  }
  .popup.fav-panel {
    padding: 40px 20px 30px;
  }
  .home-section-subtitle {
    font-size: 1rem;
    margin-top: -10px;
    margin-bottom: 30px;
  }
}