/* ============================================================
   SERVICIOS RC | MOBILE UX OPTIMIZATIONS
   Cross-browser: iOS Safari, Chrome Android, Firefox Mobile
   ============================================================ */

/* ── 1. PREVENIR DESBORDE HORIZONTAL GLOBAL ─────────────────── */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

/* ── 2. HERO: altura real en móviles (iOS Safari barra dinámica) */
.hero-full {
    min-height: 100vh;
    min-height: 100dvh;
    min-height: calc(var(--vh, 1vh) * 100);
}

/* ── 3. TAP HIGHLIGHT: quitar azul de Android ───────────────── */
button,
a[role="button"],
[type="submit"],
[type="button"] {
    -webkit-tap-highlight-color: transparent;
}

/* ── 4. HEADER: safe-area top para notch ────────────────────── */
#main-nav {
    padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
}

/* ── 5. BOTÓN WHATSAPP FLOTANTE: no tapar barra inferior iOS ── */
.whatsapp-fab {
    bottom: 2rem;
    right: 1.5rem;
    bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
    right: calc(1.5rem + env(safe-area-inset-right, 0px));
}

/* ══════════════════════════════════════════════════════════════
   MENÚ MÓVIL — Overlay fullscreen
   Posicionado fuera del <header> para evitar stacking context.
   ══════════════════════════════════════════════════════════════ */
.mobile-menu-overlay {
    /* Posicionamiento: cubre toda la pantalla */
    position: fixed;
    inset: 0;
    z-index: 9999; /* Mayor que el header (z-50 = 50) */

    /* Fondo y apariencia */
    background-color: rgba(26, 29, 38, 0.98);

    /* Layout: columna centrada */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;

    /* Safe-area: respetar notch arriba y home-bar abajo */
    padding-top: calc(5rem + env(safe-area-inset-top, 0px));
    padding-bottom: calc(2rem + env(safe-area-inset-bottom, 20px));
    padding-left:  env(safe-area-inset-left,  0px);
    padding-right: env(safe-area-inset-right, 0px);

    /* Scroll si el contenido es largo (pantallas muy pequeñas) */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Botón cerrar (×) */
.mobile-menu-close {
    position: absolute;
    top: calc(1.25rem + env(safe-area-inset-top, 0px));
    right: 1.25rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 2.2rem;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Contenedor de links */
.mobile-menu-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

/* Link principal (INICIO, SERVICIOS, etc.) */
.mobile-menu-link {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-style: italic;
    font-size: clamp(1.5rem, 7vw, 2rem);
    color: #ffffff;
    text-decoration: none;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease;
}
.mobile-menu-link:hover,
.mobile-menu-link:active {
    color: #D97A1A;
}

/* Sub-links (Técnicos, Especializados, etc.) */
.mobile-menu-sublinks {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}
.mobile-menu-sublink {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #9CA0A6;
    text-decoration: none;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease;
}
.mobile-menu-sublink i {
    color: rgba(217, 122, 26, 0.6);
}
.mobile-menu-sublink:hover,
.mobile-menu-sublink:active {
    color: #D97A1A;
}

/* Botón CTA (CONTACTO) */
.mobile-menu-cta {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 1rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1A1D26;
    background-color: #D97A1A;
    text-decoration: none;
    border-radius: 1rem;
    padding: 1rem 2.5rem;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s ease;
}
.mobile-menu-cta:hover,
.mobile-menu-cta:active {
    background-color: #C46A1F;
}

/* ── 6. FOOTER: reajuste de spacing en mobile ────────────────── */
@media (max-width: 767px) {
    footer a[href^="mailto"],
    footer a[href^="tel"] {
        white-space: normal;
        word-break: break-all;
        font-size: 0.9rem;
    }
}

/* ── 7. NEWSLETTER: padding razonable en mobile ─────────────── */
@media (max-width: 639px) {
    .newsletter-box {
        padding: 2rem 1.25rem !important;
        border-radius: 1.5rem !important;
    }
}

/* ── 8. GLASS-CARD: backdrop-filter con prefijos completos ───── */
.glass-card {
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

/* ── 9. INPUTS: prevenir zoom automático en iOS ──────────────── */
@media (max-width: 639px) {
    input[type="email"],
    input[type="text"],
    input[type="tel"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* ── 10. BRANDS MARQUEE: altura mínima para mobile ──────────── */
@media (max-width: 639px) {
    .brands-marquee {
        height: 72px;
    }
    .brand-badge {
        min-width: 120px;
        height: 52px;
        padding: 0.5rem 0.85rem;
    }
    .brand-badge img {
        max-height: 28px;
    }
}

/* ── 11. HERO TEXT: font-size adaptable en xs ───────────────── */
@media (max-width: 400px) {
    .hero-h1 {
        font-size: clamp(1.75rem, 8.5vw, 2.5rem);
        line-height: 1.1;
    }
}

/* ── 12. CONTACT FORM BUTTON: ancho completo en mobile ──────── */
@media (max-width: 639px) {
    .contact-submit-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ── 13. IMG: evitar stretch ────────────────────────────────── */
img {
    max-width: 100%;
    height: auto;
}

/* ── 14. SCROLL PAD: evitar que anclas queden bajo nav fixed ── */
html {
    scroll-padding-top: 80px;
}
@media (max-width: 767px) {
    html {
        scroll-padding-top: 70px;
    }
}

/* ── 15. HOVER: deshabilitar en touch para glass-card ───────── */
@media (hover: none) {
    .glass-card:hover {
        transform: none;
    }
}

/* ── 16. COLOR SCHEME ───────────────────────────────────────── */
:root {
    color-scheme: dark;
}
