/**
 * MOBILE HOME PAGE - Главная страница для мобильных
 * Netflix/Disney+ стиль с горизонтальными каруселями
 */

@keyframes mobileInstallArrowPulse {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(4px, -4px) scale(1.06); }
}

@keyframes mobileInstallButtonGlow {
  0%, 100% {
    transform: translateY(0);
    box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.24), 0 12px 26px rgba(0, 212, 255, 0.24);
  }
  50% {
    transform: translateY(-1px);
    box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.34), 0 16px 30px rgba(0, 212, 255, 0.34);
  }
}

/* ============================================
   HERO SECTION - Главный баннер
   ============================================ */
@media (max-width: 767px) {
  .mobile-install-nudge-section {
    padding: 6px 0 2px !important;
    position: relative;
    z-index: 4;
  }

  .mobile-install-nudge-section .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .mobile-install-nudge {
    position: relative;
    overflow: hidden;
    padding: 13px 14px 12px;
    border-radius: 18px;
    background:
      radial-gradient(circle at top right, rgba(0, 212, 255, 0.22), transparent 38%),
      linear-gradient(145deg, rgba(14, 19, 31, 0.96), rgba(10, 14, 24, 0.96));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  }

  .mobile-install-nudge::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255,255,255,0.08), transparent 34%, transparent 70%, rgba(0,212,255,0.12));
    pointer-events: none;
  }

  .mobile-install-nudge__close {
    position: absolute;
    top: 9px;
    right: 9px;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.72);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
  }

  .mobile-install-nudge__eyebrow {
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-primary, #00d4ff);
  }

  .mobile-install-nudge__title {
    margin: 0 24px 4px 0;
    font-size: 16px;
    line-height: 1.12;
    font-weight: 800;
    color: #fff;
  }

  .mobile-install-nudge__text {
    margin: 0 0 10px;
    font-size: 12px;
    line-height: 1.42;
    color: rgba(255,255,255,0.78);
  }

  .mobile-install-nudge__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
  }

  .mobile-install-nudge__button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--color-primary, #00d4ff), #7cf2ff);
    color: #071018;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(0, 212, 255, 0.3);
  }

  .mobile-install-nudge__hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    line-height: 1.35;
    color: rgba(255,255,255,0.68);
  }

  .mobile-install-nudge__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: var(--color-primary, #00d4ff);
    font-size: 13px;
    animation: mobileInstallArrowPulse 1.6s ease-in-out infinite;
  }

  .mobile-app-btn--download.mobile-app-btn--nudge {
    animation: mobileInstallButtonGlow 1.8s ease-in-out infinite;
    box-shadow: 0 0 0 1px rgba(0,212,255,0.24), 0 12px 26px rgba(0,212,255,0.24);
  }

  html[data-theme="light_japan"] .mobile-install-nudge {
    background:
      radial-gradient(circle at top right, rgba(14, 165, 233, 0.16), transparent 36%),
      linear-gradient(145deg, rgba(255,255,255,0.98), rgba(245,247,250,0.98));
    border-color: rgba(15, 23, 42, 0.08);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
  }

  html[data-theme="light_japan"] .mobile-install-nudge__close {
    background: rgba(15,23,42,0.06);
    color: rgba(15,23,42,0.58);
  }

  html[data-theme="light_japan"] .mobile-install-nudge__title {
    color: #0f172a;
  }

  html[data-theme="light_japan"] .mobile-install-nudge__text,
  html[data-theme="light_japan"] .mobile-install-nudge__hint {
    color: rgba(15,23,42,0.7);
  }

  html[data-theme="light_japan"] .mobile-install-nudge__arrow {
    background: rgba(14,165,233,0.1);
    color: #0ea5e9;
  }

  /* Убираем большие отступы секций */
  .sec-mar {
    margin-top: 0 !important;
    padding-top: 16px !important;
    padding-bottom: 16px !important;
  }
  
  /* Hero Section - вертикальный формат */
  .banner.banner-slider {
    margin-top: 0 !important;
    padding-top: 0 !important;
    min-height: 62vh;
    position: relative;
  }
  
  .banner-block.style-1 {
    min-height: 62vh;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
  }
  
  /* Фоновое изображение на весь экран */
  .banner-block .hero-bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
  }
  
  /* Затемнение снизу для читаемости */
  .banner-block::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
      linear-gradient(to bottom,
        rgba(0,0,0,0.48) 0%,
        rgba(0,0,0,0.16) 22%,
        rgba(0,0,0,0.08) 42%,
        rgba(0,0,0,0.44) 72%,
        rgba(0,0,0,0.88) 100%
      );
    z-index: 1;
    pointer-events: none;
  }
  
  /* Контент Hero - внизу */
  .banner-block .hero-content-wrapper {
    position: relative;
    z-index: 2;
    padding: 18px 16px 24px;
  }
  
  .banner-block .banner-content {
    padding: 0;
  }
  
  .banner-block .banner-content .row {
    margin: 0;
  }
  
  .banner-block .banner-content .col-lg-6 {
    padding: 0;
    min-height: auto !important;
    padding-bottom: 0 !important;
  }
  
  /* Заголовок */
  .banner-block .slider-title {
    font-size: 26px !important;
    line-height: 1.1 !important;
    margin-bottom: 10px !important;
    text-shadow: 0 2px 8px rgba(0,0,0,0.45);
  }
  
  /* Теги статуса и озвучки */
  .banner-block .hero-status-year {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    align-items: center;
  }
  
  /* Кнопка статуса - КОМПАКТНАЯ */
  .banner-block .btn-toggle--status {
    font-size: 9px !important;
    padding: 5px 8px !important;
    border-radius: 999px;
    border-width: 1px !important;
    backdrop-filter: blur(10px);
  }
  
  /* Озвучки на слайдере - СКРЫТЬ на мобильных */
  .banner-block .badge-tag,
  .banner-block .hero-status-year .badge-tag {
    display: none !important;
  }
  
  .banner-block .hero-year {
    font-size: 10px !important;
    padding: 5px 9px !important;
    opacity: 0.95;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    backdrop-filter: blur(10px);
  }
  
  /* Описание - сокращённое */
  .banner-block .hero-description {
    font-size: 13px !important;
    line-height: 1.45 !important;
    margin-bottom: 14px !important;
    opacity: 0.9;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  /* Кнопка "Смотреть" */
  .banner-block .play-butn {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 22px !important;
    font-size: 13px !important;
    font-weight: 800;
    letter-spacing: 0.02em;
    border-radius: 14px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--color-primary, #00d4ff) 88%, #fff 12%), color-mix(in srgb, var(--color-primary, #00d4ff) 76%, #000 24%));
    color: #071018;
    box-shadow: 0 12px 26px color-mix(in srgb, var(--color-primary, #00d4ff) 26%, transparent);
  }
  
  .banner-block .play-butn::before {
    content: '▶';
    font-size: 11px;
  }

  html[data-theme="light_japan"] .banner-block .slider-title {
    text-shadow: 0 2px 8px rgba(255,255,255,0.18);
  }

  html[data-theme="light_japan"] .banner-block .hero-year {
    background: rgba(255,255,255,0.68);
    color: #0f172a;
  }

  html[data-theme="light_japan"] .banner-block .play-butn {
    color: #ffffff;
    background: linear-gradient(135deg, color-mix(in srgb, var(--color-primary, #0070c9) 88%, #fff 6%), color-mix(in srgb, var(--color-primary, #0070c9) 70%, #000 30%));
  }
  
  /* Скрываем правое изображение на мобилках */
  .banner-block .col-lg-6.d-none.d-lg-block {
    display: none !important;
  }
  
  /* ============================================
     CONTENT SECTIONS - Секции контента
     ============================================ */
  
  /* Заголовки секций - ФИКС: заголовок и кнопка рядом */
  .heading.style-1 {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 12px !important;
    padding: 0 16px !important;
    width: 100% !important;
  }
  
  .heading.style-1 h2 {
    font-size: 18px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    flex: 1 !important;
  }
  
  .catalog-link-btn {
    font-size: 12px !important;
    padding: 6px 12px !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
  }
  
  /* Container для мобилок - без padding */
  .container--wide {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  
  /* ============================================
     HORIZONTAL CAROUSEL - Горизонтальные ряды
     ============================================ */
  
  /* Секция - block для heading сверху */
  .home-section-grid {
    display: block !important;
    padding: 0 0 16px;
    margin: 0;
  }
  
  /* Заголовок секции на всю ширину */
  .home-section-grid > .heading {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0 16px !important;
    margin-bottom: 12px !important;
  }
  
  /* Контейнер карточек TV (горизонтальный скролл) */
  .home-section-grid .tv-cards-row {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: 12px;
    padding: 0 16px;
    -webkit-overflow-scrolling: touch;
  }
  
  .home-section-grid .tv-cards-row::-webkit-scrollbar {
    display: none;
  }
  /* ВАЖНО:
     Скролл должен быть только у `.tv-cards-row`.
     Раньше мы включали overflow-x на `.home-section-grid`, из-за чего вместе с карточками "уезжал" заголовок. */
  .home-section-grid {
    overflow-x: visible !important;
    white-space: normal !important;
  }
  
  /* ============================================
     MOBILE CONTENT CARDS
     ============================================ */
  
  .home-section-grid .content-card {
    flex: 0 0 140px;
    width: 140px;
    scroll-snap-align: start;
    margin: 0;
  }
  
  .home-section-grid .content-card__poster-wrapper {
    aspect-ratio: 2/3;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
  }
  
  .home-section-grid .content-card__poster-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  /* Плашка статуса */
  .home-section-grid .content-card__poster-tags {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  
  /* ============================================
     ВСЕ КАРТОЧКИ НА ГЛАВНОЙ - КОМПАКТНЫЕ КНОПКИ
     ============================================ */
  
  /* Статус (ОНГОИНГ/ЗАВЕРШЕНО) - КОМПАКТНЫЙ везде */
  .badge-status,
  .content-card .badge-status,
  .content-card__poster-tags .badge-status,
  a.badge-status {
    font-size: 8px !important;
    padding: 2px 5px !important;
    border-radius: 3px !important;
    min-height: auto !important;
    line-height: 1.2 !important;
  }
  
  /* Озвучка на карточках - СКРЫТЬ на мобильных везде */
  .content-card .badge-tag,
  .content-card .content-card__poster-tags .badge-tag,
  .content-card .content-card__poster-tags a.badge-tag,
  .content-card__poster-tags .badge-tag,
  .content-card__poster-tags a.badge-tag,
  .home-section .content-card .badge-tag,
  .home-section-grid .content-card .badge-tag,
  section .content-card .badge-tag,
  a.badge-tag:not(.banner-content *):not(.hero-status-year *) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
  }
  
  /* Плашка серий - КОМПАКТНАЯ */
  .content-card__ongoing-badge {
    position: absolute;
    bottom: 4px;
    left: 4px;
    right: 4px;
  }
  
  .ongoing-current,
  .ongoing-next,
  .content-card .ongoing-current,
  .content-card .ongoing-next {
    font-size: 7px !important;
    padding: 2px 4px !important;
    display: block;
    text-align: center;
    line-height: 1.2 !important;
  }
  
  /* Кнопка Play скрыта на мобилках в карточках */
  .home-section-grid .content-card__play-btn {
    display: none;
  }
  
  /* Админ кнопки скрыты */
  .home-section-grid .admin-quick-actions {
    display: none;
  }
  
  /* Название */
  .home-section-grid .content-card__body {
    padding: 8px 0 0;
  }
  
  .home-section-grid .content-card__title {
    font-size: 13px !important;
    line-height: 1.3 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-main, #fff);
  }
  
  /* ============================================
     SCHEDULE SECTION - Расписание
     ============================================ */
  
  .home-schedule {
    padding: 16px 0 !important;
  }
  
  .home-schedule__title {
    font-size: 18px !important;
    padding: 0 16px;
  }
  
  .home-schedule__card {
    margin: 0 16px;
    border-radius: 12px;
    overflow: hidden;
  }
  
  /* Дни недели - горизонтальный скролл */
  .home-schedule__tabs {
    display: flex !important;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 0;
    padding: 0;
  }
  
  .home-schedule__tabs::-webkit-scrollbar {
    display: none;
  }
  
  .home-schedule__tabs .nav-item {
    flex: 0 0 auto;
  }
  
  .home-schedule__tab {
    padding: 10px 16px !important;
    white-space: nowrap;
  }
  
  .home-schedule__tab-date {
    font-size: 10px !important;
  }
  
  .home-schedule__tab-label {
    font-size: 12px !important;
  }
  
  /* Контент расписания */
  .home-schedule__body {
    padding: 12px !important;
  }
  
  .home-schedule__lists {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  .home-schedule__col {
    width: 100% !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  .home-schedule__item {
    padding: 10px !important;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
  }
  
  .home-schedule__row {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .home-schedule__time {
    font-size: 12px !important;
    font-weight: 600;
    min-width: 45px;
  }
  
  .home-schedule__poster {
    width: 40px !important;
    height: 60px !important;
    border-radius: 4px;
  }
  
  .home-schedule__content-title {
    font-size: 13px !important;
    line-height: 1.3;
  }
  
  .home-schedule__chips {
    display: none; /* Скрываем чипсы на мобилках */
  }
  
  .home-schedule__episode {
    font-size: 11px !important;
    margin-left: auto;
    padding: 4px 8px;
    background: var(--color-primary, #00d4ff);
    color: #000;
    border-radius: 4px;
    font-weight: 600;
  }
  
  /* ============================================
     BLOG SECTION
     ============================================ */
  
  section.blog .row {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 12px;
    padding: 0 16px;
    scrollbar-width: none;
  }
  
  section.blog .row::-webkit-scrollbar {
    display: none;
  }
  
  section.blog .col-lg-4,
  section.blog .col-md-6,
  section.blog .col-12 {
    flex: 0 0 280px;
    width: 280px;
    max-width: none;
    padding: 0;
  }
  
  .anime-blog .img-block {
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/9;
  }
  
  .anime-blog .img-block img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .anime-blog .detail h4 {
    font-size: 14px !important;
    line-height: 1.4;
  }
}

/* ============================================
   LANDSCAPE MODE ON MOBILE
   ============================================ */
@media (max-width: 767px) and (orientation: landscape) {
  .banner.banner-slider {
    min-height: 100vh;
  }
  
  .banner-block.style-1 {
    min-height: 100vh;
  }
  
  .banner-block .slider-title {
    font-size: 24px !important;
  }
  
  .home-section-grid .content-card {
    flex: 0 0 120px;
    width: 120px;
  }
}

/* ============================================
   SMALL PHONES (< 375px)
   ============================================ */
@media (max-width: 374px) {
  .banner-block .slider-title {
    font-size: 24px !important;
  }
  
  .home-section-grid .content-card {
    flex: 0 0 120px;
    width: 120px;
  }
  
  .home-schedule__time {
    display: none;
  }
}

/* ============================================
   MOBILE CATEGORIES SECTION
   Горизонтальная полоса с категориями
   ============================================ */
@media (max-width: 767px) {
  .mobile-categories-section {
    padding: 12px 0;
    background: var(--bg-main, #0f1318);
    margin-top: -8px;
  }
  
  .mobile-categories-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 16px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .mobile-categories-scroll::-webkit-scrollbar {
    display: none;
  }
  
  .mobile-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    color: var(--text-main, #fff);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
  }
  
  .mobile-category-chip:hover,
  .mobile-category-chip:active {
    background: var(--accent, #00d4ff);
    border-color: var(--accent, #00d4ff);
    color: #000;
  }
  
  .mobile-category-chip i {
    font-size: 12px;
    opacity: 0.8;
  }
}

/* Скрыть на десктопе */
@media (min-width: 768px) {
  .mobile-categories-section {
    display: none !important;
  }
}
