/* Mobile-specific fixes and improvements */

/* Fix viewport issues on iOS */
@supports (-webkit-touch-callout: none) {
    body {
        -webkit-text-size-adjust: 100%;
        -webkit-font-smoothing: antialiased;
    }
}

/* Fix for Android Chrome */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    body {
        font-smoothing: antialiased;
        -webkit-font-smoothing: antialiased;
    }
}

/* Ensure proper touch targets */
button, .dot, .footer-links a {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Fix for very small screens */
@media (max-width: 320px) {
    .container {
        padding: 0 8px;
    }
    
    .main-title {
        font-size: 1.2rem;
        line-height: 1.1;
    }
    
    .description {
        font-size: 0.8rem;
    }
    
    .main-cta-btn {
        font-size: 0.8rem;
        padding: 8px 12px;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .step-icon {
        font-size: 2rem;
    }
    
    .diamond-logo::before {
        font-size: 40px;
    }
}

/* Fix for landscape orientation on phones */
@media (max-height: 500px) and (orientation: landscape) {
    .header {
        padding: 20px 0;
    }
    
    .stats-section,
    .cta-section,
    .steps-section,
    .testimonials-section {
        padding: 30px 0;
    }
    
    .main-title {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
    
    .diamond-img {
        width: 80px;
        height: 40px;
    }
    
    .diamond-logo::before {
        font-size: 50px;
    }
}

/* Ensure buttons work on touch devices */
@media (hover: none) and (pointer: coarse) {
    .main-cta-btn:hover,
    .stat-item:hover {
        transform: none;
    }
    
    .main-cta-btn:active {
        transform: scale(0.95);
    }
    
    .stat-item:active {
        transform: scale(0.98);
    }
}

/* Fix for high DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .diamond-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Ensure text remains readable if fonts fail */
.main-title,
.section-title,
.stat-number {
    font-weight: bold;
    text-rendering: optimizeLegibility;
}

/* Fix for older Android browsers */
.stats-grid,
.steps-slider,
.testimonials-grid {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.stats-grid > *,
.steps-slider > *,
.testimonials-grid > * {
    -webkit-flex: 1 1 250px;
    -ms-flex: 1 1 250px;
    flex: 1 1 250px;
    max-width: 100%;
}

@media (max-width: 768px) {
    .stats-grid > *,
    .steps-slider > *,
    .testimonials-grid > * {
        -webkit-flex: 1 1 100%;
        -ms-flex: 1 1 100%;
        flex: 1 1 100%;
    }
}