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

/* ============================================
   HERO SECTION - Главный баннер
   ============================================ */
@media (max-width: 767px) {
  /* Убираем большие отступы секций */
  .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: 70vh;
    position: relative;
  }
  
  .banner-block.style-1 {
    min-height: 70vh;
    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;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70%;
    background: linear-gradient(to top, 
      rgba(0,0,0,0.95) 0%,
      rgba(0,0,0,0.8) 30%,
      rgba(0,0,0,0.4) 60%,
      transparent 100%
    );
    z-index: 1;
    pointer-events: none;
  }
  
  /* Контент Hero - внизу */
  .banner-block .hero-content-wrapper {
    position: relative;
    z-index: 2;
    padding: 20px 16px;
    padding-bottom: 30px;
  }
  
  .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: 28px !important;
    line-height: 1.1 !important;
    margin-bottom: 12px !important;
    text-shadow: 0 2px 12px rgba(0,0,0,0.8);
  }
  
  /* Теги статуса и озвучки */
  .banner-block .hero-status-year {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
  }
  
  /* Кнопка статуса - КОМПАКТНАЯ */
  .banner-block .btn-toggle--status {
    font-size: 9px !important;
    padding: 4px 8px !important;
    border-radius: 4px;
    border-width: 1px !important;
  }
  
  /* Озвучки на слайдере - СКРЫТЬ на мобильных */
  .banner-block .badge-tag,
  .banner-block .hero-status-year .badge-tag {
    display: none !important;
  }
  
  .banner-block .hero-year {
    font-size: 10px !important;
    padding: 3px 6px !important;
    opacity: 0.8;
  }
  
  /* Описание - сокращённое */
  .banner-block .hero-description {
    font-size: 13px !important;
    line-height: 1.5 !important;
    margin-bottom: 16px !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;
    padding: 14px 32px !important;
    font-size: 14px !important;
    font-weight: 700;
    border-radius: 8px;
    background: var(--color-primary, #00d4ff);
    color: #000;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4);
  }
  
  .banner-block .play-butn::before {
    content: '▶';
    font-size: 12px;
  }
  
  /* Скрываем правое изображение на мобилках */
  .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;
  }
}
