/* ══════════════════════════════════════════════
   MOBILE OPTIMIZATIONS
   Professional mobile-first enhancements
   ══════════════════════════════════════════════ */

/* ═══ GLOBAL MOBILE IMPROVEMENTS ═══ */

/* Prevent horizontal scroll on all pages */
body {
    overflow-x: hidden;
}

/* Ensure all images are responsive by default */
img {
    max-width: 100%;
    height: auto;
}

/* Improve touch targets globally */
@media (max-width: 768px) {
    a, button {
        min-height: 44px;
    }
    
    /* Ensure clickable areas are large enough */
    .mrcem-btn,
    .mrcem-pricing-card__btn,
    .mrcem-faq__q,
    .mrcem-reviews__arrow {
        min-height: 48px;
    }
}

/* Prevent zoom on input focus on iOS */
@media screen and (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* ═══ HERO SECTION - MOBILE ═══ */

@media (max-width: 768px) {
    /* Reduce orb sizes on mobile for better performance */
    .mrcem-orb--1 {
        width: 300px;
        height: 300px;
    }
    
    .mrcem-orb--2 {
        width: 200px;
        height: 200px;
    }
    
    .mrcem-orb--3 {
        width: 150px;
        height: 150px;
    }
    
    /* Simplify hero grid on mobile */
    .mrcem-hero__grid {
        background-size: 40px 40px;
    }
}

@media (max-width: 640px) {
    /* Further reduce decorative elements */
    .mrcem-orb--1,
    .mrcem-orb--2,
    .mrcem-orb--3 {
        display: none;
    }
    
    .mrcem-hero__grid {
        display: none;
    }
    
    .mrcem-hero__bg::before {
        background: radial-gradient(ellipse 60% 50% at 50% 30%, rgba(20, 71, 166, 0.3) 0%, transparent 60%);
    }
}

/* ═══ WHY CHOOSE SECTION - MOBILE ═══ */

@media (max-width: 640px) {
    /* Hide decorative glow on mobile */
    .mrcem-why-choose__glow {
        display: none;
    }
}

/* ═══ REVIEWS SECTION - MOBILE ═══ */

@media (max-width: 768px) {
    /* Reduce orb sizes */
    .mrcem-reviews__orb--1 {
        width: 300px;
        height: 300px;
    }
    
    .mrcem-reviews__orb--2 {
        width: 200px;
        height: 200px;
    }
}

@media (max-width: 640px) {
    /* Hide orbs on small screens for performance */
    .mrcem-reviews__orb--1,
    .mrcem-reviews__orb--2 {
        display: none;
    }
    
    /* Simplify background grid */
    .mrcem-reviews::after {
        background-size: 30px 30px;
    }
}

/* ═══ PRICING SECTION - MOBILE ═══ */

@media (max-width: 640px) {
    /* Hide decorative backgrounds */
    .mrcem-pricing::before,
    .mrcem-pricing::after {
        display: none;
    }
}

/* ═══ FAQ SECTION - MOBILE ═══ */

@media (max-width: 640px) {
    /* Hide decorative backgrounds */
    .mrcem-faq::before,
    .mrcem-faq::after {
        display: none;
    }
}

/* ═══ HOW IT WORKS SECTION - MOBILE ═══ */

@media (max-width: 640px) {
    /* Simplify background grid */
    .mrcem-how::before {
        background-size: 30px 30px;
    }
    
    /* Hide glow effect */
    .mrcem-how__glow {
        display: none;
    }
}

/* ═══ DASHBOARD SECTION - MOBILE ═══ */

@media (max-width: 640px) {
    /* Optimize dashboard shell */
    .mrcem-db-shell {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ═══ CTA BANNER - MOBILE ═══ */

@media (max-width: 640px) {
    /* Simplify CTA background */
    .mrcem-cta-banner::before {
        background:
            radial-gradient(ellipse 50% 60% at 30% 50%, rgba(14, 175, 160, 0.08) 0%, transparent 60%),
            radial-gradient(ellipse 50% 60% at 70% 50%, rgba(20, 71, 166, 0.12) 0%, transparent 60%);
    }
}

/* ═══ FOOTER - MOBILE ═══ */

@media (max-width: 640px) {
    /* Already handled in styles.css */
}

/* ═══ ANIMATION OPTIMIZATIONS ═══ */

/* Reduce animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ═══ PERFORMANCE OPTIMIZATIONS ═══ */

/* Hide non-essential decorative elements on very small screens */
@media (max-width: 480px) {
    /* Hide decorative dots and dividers */
    .mrcem-divider-dot,
    .mrcem-section-label__dot {
        display: none;
    }
    
    /* Simplify card shadows */
    .mrcem-feature-card,
    .mrcem-review-card,
    .mrcem-pricing-card {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
}

/* ═══ TABLET OPTIMIZATIONS (768px - 1024px) ═══ */

@media (min-width: 769px) and (max-width: 1024px) {
    /* Optimize grid layouts for tablet */
    .mrcem-hero__inner {
        max-width: 900px;
        padding: 4rem 2rem 3rem;
    }
    
    .mrcem-why-choose__grid {
        gap: 3rem;
    }
    
    .mrcem-reviews__inner {
        max-width: 900px;
    }
    
    .mrcem-pricing__inner {
        max-width: 900px;
    }
}

/* ═══ LARGE TABLET / SMALL DESKTOP (1024px - 1280px) ═══ */

@media (min-width: 1025px) and (max-width: 1280px) {
    .mrcem-hero__inner {
        max-width: 1100px;
    }
    
    .mrcem-why-choose__inner,
    .mrcem-reviews__inner,
    .mrcem-pricing__inner,
    .mrcem-faq__inner {
        max-width: 1000px;
    }
}

/* ═══ TOUCH DEVICE OPTIMIZATIONS ═══ */

/* Improve touch scrolling */
@media (hover: none) and (pointer: coarse) {
    .mrcem-hero,
    .mrcem-reviews,
    .mrcem-why-choose {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Remove hover effects on touch devices */
    .mrcem-btn:hover,
    .mrcem-card:hover,
    .mrcem-review-card:hover {
        transform: none;
    }
}

/* ═══ LANDSCAPE MOBILE ═══ */

@media (max-height: 500px) and (orientation: landscape) {
    .mrcem-hero {
        min-height: auto;
        padding: 4rem 0;
    }
    
    .mrcem-hero__inner {
        align-items: flex-start;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    /* Hide non-essential elements in landscape */
    .mrcem-social-proof {
        display: none;
    }
}

/* ═══ SAFE AREA INSETS (iPhone X+) ═══ */

@supports (padding: max(0px)) {
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    .sticky {
        padding-top: max(env(safe-area-inset-top), 0px);
    }
}

/* ═══ PRINT STYLES ═══ */

@media print {
    /* Hide non-essential elements when printing */
    header,
    footer,
    .mrcem-cta-banner,
    .mrcem-btn,
    .mobile-menu {
        display: none !important;
    }
    
    /* Ensure text is readable */
    body {
        background: white;
        color: black;
    }
    
    .mrcem-section {
        page-break-inside: avoid;
    }
}
