/* iPhone-specific fixes for GorillaCon Website */

/* iOS Safari fixes */
@supports (-webkit-touch-callout: none) {
    /* Fix for iOS Safari */
    body {
        -webkit-text-size-adjust: 100%;
        position: relative;
    }
    
    /* Fix container width issues */
    .container {
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
}

/* iPhone-specific media queries */
@media screen and (max-width: 428px) { /* iPhone 14 Pro Max and below */
    /* Fix navbar alignment */
    .navbar {
        height: auto;
        min-height: 70px;
    }
    
    .navbar .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.5rem 1rem;
        height: 100%;
    }
    
    .logo {
        flex: 0 0 auto;
        z-index: 1002;
    }
    
    .logo img {
        height: 50px;
        width: auto;
        display: block;
    }
    
    /* Fix mobile menu toggle position */
    .mobile-menu-toggle {
        position: relative;
        z-index: 1002;
        width: 35px;
        height: 35px;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        background: transparent;
        border: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    
    .mobile-menu-toggle span {
        display: block;
        width: 25px;
        height: 3px;
        background: var(--gold);
        transition: all 0.3s ease;
        pointer-events: none;
    }
    
    /* Fix nav menu for iOS */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        height: -webkit-fill-available;
        background: #000000;
        z-index: 1001;
        transition: right 0.3s ease;
        -webkit-transition: right 0.3s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-menu.active {
        right: 0;
        box-shadow: -5px 0 20px rgba(0,0,0,0.5);
    }
    
    /* Hero section iPhone fixes */
    .hero {
        background-attachment: scroll; /* Fix parallax on iOS */
        padding: 1.5rem 0 2rem;
        min-height: auto;
    }
    
    .hero-content {
        padding: 1rem 0;
        text-align: center;
    }
    
    .hero h2 {
        font-size: 2rem;
        line-height: 1.1;
        margin-bottom: 0.5rem;
        word-wrap: break-word;
    }
    
    .hero h3 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }
    
    .typewriter {
        font-size: 0.9rem;
        margin-bottom: 1rem;
        padding: 0 1rem;
    }
    
    /* Fix button alignment */
    .hero-buttons {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 1rem;
        width: 100%;
        padding: 0 1rem;
    }
    
    .hero-buttons .btn-primary,
    .hero-buttons .btn-secondary {
        width: 100%;
        max-width: 280px;
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
        margin: 0;
        box-sizing: border-box;
    }
    
    /* Service areas fix */
    .service-areas {
        padding: 0 1rem;
        text-align: center;
    }
    
    .service-areas p {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
    
    .key-areas {
        font-size: 0.8rem !important;
        word-wrap: break-word;
        line-height: 1.4;
    }
    
    /* Trust badge alignment */
    .trust-badge {
        margin-top: 1rem !important;
        padding: 0 1rem;
    }
    
    .trust-badge a {
        font-size: 0.8rem !important;
        padding: 0.5rem 0.75rem !important;
        white-space: nowrap;
    }
    
    /* Services grid iPhone */
    .services {
        padding: 2rem 0;
    }
    
    .services h2 {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
        padding: 0 1rem;
    }
    
    .services-grid {
        padding: 0 1rem;
        gap: 1rem;
    }
    
    .service-card {
        padding: 1.25rem;
        margin-bottom: 0.5rem;
    }
    
    .service-card h3 {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .service-card p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* Gallery fixes */
    .gallery-showcase {
        padding: 2rem 0;
    }
    
    .gallery-showcase h2 {
        font-size: 1.75rem;
        padding: 0 1rem;
    }
    
    .multi-slideshow-container {
        margin: 0;
    }
    
    /* Features grid */
    .features-grid {
        padding: 0 1rem;
        gap: 1rem;
    }
    
    .feature {
        padding: 1.25rem;
    }
    
    .feature h3 {
        font-size: 1.1rem;
    }
    
    /* Calculator CTA iPhone */
    .calculator-cta {
        padding: 1.5rem 0 !important;
    }
    
    .calculator-cta h2 {
        font-size: 1.5rem !important;
        padding: 0 1rem;
        line-height: 1.2;
    }
    
    .calculator-cta p {
        font-size: 0.9rem !important;
        padding: 0 1rem;
    }
    
    /* Testimonials */
    .testimonials {
        padding: 2rem 0;
    }
    
    .testimonial {
        padding: 1.25rem;
    }
    
    .testimonial p {
        font-size: 0.95rem;
        padding: 0 0.5rem;
    }
    
    /* CTA section */
    .cta-section {
        padding: 2rem 0;
    }
    
    .cta-section h2 {
        font-size: 1.5rem;
        padding: 0 1rem;
    }
    
    .cta-section p {
        font-size: 0.9rem;
        padding: 0 1rem;
    }
    
    /* Footer iPhone */
    footer {
        padding: 2rem 0 1rem;
    }
    
    .footer-grid {
        padding: 0 1rem;
        gap: 1.5rem;
    }
    
    /* Instant quote modal iPhone */
    .instant-quote-trigger {
        bottom: 1rem;
        right: 1rem;
        font-size: 0.85rem;
        padding: 0.6rem 0.875rem;
    }
    
    /* Fix horizontal scrolling issues */
    * {
        max-width: 100vw;
    }
    
    /* Ensure sections don't overflow */
    section {
        overflow-x: hidden;
    }
}

/* iPhone 5/SE specific */
@media screen and (max-width: 320px) {
    .hero h2 {
        font-size: 1.75rem;
    }
    
    .hero h3 {
        font-size: 0.95rem;
    }
    
    .hero-buttons .btn-primary,
    .hero-buttons .btn-secondary {
        font-size: 0.95rem;
        padding: 0.75rem 1.25rem;
    }
    
    .services h2,
    .gallery-showcase h2,
    .why-choose h2,
    .testimonials h2 {
        font-size: 1.5rem;
    }
    
    .service-card h3,
    .feature h3 {
        font-size: 1rem;
    }
}

/* iPhone notch handling */
@supports (padding: max(0px)) {
    .navbar {
        padding-top: max(0.5rem, env(safe-area-inset-top));
    }
    
    .nav-menu {
        padding-top: max(4rem, calc(2rem + env(safe-area-inset-top)));
        padding-bottom: env(safe-area-inset-bottom);
    }
    
    footer {
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }
}

/* Fix iOS button appearance */
input[type="submit"],
input[type="button"],
button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Prevent iOS zoom on form focus */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Fix iOS momentum scrolling */
.nav-menu,
.instant-quote-modal,
.instant-quote-content {
    -webkit-overflow-scrolling: touch;
}

/* Prevent text selection on buttons */
.mobile-menu-toggle,
.btn-primary,
.btn-secondary,
button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}