/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
  .site-header .header__inner { height: 70px; }
  .nav { display: none; }
  .burger { display: inline-flex; }
  
  /* Tablet - динамическая высота */
  body[data-variant="order"] .hero-section {
    min-height: auto;
    padding: 60px 0;
  }
  
  body[data-variant="subscribe"] .hero-section {
    min-height: 70vh;
  }
  
  /* Tablet - центрирование видео когда нет дополнительных элементов */
  .hero__right {
    justify-content: center;
    min-height: 300px;
  }
  
  body[data-variant="subscribe"] .hero__right {
    justify-content: flex-start;
  }
  
  /* Автоматическая адаптация на планшетах */
  .hero-section:not(:has(.hero-discount-form)):not(:has(.countdown-timer)) {
    min-height: auto !important;
    padding: 60px 0 !important;
  }
}

/* Mobile */
@media (max-width: 767px) {
  :root { --header-h: 60px; }
  
  /* Предотвращение горизонтальной прокрутки */
  body { 
    overflow-x: hidden;
  }
  .container {
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .logo img { height: 32px; }
  .header-cta { 
    display: none;
  }
  .header__inner { 
    align-items: center; 
    display: flex;
    justify-content: space-between;
  }
  
  /* Ensure burger button is visible and clickable */
  .burger {
    display: inline-flex !important;
    position: relative;
    z-index: 1003;
    pointer-events: auto;
  }
  .btn--lg { width: 100%; }
  /* Mobile - базовая динамическая высота */
  .hero-section { 
    min-height: auto;
    padding: 40px 0;
  }
  
  /* Mobile - полная высота экрана для версии с формой */
  body[data-variant="subscribe"] .hero-section {
    min-height: 100vh;
    padding: 40px 0 60px;
  }
  
  body[data-variant="order"] .hero-section {
    min-height: auto;
    padding: 60px 0;
  }
  
  .hero__grid { gap: 16px; }
  .hero-discount-form { margin-top: 8px; }
  .countdown-timer { margin-bottom: 8px; }
  
  /* Mobile - вертикальная раскладка, центрирование не требуется */
  .hero__right {
    justify-content: flex-start !important;
  }
  
  /* Автоматическая адаптация на мобильных */
  .hero-section:not(:has(.hero-discount-form)):not(:has(.countdown-timer)) {
    min-height: auto !important;
    padding: 60px 0 !important;
  }
  
  /* Author section mobile fixes */
  .card--author .about-card__content {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    text-align: left;
    align-items: flex-start !important;
  }
  
  .card--author .about-card__image {
    order: -1;
    justify-self: flex-start !important;
    align-self: flex-start !important;
    text-align: left !important;
  }
  
  .card--author .about-card__text {
    text-align: left !important;
  }
  
  .card--author .about-cards-grid {
    text-align: left !important;
  }
  
  .card--author .about-cards-grid {
    gap: 16px;
  }
  
  /* Mobile spacing for reviews section */
  .card--author .reviews-links .card h4 {
    margin-bottom: 16px;
  }
  
  .card--author .reviews-links .btn {
    margin-top: 16px;
  }
  
  /* Show mobile action bar only on mobile */
  .action-bar-mobile { display: block; }
}

/* Styles for intermediate screens (341-400px) */
@media (min-width: 341px) and (max-width: 400px) {
  .timer-text {
    font-size: 15px;
  }
  
  .action-bar-close {
    padding: 6px;
    width: 40px;
    height: 40px;
  }
  
  .mobile-action-grid {
    gap: 11px;
  }
  
  .action-bar-mobile {
    padding: 14px 18px 16px;
  }
}

/* Styles for very small screens (≤340px) */
@media (max-width: 340px) {
  .timer-text {
    font-size: 14px;
  }
  
  .action-bar-close {
    padding: 4px;
    width: 36px;
    height: 36px;
  }
  
  .mobile-action-grid {
    gap: 10px;
  }
  
  .action-bar-mobile {
    padding: 12px 14px 14px;
  }
  
  /* Mobile menu button styling */
  .mobile-menu__cta {
    margin-top: 16px;
    width: 100%;
    justify-self: stretch;
  }

  /* Discount badge mobile positioning */
  .discount-badge--corner {
    top: -10px;
    right: 10px;
  }

  /* Footer styles already unified for all screen sizes */

  /* Show line breaks and hide desktop-only separators on mobile */
  .mobile-break { display: block; }
  .desktop-only { display: none; }
}

/* Small Mobile Optimization (400px and below) */
@media (max-width: 400px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
  
  /* Countdown timer fixes for narrow screens */
  .countdown-timer {
    padding: 20px 12px;
    margin-bottom: 12px;
  }
  
  .timer-display {
    gap: 6px;
  }
  
  .timer-unit {
    min-width: 40px !important;
    padding: 12px 4px;
  }
  
  .timer-number {
    font-size: 18px !important;
  }
  
  /* Disable nowrap on narrow screens to prevent overflow */
  .nowrap-lg {
    white-space: normal !important;
  }
  
  /* Form optimizations */
  .discount-form-wrapper {
    padding: 16px 12px;
  }

  /* Discount badge positioning for small screens */
  .discount-badge--corner {
    top: -12px;
    right: 8px;
    font-size: var(--fs-body-xs);
    padding: 4px 8px;
  }
  
  .form-fields-horizontal {
    gap: 8px;
  }
  
  .btn {
    padding: 12px 16px;
    font-size: var(--fs-body-sm);
  }
  
  .btn--lg {
    padding: 14px 20px;
  }
  
  /* Блок "Способы обучения" - только эти карточки */
  .bento-grid--learning .card {
    padding: 16px;
  }

  .bento-grid--learning .review-icon {
    width: 40px;
    height: 40px;
  }

  .bento-grid--learning h4,
  .bento-grid--learning .h5 {
    font-size: 18px;
  }

  /* Блок "Представляю вашему вниманию" */
  .bento-item--learning-conclusion {
    padding: 20px 16px;
  }

  .learning-conclusion-text {
    padding: 20px 0;
  }

  .learning-conclusion-image {
    width: 180px;
  }

  .bento-item--learning-conclusion .hero-title {
    font-size: clamp(20px, 5vw, 26px);
  }
}

/* Very Small Mobile Optimization */
@media (max-width: 360px) {
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }
  
  /* Even tighter countdown timer for very small screens */
  .countdown-timer {
    padding: 16px 8px;
  }
  
  .timer-display {
    gap: 4px;
  }
  
  .timer-unit {
    min-width: 36px !important;
    padding: 10px 2px;
  }
  
  .timer-number {
    font-size: 16px !important;
  }
  
  /* Hero title adjustment */
  .hero-title {
    font-size: clamp(22px, 6vw, 28px);
    line-height: 1.3;
  }
  
  /* Tighter form spacing */
  .discount-form-wrapper {
    padding: 12px 8px;
  }

  /* Discount badge positioning for very small screens */
  .discount-badge--corner {
    top: -14px;
    right: 6px;
    font-size: 10px;
    padding: 3px 6px;
  }
  
  /* Блок "Способы обучения" - компактная версия */
  .bento-grid--learning .card {
    padding: 12px;
  }

  .bento-grid--learning .review-icon {
    width: 36px;
    height: 36px;
  }

  .bento-grid--learning h4,
  .bento-grid--learning .h5 {
    font-size: 16px;
  }

  .bento-grid--learning {
    gap: 12px;
  }

  /* Блок "Представляю вашему вниманию" - компактная версия */
  .bento-item--learning-conclusion {
    padding: 16px 12px;
  }

  .learning-conclusion-text {
    padding: 16px 0;
  }

  .learning-conclusion-text .overline {
    font-size: 11px;
  }

  .learning-conclusion-image {
    width: 160px;
  }

  .bento-item--learning-conclusion .hero-title {
    font-size: clamp(18px, 5vw, 24px);
    line-height: 1.3;
  }

  .course-cover-container {
    padding: 12px;
  }
}




