/* Mobile Overflow Fixes - Add to all pages */

/* Global mobile overflow prevention */
html {
    overflow-x: hidden;
    width: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Prevent all containers from overflowing */
* {
    max-width: 100%;
    box-sizing: border-box;
}

/* Fix for sections that might overflow */
section {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Container fixes */
.container,
.nav-container,
.hero-container,
.support-hero-container,
.hosting-hero-container,
.services-container,
.why-container,
.contact-container,
.footer-container {
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
    overflow-x: hidden;
}

/* Grid fixes - ensure grids don't overflow */
.services-dual-grid,
.services-grid,
.benefits-grid,
.package-grid,
.contact-info-grid,
.included-grid {
    max-width: 100%;
    overflow-x: hidden;
}

/* Card fixes */
.service-card,
.benefit-card,
.package-card,
.contact-card,
.service-category,
.benefit-item,
.included-item {
    max-width: 100%;
    overflow-x: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Text fixes - prevent long words from causing overflow */
h1, h2, h3, h4, h5, h6, p, li, span, a {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Specific mobile breakpoints */
@media (max-width: 768px) {
    /* Hero sections */
    .hero,
    .support-hero,
    .hosting-hero {
        padding-left: 1rem;
        padding-right: 1rem;
        overflow-x: hidden;
    }
    
    /* Hero containers */
    .hero-container,
    .support-hero-container,
    .hosting-hero-container {
        padding-left: 0;
        padding-right: 0;
    }
    
    /* Titles - ensure they fit on mobile */
    .hero-title,
    .support-hero-title,
    .hosting-hero-title {
        font-size: 2rem !important;
        line-height: 1.2;
        margin-bottom: 1rem;
        word-break: break-word;
    }
    
    .section-title {
        font-size: 1.8rem !important;
        line-height: 1.2;
        word-break: break-word;
    }
    
    /* Subtitle fixes */
    .hero-subtitle,
    .support-hero-subtitle,
    .hosting-hero-subtitle,
    .section-subtitle {
        font-size: 1rem !important;
        line-height: 1.5;
    }
    
    /* Price boxes */
    .pricing-highlight {
        padding: 1rem !important;
        margin-left: 0;
        margin-right: 0;
    }
    
    .price-amount {
        font-size: 2.5rem !important;
    }
    
    /* Feature lists */
    .price-features,
    .service-features,
    .feature-list {
        padding: 0;
    }
    
    /* Buttons */
    .btn {
        max-width: 100%;
        font-size: 0.9rem;
        padding: 0.8rem 1.5rem;
    }
    
    /* Server illustration */
    .server-illustration {
        padding: 1rem !important;
        margin: 0;
    }
    
    .server-box {
        padding: 0.75rem !important;
        min-height: auto;
    }
    
    .server-icon {
        width: 50px !important;
        height: 50px !important;
        font-size: 0.9rem !important;
        min-width: 50px;
    }
    
    .server-info h3 {
        font-size: 0.9rem !important;
    }
    
    .server-info p {
        font-size: 0.8rem !important;
    }
    
    /* Service cards */
    .service-card {
        padding: 1.25rem !important;
    }
    
    .service-name {
        font-size: 1.2rem !important;
        line-height: 1.3;
    }
    
    .service-description {
        font-size: 0.9rem !important;
    }
    
    /* Forms */
    .form-input,
    .form-textarea,
    .form-select {
        width: 100%;
        max-width: 100%;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Navigation fixes */
    .nav-menu {
        max-width: 100vw;
    }
    
    /* Footer */
    .footer {
        padding: 2rem 1rem 1rem;
    }
    
    .footer-container {
        padding: 0;
    }
}

/* Extra small mobile (320px - 480px) */
@media (max-width: 480px) {
    /* Ultra compact mode */
    .hero-title,
    .support-hero-title,
    .hosting-hero-title {
        font-size: 1.75rem !important;
    }
    
    .section-title {
        font-size: 1.5rem !important;
    }
    
    /* Even smaller price */
    .price-amount {
        font-size: 2rem !important;
    }
    
    /* Compact cards */
    .service-card,
    .benefit-card,
    .package-card {
        padding: 1rem !important;
    }
    
    /* Smaller icons */
    .service-icon,
    .category-icon,
    .contact-icon {
        width: 50px !important;
        height: 50px !important;
    }
    
    .service-icon svg,
    .category-icon svg {
        width: 25px !important;
        height: 25px !important;
    }
    
    /* Server boxes vertical */
    .server-box {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    /* Compact spacing */
    section {
        padding: 1.5rem 0.75rem;
    }
}

/* Landscape phone fix */
@media (max-width: 768px) and (orientation: landscape) {
    .hero,
    .support-hero,
    .hosting-hero {
        min-height: auto;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
}

/* Safe area for notched phones (iPhone X+) */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}
