/* MFORN v6 — дополнительные стили */

/* ── Избранное: звёздочка на карточке ───────────────────────────────────── */
.fav-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: #ccc;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.fav-btn:hover {
  transform: scale(1.1);
  color: #f0b400;
}
.fav-btn.is-active {
  color: #f0b400;
  background: rgba(255, 255, 255, 0.98);
}
.product-img { position: relative; }

/* Счётчик избранного в шапке — рядом со словом «Избранное», стиль как у корзины */
.fav-count {
  display: inline-block;
  margin-left: 0.3rem;
  background: #0a0a0a;
  color: #fff;
  font-size: 0.6rem;
  padding: 0 5px;
  border-radius: 8px;
  min-width: 14px;
  height: 14px;
  line-height: 14px;
  text-align: center;
  font-weight: 700;
  vertical-align: middle;
}

/* ── Плавные переходы между страницами ───────────────────────────────────── */
/* НЕ начинаем с opacity:0 — иначе если catalog.js не успеет добавить класс
   page-loaded, страница окажется пустой. Просто fade-out при клике. */
body {
  transition: opacity 0.2s ease;
}
body.page-leaving { opacity: 0; }

/* ── Промокод-блок в чекауте ─────────────────────────────────────────────── */
#f-promo {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: 'Inter', sans-serif;
}
.form-hint {
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.4rem;
}

/* ── Мобильный адаптив — точечные фиксы ─────────────────────────────────── */
@media (max-width: 768px) {
  /* Меню в шапке — компактнее */
  .site-header { padding: 0.8rem 1rem; }
  .nav-links { gap: 0.8rem; font-size: 0.75rem; }
  .nav-links li { white-space: nowrap; }

  /* Брeнд по центру */
  .brand { font-size: 1.4rem !important; }
  .brand sup { font-size: 0.5rem !important; }

  /* Контейнеры */
  .container { padding-left: 1rem; padding-right: 1rem; }

  /* Заголовки */
  .h-section { font-size: clamp(1.6rem, 7vw, 2.4rem) !important; line-height: 1.05; }

  /* Сетка товаров — 2 в ряд */
  .product-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 0.8rem; }

  /* Карточка — короче, без второго фото */
  .product-img { aspect-ratio: 3/4; }
  .product h4 { font-size: 0.85rem; }
  .product .product-code { font-size: 0.65rem; }
  .product .price { font-size: 0.9rem; }

  /* Звёздочка — меньше */
  .fav-btn { width: 30px; height: 30px; font-size: 16px; top: 8px; right: 8px; }

  /* Footer — в один столбец */
  .footer-inner { grid-template-columns: 1fr !important; gap: 2rem; }
  .footer-bottom { flex-direction: column; gap: 0.6rem; text-align: center; }

  /* Чекаут */
  .checkout-grid { grid-template-columns: 1fr !important; gap: 1.5rem; }
  .form-grid { grid-template-columns: 1fr !important; }
  .form-field.full { grid-column: 1; }
}

/* ── Кнопка корзины — указатель ──────────────────────────────────────────── */
.nav-actions button { cursor: pointer; }

/* ── v6.1: Выпадающее меню «Каталог» ─────────────────────────────────────── */
.nav-links { position: relative; }
.has-submenu { position: relative; }
.has-submenu > a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}
.caret {
  display: inline-block;
  font-size: 0.6em;
  opacity: 0.6;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.has-submenu:hover .caret,
.has-submenu.is-open .caret { transform: translateY(2px); opacity: 1; }

.submenu {
  position: absolute;
  /* top: 100% — без зазора, ниже на padding-top компенсируем визуально */
  top: 100%;
  left: -1rem;
  min-width: 540px;
  background: #fff;
  border: 1px solid #e5e3de;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  /* верхний padding выполняет роль «моста» — курсор не теряется */
  padding: 1.8rem 1.6rem 1.4rem;
  display: none;
  z-index: 100;
  font-family: 'Inter', sans-serif;
  border-radius: 2px;
}
/* Удерживаем выпадашку открытой пока курсор над ней */
.has-submenu:hover .submenu,
.has-submenu.is-open .submenu,
.submenu:hover { display: grid; }
.submenu {
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem 2rem;
}
.submenu-link--all {
  grid-column: 1 / -1;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: #0a0a0a;
  text-decoration: none;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #e5e3de;
  margin-bottom: 0.4rem;
}
.submenu-link--all:hover { color: #888; }

.submenu-group {
  display: flex;
  flex-direction: column;
}
.submenu-title {
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #888;
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.submenu-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.submenu-group li a {
  font-size: 0.82rem;
  color: #0a0a0a;
  text-decoration: none;
  padding: 0.25rem 0;
  display: block;
  transition: color 0.15s ease, padding-left 0.15s ease;
}
.submenu-group li a:hover { color: #c69e5a; padding-left: 4px; }
.submenu-all {
  margin-top: 0.4rem !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: #c69e5a !important;
  text-transform: uppercase;
}

/* Мобильный — выпадашка над всем */
@media (max-width: 768px) {
  .submenu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    width: 100%;
    min-width: 0;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    grid-template-columns: 1fr;
    border-left: none;
    border-right: none;
    border-radius: 0;
  }
}

/* ── v6.1: Новый HERO (без видео-букв, надёжнее) ─────────────────────────── */
.hero-v4 {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(180deg, #f7f6f3 0%, #efeeea 60%, #e8e6df 100%);
  overflow: hidden;
  padding: 6rem 2rem 4rem;
  color: #f7f6f3;
}
/* Затемняющий градиент-оверлей поверх фона — улучшает читаемость текста */
.hero-v4::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.25) 35%, rgba(0,0,0,0.55) 100%),
    radial-gradient(ellipse at center, rgba(0,0,0,0.25) 0%, rgba(0,0,0,0) 70%);
  pointer-events: none;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.8s ease;
}
.hero-bg.is-loaded { opacity: 1; }
.hero-bg[data-has-image="true"] { opacity: 1; }

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 720px;
  padding: 0 1rem;
}
.hero-content .eyebrow {
  color: rgba(247, 246, 243, 0.75);
  font-size: 0.7rem;
  letter-spacing: 0.32em;
}
.hero-title {
  font-family: var(--font-display, 'Manrope');
  font-weight: 800;
  font-size: clamp(2rem, 5.5vw, 4.4rem);
  letter-spacing: -0.015em;
  line-height: 1;
  color: #f7f6f3;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.4);
  margin: 1.4rem 0 1.8rem;
}
.hero-sub {
  font-family: 'Inter', sans-serif;
  font-size: clamp(0.9rem, 1.3vw, 1.05rem);
  line-height: 1.55;
  color: rgba(247, 246, 243, 0.88);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
  margin-bottom: 2.6rem;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}
.hero-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-actions .btn-primary {
  background: #f7f6f3;
  color: #0a0a0a;
  border: 1px solid #f7f6f3;
  padding: 1rem 2rem;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
}
.hero-actions .btn-primary:hover {
  background: transparent;
  color: #f7f6f3;
}
.btn-ghost {
  display: inline-block;
  padding: 1rem 2rem;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  border: 1px solid rgba(247, 246, 243, 0.6);
  color: #f7f6f3;
  background: transparent;
  text-decoration: none;
  transition: all 0.2s ease;
  backdrop-filter: blur(2px);
}
.btn-ghost:hover {
  background: #f7f6f3;
  color: #0a0a0a;
  border-color: #f7f6f3;
}
.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  font-size: 0.6rem;
  letter-spacing: 0.35em;
  color: rgba(247, 246, 243, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}
.hero-scroll-line {
  width: 1px;
  height: 30px;
  background: rgba(247, 246, 243, 0.5);
  animation: scrollLine 2s ease-in-out infinite;
}
@keyframes scrollLine {
  0%, 100% { transform: scaleY(0.3); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
}

@media (max-width: 768px) {
  .hero-v4 { min-height: 78vh; padding: 5rem 1rem 3rem; }
  .hero-title { font-size: clamp(1.8rem, 9vw, 2.6rem); }
  .hero-scroll { font-size: 0.55rem; }
}

/* ── v6.1: Баннер новой коллекции ────────────────────────────────────────── */
.banner-new {
  padding: 5rem 0;
  background: #0a0a0a;
  color: #f4f1ea;
  overflow: hidden;
}
.banner-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}
.banner-text .num {
  font-family: var(--font-display, 'Manrope');
  font-size: 4rem;
  font-weight: 900;
  color: rgba(244, 241, 234, 0.15);
  line-height: 1;
  margin-bottom: 1rem;
}
.banner-text .eyebrow { color: rgba(244, 241, 234, 0.6); margin-bottom: 1rem; }
.banner-text h2 {
  color: #f4f1ea;
  margin: 0 0 1.6rem;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
}
.banner-desc {
  font-family: 'Inter', sans-serif;
  color: rgba(244, 241, 234, 0.75);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  max-width: 480px;
}
.banner-text .btn-primary {
  background: #c69e5a;
  color: #0a0a0a;
  border-color: #c69e5a;
}
.banner-text .btn-primary:hover { background: #b88a3f; border-color: #b88a3f; }
.banner-visual {
  min-height: 360px;
  background: linear-gradient(135deg, #1c1c1c 0%, #2a2a2a 100%);
  position: relative;
  overflow: hidden;
  border-radius: 2px;
}
.banner-bg-decor {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(198, 158, 90, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(198, 158, 90, 0.1) 0%, transparent 50%);
}
.banner-visual::after {
  content: 'MFORN 2026';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display, 'Manrope');
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  color: rgba(244, 241, 234, 0.05);
}
@media (max-width: 768px) {
  .banner-inner { grid-template-columns: 1fr; gap: 2rem; }
  .banner-visual { min-height: 240px; }
}

/* Если зальёшь /assets/hero.jpg или /assets/banner.jpg — встанут автоматически */
.banner-visual[data-has-image="true"] {
  background-size: cover;
  background-position: center;
}

/* ── v6.1.1: <video> в hero ──────────────────────────────────────────────── */
.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0.55;
  filter: brightness(0.92);
}
/* Когда видео есть — статичный фон не показываем (он показывается ниже видео) */
.hero-v4:has(video[style*="display: block"]) .hero-bg { display: none; }

/* ── v6.1.2: Большой логотип в футере ──────────────────────────────────── */
.footer-logo {
  font-family: var(--font-display, 'Manrope');
  font-weight: 900;
  font-size: clamp(3.5rem, 9vw, 7rem);
  letter-spacing: 0.18em;
  line-height: 1;
  color: #f4f1ea;
  margin: 0 0 0.4rem;
  display: block;
  user-select: none;
}
.footer-logo-sup {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.45em;
  color: rgba(244, 241, 234, 0.45);
  font-weight: 600;
  margin-bottom: 1.4rem;
}
.footer-brand-block {
  grid-column: 1 / -1;
  border-bottom: 1px solid rgba(244, 241, 234, 0.1);
  padding-bottom: 2.6rem;
  margin-bottom: 0.5rem;
}
@media (max-width: 768px) {
  .footer-logo { font-size: clamp(2.6rem, 13vw, 4rem); letter-spacing: 0.12em; }
}
