/* Исправление для десктопной версии: дублирование фото и наложение текста на хедер */

/* === 1. ИСПРАВЛЕНИЕ ДУБЛИРОВАНИЯ ФОТО === */
/* На десктопе (от 1024px) скрываем мобильное фото */
@media (min-width: 1024px) {
  /* Скрываем мобильную версию фото на десктопе - более точный селектор */
  #root section:first-of-type div.lg\:hidden,
  #root section:first-of-type div[class*="lg:hidden"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    pointer-events: none !important;
  }
  
  /* Показываем десктопную версию фото */
  #root section:first-of-type div.hidden.lg\:block,
  #root section:first-of-type div[class*="hidden"][class*="lg:block"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

/* === 2. ИСПРАВЛЕНИЕ НАЛОЖЕНИЯ ТЕКСТА НА ХЕДЕР === */
/* Увеличиваем padding-top для первой секции (hero) */
#root section:first-of-type {
  padding-top: 5rem !important; /* Увеличено с 4rem до 5rem */
}

/* На больших экранах еще больше отступ */
@media (min-width: 768px) {
  #root section:first-of-type {
    padding-top: 5.5rem !important;
  }
}

@media (min-width: 1024px) {
  #root section:first-of-type {
    padding-top: 6rem !important;
  }
}

/* Контент внутри hero секции - дополнительный отступ сверху */
#root section:first-of-type .relative.z-10.max-w-7xl {
  padding-top: 1rem !important;
}

/* === 3. ФИКСАЦИЯ ВЫСОТЫ ХЕДЕРА === */
/* Убедимся, что хедер имеет правильную высоту */
nav.fixed.top-0 {
  min-height: 4rem;
}

/* === 3b. ФОН ПОД ХЕДЕРОМ ПРИ СКРОЛЛЕ === */
/* При прокрутке — полупрозрачный размытый фон, чтобы логотип и пункты не наслаивались на контент */
body.nav-scrolled nav.fixed.top-0 {
  background: rgba(0, 0, 0, 0.75) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@media (min-width: 768px) {
  nav.fixed.top-0 {
    min-height: 4.5rem;
  }
}

/* === 4. ДОПОЛНИТЕЛЬНАЯ ЗАЩИТА ОТ ДУБЛИРОВАНИЯ === */
/* Альтернативный способ скрыть мобильное фото на десктопе */
@media (min-width: 1024px) {
  /* Все элементы внутри hero секции с классом, содержащим "lg:hidden" */
  #root section:first-of-type div[class*="lg:hidden"] {
    display: none !important;
  }
  
  /* Гарантируем, что только одно фото отображается */
  #root section:first-of-type img[alt*="хоккеист"][alt*="альбомом"] {
    /* Оставляем только то, что внутри .hidden.lg:block */
  }
  
  /* Скрываем все img внутри lg:hidden блоков */
  #root section:first-of-type .lg\:hidden img {
    display: none !important;
  }
}

/* === 5. OVERFLOW FIX === */
/* Убедимся, что первая секция не обрезает контент */
#root section:first-of-type {
  overflow: visible !important;
}

/* === 5b. ВИДЕО: заглушка (постер) видна сразу === */
#video .rounded-3xl > div.absolute.inset-0 {
  background-image: url(../images/photo-6.jpg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
#video .rounded-3xl video#magazine-video {
  background: transparent;
}

/* === 6. ВЫРАВНИВАНИЕ ТЕКСТА ПО ЛЕВОМУ КРАЮ НА ДЕСКТОПЕ === */
@media (min-width: 1024px) {
  /* Убираем центрирование hero секции на десктопе */
  #root section:first-of-type {
    justify-content: flex-start !important;
  }
  
  /* Контейнер с контентом - выравниваем по левому краю */
  #root section:first-of-type .relative.z-10.max-w-7xl {
    justify-content: flex-start !important;
  }
  
  /* Flex контейнер с текстом и фото - выравнивание по левому краю */
  #root section:first-of-type .flex.flex-col.lg\:flex-row {
    justify-content: flex-start !important;
    align-items: flex-start !important;
  }
  
  /* Текстовый блок слева - relative для позиционирования стикера */
  #root section:first-of-type .flex-1.min-w-0 {
    text-align: left !important;
    align-items: flex-start !important;
    position: relative !important;
  }
  
  /* Все элементы внутри текстового блока - по левому краю */
  #root section:first-of-type .flex-1.min-w-0 > * {
    margin-left: 0 !important;
    margin-right: auto !important;
  }
  
  /* Стикер "Идеальный подарок на 23 февраля" - такой же круглый, как на мобильной */
  #root section:first-of-type .inline-flex.animate-pulse {
    position: absolute !important;
    top: 1.5rem !important;
    right: -10px !important;
    width: 120px !important;
    height: 120px !important;
    font-size: 0.825rem !important;
    padding: 0.5rem !important;
    background: #E31837 !important;
    border-radius: 50% !important;
    box-shadow: 0 3px 10px rgba(227, 24, 55, 0.5) !important;
    font-weight: 700 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    line-height: 1.2 !important;
    z-index: 20 !important;
    gap: 0.2rem !important;
    animation: none !important;
    transform: rotate(12deg) !important;
    border: none !important;
    margin-bottom: 0 !important;
  }
  
  #root section:first-of-type .inline-flex.animate-pulse span {
    font-size: 0.825rem !important;
    line-height: 1.15 !important;
  }
  
  #root section:first-of-type .inline-flex.animate-pulse .ri-gift-line {
    font-size: 2.25rem !important;
    margin: 0 !important;
  }
}

/* === 7. ИСПРАВЛЕНИЕ ВЫРАВНИВАНИЯ КНОПОК === */
/* Кнопки "Узнать больше" и "Смотреть видео" */
#root section:first-of-type .flex.gap-4 a,
#root section:first-of-type div.flex.gap-4 > a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  line-height: 1 !important;
}

/* Иконки внутри кнопок - выравнивание по центру */
#root section:first-of-type .flex.gap-4 a [class*="ri-"],
#root section:first-of-type div.flex.gap-4 > a [class*="ri-"] {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  line-height: 1 !important;
  margin: 0 !important;
}

/* Иконка play в кнопке "Смотреть видео" */
#root section:first-of-type a[href="#video"] .ri-play-circle-line {
  font-size: 1.25rem !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  margin-right: 0.5rem !important;
}

/* Текст внутри кнопок */
#root section:first-of-type .flex.gap-4 a {
  font-size: inherit !important;
  line-height: 1.2 !important;
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
}

/* Убираем лишние отступы у иконок в кнопках */
#root section:first-of-type .flex.gap-4 [class*="ri-"]::before {
  margin: 0 !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

/* === 8. УМЕНЬШЕНИЕ РАЗМЕРА КАРТОЧЕК === */
/* Секция с примерами карточек - ограничиваем размер для избежания пикселизации */

/* На десктопе уменьшаем карточки - только для экранов от 768px */
@media (min-width: 768px) and (max-width: 1023px) {
  #cards #cards-grid > div {
    max-width: 280px;
  }
}

/* На больших десктопах */
@media (min-width: 1024px) {
  #cards #cards-grid > div {
    max-width: 320px;
  }
  
  /* Центральная карточка чуть больше */
  #cards #cards-grid > div:nth-child(2) {
    max-width: 350px;
  }
}

/* === 9. УЛУЧШЕНИЯ МОБИЛЬНОЙ ВЕРСИИ === */
@media (max-width: 767px) {
  /* 0. Hero секция - убираем центрирование, контент сверху вниз */
  #root section:first-of-type {
    padding-top: 3rem !important;
    padding-bottom: 0 !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    min-height: auto !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
  }
  
  /* Контент внутри hero - под хедером */
  #root section:first-of-type .relative.z-10.max-w-7xl {
    padding-top: 3rem !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }
  
  /* Хедер на мобильной - компактный */
  nav.fixed.top-0 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }
  
  /* -- Видео секция на мобильной -- */
  /* Видео контейнер - полная ширина */
  #video .rounded-3xl {
    width: 100% !important;
    border-radius: 0.75rem !important;
  }
  
  /* Видео элемент - заполняет контейнер */
  #magazine-video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
  }
  
  /* Кнопка play - скрывается при нажатии (через JS onclick уже есть display:none) */
  #video-play-overlay {
    z-index: 10 !important;
  }
  
  /* 1. Мобильное меню — полупрозрачное, пункты ближе к логотипу */
  #nav-menu {
    position: fixed !important;
    top: 4.5rem !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9999 !important;
    background: rgba(0, 0, 0, 0.75) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding-top: 1.5rem !important;
    gap: 1.25rem !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease !important;
  }
  
  #nav-menu.nav-menu-open {
    opacity: 1 !important;
    pointer-events: auto !important;
  }
  
  /* Ссылки в меню */
  #nav-menu .nav-menu-link {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: white !important;
    text-decoration: none !important;
    padding: 0.5rem 1rem !important;
    transition: color 0.2s ease, background-color 0.2s ease !important;
  }
  
  #nav-menu .nav-menu-link:hover,
  #nav-menu .nav-menu-link:active {
    color: #E31837 !important;
  }
  
  /* Пункт «Заказать» в меню — красная кнопка как на десктопе */
  #nav-menu .nav-menu-link[href="#contact"] {
    background: #E31837 !important;
    color: white !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 9999px !important;
    margin-top: 0.5rem !important;
  }
  #nav-menu .nav-menu-link[href="#contact"]:hover,
  #nav-menu .nav-menu-link[href="#contact"]:active {
    background: #C41230 !important;
    color: white !important;
  }
  
  /* Кнопка закрытия в шапке — на месте бургера (в HTML рядом с бургером), показывается при открытом меню */
  #nav-close {
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
  }
  body.nav-menu-open #nav-close {
    display: flex !important;
  }
  body.nav-menu-open #nav-burger {
    display: none !important;
  }
  
  /* 1a. Кнопка «Заказать альбом» в шапке на мобильной — всегда скрыта (id перебивает md:flex) */
  #nav-order-btn {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
  }
  
  /* 1b. Выравнивание кнопки-бургера */
  #nav-burger {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  #nav-burger span {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  /* 2. Блок "Идеальный подарок" - круглый стикер справа от заголовка */
  #root section:first-of-type .flex-1.min-w-0 {
    position: relative !important;
  }
  
  #root section:first-of-type .inline-flex.animate-pulse {
    position: absolute !important;
    top: 9rem !important;
    right: -10px !important;
    width: 75px !important;
    height: 75px !important;
    font-size: 0.45rem !important;
    padding: 0.5rem !important;
    background: #E31837 !important;
    /* border: 2px solid #FFB800 !important; */
    border-radius: 50% !important;
    box-shadow: 0 3px 10px rgba(227, 24, 55, 0.5) !important;
    font-weight: 700 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    line-height: 1.2 !important;
    z-index: 20 !important;
    gap: 0.15rem !important;
    animation: none !important;
    transform: rotate(12deg) !important;
  }
  
  #root section:first-of-type .inline-flex.animate-pulse span {
    font-size: 0.45rem !important;
    line-height: 1.15 !important;
  }
  
  /* Иконка подарка в стикере */
  #root section:first-of-type .inline-flex.animate-pulse .ri-gift-line {
    font-size: 1rem !important;
    margin: 0 !important;
  }
  
  /* 3. Заголовок - уменьшенный шрифт, меньше межстрочное, меньше отступ сверху */
  #root section:first-of-type h1 {
    font-size: 2.2rem !important;
    line-height: 1.2 !important;
    letter-spacing: 0.01em !important;
    margin-top: 0.5rem !important;
    margin-bottom: 1rem !important;
  }
  
  /* Красная кнопка "ОТ СОЗДАТЕЛЕЙ..." - уменьшаем отступ снизу */
  #root section:first-of-type .inline-block.border.border-\[\#E31837\] {
    margin-bottom: 0.5rem !important;
  }
  
  /* 4. Кнопки - меньше, чтобы влезали в одну строку */
  #root section:first-of-type .flex.gap-4 {
    gap: 0.5rem !important;
    flex-wrap: nowrap !important;
  }
  
  #root section:first-of-type .flex.gap-4 a {
    padding: 0.6rem 1rem !important;
    font-size: 0.8rem !important;
    white-space: nowrap !important;
  }
  
  /* Иконка в кнопке "Смотреть видео" */
  #root section:first-of-type a[href="#video"] .ri-play-circle-line {
    font-size: 1rem !important;
    margin-right: 0.25rem !important;
  }
  
  /* 5. Фото хоккеистов - прижато к правой границе, ближе к кнопкам */
  #root section:first-of-type .lg\:hidden.w-full {
    position: relative !important;
    padding: 0 !important;
    margin: 0px -35px 0px 0 !important;
    margin-top: -1rem !important;
    z-index: 5;
    display: flex !important;
    justify-content: flex-end !important;
  }
  
  #root section:first-of-type .lg\:hidden img {
    width: auto !important;
    /* margin-top: -50px!important; */
    max-width: 109% !important;
    max-height: none !important;
    object-position: right bottom !important;
    display: block !important;
    margin: -50px 0 0 0 !important;
    padding: 0 !important;
  }
  
  /* Контент - без лишних отступов снизу */
  #root section:first-of-type .relative.z-10 {
    position: relative !important;
    z-index: 10 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }
}

/* === Сообщение об отправке формы: тост без прокрутки === */
.form-sent-toast {
  position: fixed !important;
  left: 50% !important;
  top: 2rem !important;
  transform: translateX(-50%) translateY(-120%) !important;
  z-index: 99999 !important;
  padding: 1rem 1.5rem !important;
  border-radius: 0.75rem !important;
  font-weight: 600 !important;
  text-align: center !important;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4) !important;
  transition: transform 0.35s ease, opacity 0.35s ease !important;
  opacity: 0 !important;
  pointer-events: none !important;
  max-width: 90vw !important;
}
.form-sent-toast.form-sent-toast-visible {
  transform: translateX(-50%) translateY(0) !important;
  opacity: 1 !important;
}
.form-sent-toast-ok {
  background: #14532d !important;
  color: #bbf7d0 !important;
  border: 1px solid #22c55e !important;
}
.form-sent-toast-err {
  background: #7f1d1d !important;
  color: #fecaca !important;
  border: 1px solid #dc2626 !important;
}
