/* ==========================================
   RESPONSIVE STYLES
   InternetPlanFinder - All Breakpoints
   ========================================== */

/* ===== LARGE DESKTOP (max-width: 1200px) ===== */
@media (max-width: 1200px) {
    .provider-card-industrial {
        grid-template-columns: auto 1fr auto;
        gap: 20px;
    }

    .provider-specs {
        gap: 16px;
    }

    .mega-dropdown {
        min-width: 600px;
    }

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

/* ===== TABLET (max-width: 1024px) ===== */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    .section {
        padding: 60px 0;
    }

    .section-header {
        margin-bottom: 36px;
    }

    .provider-card-industrial {
        grid-template-columns: 1fr;
        gap: 16px;
        text-align: center;
    }

    .provider-info {
        flex-direction: column;
        align-items: center;
    }

    .provider-specs {
        justify-content: center;
        flex-wrap: wrap;
    }

    .provider-rank {
        flex-direction: row;
        justify-content: center;
        gap: 12px;
    }

    .provider-tags {
        justify-content: center;
    }

    .provider-actions {
        flex-direction: row;
        justify-content: center;
    }

    .featured-banner {
        flex-direction: column;
        text-align: center;
    }

    .deals-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .speed-test-banner {
        flex-direction: column;
        text-align: center;
    }

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

    .dropdown-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dropdown-col.featured {
        display: none;
    }
}

/* ===== MOBILE (max-width: 768px) ===== */
@media (max-width: 768px) {

    /* Top Bar */
    .top-bar {
        display: none;
    }

    /* Mobile Navigation - Full screen overlay */
    .nav-menu {
        position: fixed;
        top: 72px;
        left: 0;
        width: 100%;
        height: calc(100vh - 72px);
        background: white;
        flex-direction: column;
        padding: 24px;
        gap: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        z-index: 999;
        border-top: 1px solid var(--gray-lighter);
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-link {
        padding: 14px 16px;
        font-size: 16px;
        border-bottom: 1px solid var(--gray-lighter);
        width: 100%;
        justify-content: space-between;
    }

    .hamburger {
        display: flex;
    }

    .btn-nav {
        display: none;
    }

    /* Mobile Dropdowns */
    .dropdown-menu,
    .mega-dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        min-width: auto;
        padding: 0 0 0 16px;
        display: none;
        background: var(--bg-light);
        border-radius: var(--radius);
        margin-top: 4px;
    }

    .nav-item.dropdown-active .dropdown-menu,
    .nav-item.dropdown-active .mega-dropdown {
        display: block;
    }

    .dropdown-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .dropdown-col.featured {
        display: none;
    }

    .dropdown-menu a {
        padding: 10px 12px;
    }

    /* Hero */
    .hero {
        padding: 60px 0;
        min-height: auto;
    }

    .hero h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 16px;
        margin-bottom: 28px;
    }

    .hero-badge {
        font-size: 12px;
        padding: 6px 14px;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 24px;
    }

    .hero-stats .stat {
        flex: 0 0 calc(50% - 12px);
    }

    /* Search Box */
    .search-input-wrapper {
        flex-direction: column;
        gap: 8px;
    }

    .search-input-wrapper input {
        width: 100%;
        padding: 14px;
        text-align: center;
        border: 1px solid var(--gray-lighter);
        border-radius: var(--radius);
    }

    .search-input-wrapper .btn {
        width: 100%;
        justify-content: center;
        border-radius: var(--radius);
    }

    .input-decals {
        display: none;
    }

    /* Typography */
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    h3 {
        font-size: 1.25rem;
    }

    .section {
        padding: 48px 0;
    }

    .section-header {
        margin-bottom: 32px;
    }

    .section-header p {
        font-size: 15px;
    }

    /* Cards and grids */
    .deals-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .footer-col {
        text-align: center;
    }

    .footer-logo {
        justify-content: center;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .footer-bottom-links {
        justify-content: center;
    }

    /* Filter Tabs */
    .filter-tabs {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
    }

    .filter-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    /* Comparison: show mobile cards, hide table */
    .comparison-table-wrapper {
        display: none;
    }

    .comparison-cards-mobile {
        display: block !important;
    }

    /* Featured */
    .featured-banner {
        padding: 24px;
        gap: 24px;
    }

    .price-box-industrial {
        min-width: auto;
        padding: 24px;
    }

    /* Provider cards */
    .provider-card-industrial .provider-specs {
        flex-wrap: wrap;
        gap: 16px;
    }

    .provider-card-industrial .provider-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .provider-card-industrial .provider-tags {
        justify-content: center;
    }

    .provider-card-industrial .provider-rank {
        justify-content: center;
    }

    .provider-card-industrial .provider-info {
        flex-direction: column;
        align-items: center;
    }

    /* Rating factors */
    .rating-factors-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Back to top */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    /* Speed test */
    .speed-test-banner {
        padding: 40px 0;
        gap: 32px;
    }

    /* ZIP Results */
    .zip-results {
        padding: 20px;
        margin-top: 20px;
    }

    .result-item {
        flex-direction: column;
        text-align: center;
        gap: 12px;
        padding: 14px;
    }

    .result-info {
        flex-direction: column;
    }

    .result-specs {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }

    .result-item .btn {
        width: 100%;
        justify-content: center;
    }

    /* Sticky mobile CTA - initially hidden, JS shows it */
    .sticky-mobile-cta {
        display: none;
    }

    /* States grid */
    .states-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Category grid */
    .category-grid {
        grid-template-columns: 1fr;
    }

    /* Steps grid */
    .steps-grid {
        flex-direction: column;
    }

    /* Articles grid */
    .articles-grid {
        grid-template-columns: 1fr;
    }

    /* Speed guide grid */
    .speed-guide-grid {
        grid-template-columns: 1fr;
    }

    /* Tips grid */
    .tips-grid {
        grid-template-columns: 1fr;
    }

    /* Contact grid */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    /* Form row */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* About stats */
    .about-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Team grid */
    .team-grid {
        grid-template-columns: 1fr;
    }

    /* Values grid */
    .values-grid {
        grid-template-columns: 1fr;
    }

    /* Disclosure cards */
    .disclosure-cards {
        grid-template-columns: 1fr;
    }

    /* Does/Doesnt comparison */
    .does-doesnt {
        grid-template-columns: 1fr;
    }

    /* Plans grid (review pages) */
    .plans-grid {
        grid-template-columns: 1fr;
    }

    /* Summary grid (review pages) */
    .summary-grid {
        grid-template-columns: 1fr;
    }

    /* Summary specs (review pages) */
    .summary-specs {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Review layout (review pages) */
    .review-layout {
        grid-template-columns: 1fr;
    }

    .review-sidebar {
        order: -1;
    }

    .sidebar-sticky {
        position: static;
    }

    .toc-card {
        display: none;
    }

    /* Newsletter form */
    .newsletter-form {
        flex-direction: column;
    }

    .newsletter-form input {
        text-align: center;
    }

    .newsletter-form .btn {
        width: 100%;
        justify-content: center;
    }

    /* Comparison table on mobile - ensure scroll works */
    .comparison-table {
        min-width: 500px;
        font-size: 13px;
    }

    .comparison-table thead th,
    .comparison-table tbody td {
        padding: 10px 12px;
    }

    /* Process steps */
    .process-step {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    /* Author box */
    .author-box {
        flex-direction: column;
        text-align: center;
    }

    /* CTA box */
    .cta-box {
        padding: 24px;
    }

    /* Verdict box */
    .verdict-box {
        padding: 24px;
    }

    /* Quick summary */
    .quick-summary {
        padding: 20px;
    }

    .quick-summary-header {
        flex-direction: column;
    }

    /* Rating bars */
    .rating-bar-item {
        flex-wrap: wrap;
    }

    .rating-bar-label {
        min-width: 100%;
    }

    /* Mega dropdown on mobile */
    .mega-dropdown {
        min-width: auto !important;
    }

    /* Prevent any element from overflowing viewport */
    img, video, iframe, table, pre, code {
        max-width: 100%;
    }

    /* Fix provider card grid on mobile */
    .provider-card,
    .provider-card-industrial {
        grid-template-columns: 1fr !important;
    }
}

/* ===== SMALL MOBILE (max-width: 480px) ===== */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 14px;
    }

    h2 {
        font-size: 1.35rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    .section {
        padding: 40px 0;
    }

    .section-header p {
        font-size: 14px;
    }

    .search-tags {
        display: none;
    }

    .hero-stats {
        gap: 16px;
    }

    .hero-stats .stat strong {
        font-size: 20px;
    }

    .hero-stats .stat span {
        font-size: 11px;
    }

    .provider-card-industrial {
        padding: 16px;
    }

    .featured-banner {
        padding: 20px;
    }

    .deal-card-tech {
        padding: 20px;
    }

    .btn-lg {
        padding: 14px 24px;
        font-size: 15px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }

    .rating-factors-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .rating-factor-card {
        padding: 16px 12px;
    }
}

/* ===== EXTRA SMALL (max-width: 360px) ===== */
@media (max-width: 360px) {
    .container {
        padding: 0 12px;
    }

    .hero h1 {
        font-size: 1.4rem;
    }

    h2 {
        font-size: 1.25rem;
    }

    .hero-badge {
        font-size: 11px;
        padding: 4px 10px;
    }

    .rating-factors-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .top-bar,
    .header,
    .hero-bg,
    .back-to-top,
    .newsletter-section,
    .footer-social,
    .hamburger,
    .btn-nav,
    .filter-tabs,
    .search-tags {
        display: none !important;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }

    .hero {
        background: #fff !important;
        color: #000 !important;
        padding: 20px 0;
        min-height: auto;
    }

    .hero h1,
    .hero-subtitle {
        color: #000 !important;
    }

    .gradient-text {
        -webkit-text-fill-color: #000;
        color: #000;
    }

    .section {
        padding: 20px 0;
    }

    .provider-card,
    .provider-card-industrial,
    .category-card,
    .deal-card,
    .deal-card-tech,
    .article-card,
    .rating-factor-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    a {
        color: #000;
        text-decoration: underline;
    }

    .footer {
        background: #fff;
        color: #000;
        border-top: 2px solid #000;
    }
}

/* ===== ACCESSIBILITY: REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero-bg::before {
        animation: none;
    }

    .gauge-circle {
        animation: none;
    }

    .hero-particles {
        display: none;
    }
}

/* ===== ACCESSIBILITY: HIGH CONTRAST ===== */
@media (prefers-contrast: high) {
    :root {
        --primary: #0040ff;
        --gray: #333333;
        --gray-light: #555555;
        --gray-lighter: #999999;
    }

    .provider-card,
    .provider-card-industrial,
    .category-card,
    .deal-card,
    .deal-card-tech,
    .rating-factor-card {
        border-width: 2px;
    }

    .btn {
        border-width: 3px;
    }
}
