/**
 * BuyIPTV24X7 - Responsive Adjustments & Breakpoints
 * Responsive styling for Plans Grid, Movies Carousel,
 * Movie Detail Modals, and USA Channel Directory.
 */

/* ==========================================================================
   1. Large Displays to Laptops (Max 1200px)
   ========================================================================== */
@media (max-width: 1200px) {
  .plans-grid,
  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .channels-grid,
  .channels-grid-skeleton {
    grid-template-columns: repeat(3, 1fr);
  }

  .movie-card {
    flex: 0 0 200px;
    max-width: 200px;
  }
}

/* ==========================================================================
   2. Tablets & Small Laptops (Max 991px)
   ========================================================================== */
@media (max-width: 991px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .grid-cols-3,
  .grid-cols-4,
  .plans-grid,
  .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .channels-grid,
  .channels-grid-skeleton {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .controls-top-row {
    flex-direction: column;
    align-items: stretch;
  }

  .controls-actions {
    width: 100%;
    justify-content: space-between;
  }

  .select-group {
    flex: 1;
  }

  .select-group select.form-select {
    width: 100%;
  }

  .movie-modal__grid,
  .movie-modal-content {
    grid-template-columns: 200px 1fr;
    gap: 20px;
    padding: 24px;
  }

  .movie-modal__title,
  .modal-movie-title {
    font-size: 1.35rem;
  }
}

/* ==========================================================================
   3. Mobile Phones (Max 767px)
   ========================================================================== */
@media (max-width: 767px) {
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4,
  .plans-grid,
  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .plan-card,
  .pricing-card {
    padding: 24px 18px;
  }

  .plan-card--featured,
  .plan-card.is-popular,
  .pricing-card.is-popular {
    transform: none;
  }

  .plan-card--featured:hover,
  .plan-card.is-popular:hover,
  .pricing-card.is-popular:hover {
    transform: translateY(-4px);
  }

  .site-header {
    height: 68px;
  }

  .header-btn-plan {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-cta-title {
    font-size: 1.5rem;
  }

  /* Movies Carousel Mobile Navigation */
  .carousel-nav-btn {
    display: none;
  }

  .movie-card {
    flex: 0 0 160px;
    max-width: 160px;
  }

  .movie-card__content,
  .movie-card-info {
    padding: 10px;
  }

  .movie-card__title,
  .movie-card-title {
    font-size: 0.88rem;
  }

  /* Movie Modal Stacked Layout */
  .movie-modal {
    padding: 12px;
  }

  .movie-modal__grid,
  .movie-modal-content {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px 16px;
  }

  .movie-modal__poster-wrap,
  .movie-modal-poster-col {
    max-width: 180px;
    margin: 0 auto;
  }

  .movie-modal__body,
  .movie-modal-info-col {
    text-align: center;
  }

  .movie-modal__meta,
  .modal-header-meta {
    justify-content: center;
  }

  .movie-modal__cta,
  .modal-cta-row {
    justify-content: center;
  }

  .modal-cta-row .btn,
  .movie-modal__cta .btn {
    width: 100%;
  }

  /* USA Channels Directory Mobile */
  .channels-grid,
  .channels-grid-skeleton {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .channel-card {
    padding: 16px;
  }

  .controls-actions {
    flex-direction: column;
  }

  .channels-summary-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .directory-meta-bar {
    font-size: 0.82rem;
    gap: 8px;
  }

  .directory-meta-bar .meta-divider {
    display: none;
  }

  /* Table Horizontal Scrolling Hint */
  .table-responsive-wrapper {
    box-shadow: inset -10px 0 10px -10px rgba(0, 0, 0, 0.15);
  }

  .plans-comparison-table th,
  .plans-comparison-table td {
    padding: 12px 14px;
    font-size: 0.85rem;
  }
}

/* ==========================================================================
   4. Small Mobile Screens (Max 480px)
   ========================================================================== */
@media (max-width: 480px) {
  .movie-card {
    flex: 0 0 145px;
    max-width: 145px;
  }

  .plan-card__price,
  .plan-price,
  .pricing-amount {
    font-size: 1.9rem;
  }

  .category-tab-btn {
    padding: 6px 14px;
    font-size: 0.82rem;
  }

  .inventory-verified-alert {
    flex-direction: column;
    text-align: center;
  }

  .inventory-verified-alert .alert-content {
    text-align: center;
  }
}


/* Additional Responsive Rules for Homepage Components */
@media (max-width: 1200px) {
  .hero-layout {
    gap: 32px;
  }
  .devices-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
  .trust-support-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 991px) {
  .hero-layout {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 40px;
  }
  .hero-content {
    max-width: 100%;
    margin: 0 auto;
  }
  .hero-actions {
    justify-content: center;
  }
  .hero-highlights {
    justify-content: center;
  }
  .hero-visual {
    max-width: 480px;
    margin: 0 auto;
  }
  .floating-card--support {
    top: -10px;
    left: 0;
  }
  .floating-card--devices {
    bottom: 20px;
    right: 0;
  }
  .devices-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .steps-connecting-line {
    display: none;
  }
  .devices-cta-card {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
  .trust-direct-bar {
    padding: 24px;
  }
  .direct-bar-content {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
}

@media (max-width: 767px) {
  .hero-section {
    padding: 50px 0 40px 0;
  }
  .hero-title {
    font-size: 2rem;
  }
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .hero-highlights {
    gap: 14px;
  }
  .floating-card {
    display: none;
  }
  .devices-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .channels-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .steps-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .trust-support-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .cta-banner-card {
    padding: 36px 20px;
  }
  .cta-btn-whatsapp {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
  }
}

@media (max-width: 375px) {
  .hero-title {
    font-size: 1.7rem;
  }
  .hero-highlights {
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .device-card {
    flex-direction: column;
    text-align: center;
  }
  .device-card__action {
    margin: 10px auto 0 auto;
  }
}
