/* =========================================================
   Responsive UX v7: navegación, lectura y conversión móvil
   ========================================================= */

html.ec-mobile-menu-open,
html.ec-mobile-menu-open body {
    overflow: hidden;
    overscroll-behavior: none;
}

.ec-footer-column [data-cookie-settings] {
    cursor: pointer;
}

@media (max-width: 980px) {
    :root {
        --ec-header-height: 70px;
    }

    .ec-desktop-nav {
        display: none !important;
    }

    .ec-mobile-navigation {
        display: block !important;
    }

    .ec-header-layout {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        min-height: var(--ec-header-height);
    }

    .ec-header-actions {
        gap: 8px;
    }

    .ec-header-cta {
        display: inline-flex !important;
        min-height: 42px;
        padding: 9px 13px;
        white-space: nowrap;
    }

    .ec-mobile-menu {
        position: fixed;
        top: calc(var(--ec-header-height) + var(--ec-admin-offset));
        bottom: 0;
        max-height: none;
        background: rgba(255, 255, 255, 0.985);
    }

    .ec-mobile-navigation[open] > .ec-mobile-menu {
        max-height: calc(100dvh - var(--ec-header-height) - var(--ec-admin-offset));
    }

    .ec-mobile-menu-inner {
        gap: 6px;
        padding-top: 18px;
        padding-bottom: max(26px, env(safe-area-inset-bottom));
    }

    .ec-mobile-menu-inner > a:not(.ec-mobile-cta) {
        min-height: 54px;
        padding: 13px 14px;
        border: 1px solid transparent;
        border-radius: 12px;
        font-size: 0.95rem;
    }

    .ec-mobile-menu-inner > a.ec-active,
    .ec-mobile-menu-inner > a[aria-current="page"] {
        background: var(--ec-primary-soft);
        border-color: #cfe0ff;
    }

    .ec-mobile-cta {
        min-height: 54px;
        margin-top: 8px;
        border-radius: 12px;
    }

    .ec-hero-grid,
    .ec-page-hero-grid,
    .ec-article-hero-inner,
    .ec-contact-page-hero-grid,
    .ec-contact-page-layout,
    .ec-resource-layout {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .ec-hero-grid {
        gap: 34px;
    }

    .ec-hero-copy,
    .ec-hero-card,
    .ec-page-hero-copy,
    .ec-page-hero-media,
    .ec-page-hero-card,
    .ec-contact-checklist,
    .ec-contact-summary {
        width: 100%;
        max-width: 760px;
        justify-self: center;
    }

    .ec-service-grid,
    .ec-problem-grid,
    .ec-image-service-grid,
    .ec-home-feature-grid,
    .ec-blog-grid-large,
    .ec-related-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ec-section {
        padding-block: 68px;
    }
}

@media (max-width: 760px) {
    :root {
        --ec-header-height: 66px;
    }

    body {
        padding-bottom: calc(72px + env(safe-area-inset-bottom));
    }

    .ec-container {
        width: min(calc(100% - 24px), var(--ec-container));
    }

    .ec-header-cta {
        display: none !important;
    }

    .ec-brand-copy strong {
        font-size: 0.88rem;
    }

    .ec-brand-copy small {
        display: none;
    }

    .ec-menu-button {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    .ec-mobile-callbar {
        position: fixed;
        z-index: 9995;
        right: 0;
        bottom: 0;
        left: 0;
        display: block !important;
        padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
        background: rgba(255,255,255,.97);
        border-top: 1px solid var(--ec-border);
        box-shadow: 0 -10px 30px rgba(16,24,40,.1);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    .ec-mobile-callbar a {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 9px;
        min-height: 50px;
        padding-inline: 16px;
        background: var(--ec-primary);
        border-radius: 13px;
        color: #fff !important;
        font-weight: 800;
        box-shadow: 0 8px 22px rgba(23,92,211,.2);
    }

    .ec-mobile-callbar a :is(span,svg) {
        color: #fff !important;
    }

    .ec-hero {
        padding: 38px 0 48px;
    }

    .ec-hero-grid {
        gap: 26px;
    }

    .ec-hero-copy h1 {
        margin-bottom: 16px;
        font-size: clamp(2rem, 9.6vw, 2.6rem);
        line-height: 1.02;
        letter-spacing: -0.045em;
    }

    .ec-hero-lead {
        max-width: 36rem;
        font-size: 1rem;
        line-height: 1.58;
    }

    .ec-hero-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
        margin-top: 22px;
    }

    .ec-hero-actions .ec-button,
    .ec-page-hero-actions .ec-button {
        width: 100%;
        min-height: 50px;
    }

    .ec-trust-list {
        display: flex;
        gap: 8px;
        margin-top: 18px;
        overflow-x: auto;
        padding-bottom: 4px;
        scrollbar-width: none;
    }

    .ec-trust-list::-webkit-scrollbar {
        display: none;
    }

    .ec-trust-list li {
        flex: 0 0 auto;
        min-height: 34px;
        padding: 7px 10px;
        background: #fff;
        border: 1px solid var(--ec-border);
        border-radius: 999px;
        font-size: 0.72rem;
        white-space: nowrap;
    }

    .ec-hero-card {
        padding: 17px;
        border-radius: 17px;
    }

    .ec-hero-card-heading {
        gap: 11px;
        margin-bottom: 8px;
    }

    .ec-hero-card-heading h2 {
        font-size: 1.18rem;
    }

    .ec-service-links a {
        min-height: 58px;
        padding: 11px 0;
    }

    .ec-service-links a > .ec-icon:last-child {
        display: block;
        width: 18px;
        height: 18px;
    }

    .ec-section,
    .ec-contact-section {
        padding-block: 52px;
    }

    .ec-section-heading {
        max-width: 100%;
        text-align: left !important;
    }

    .ec-section-heading .ec-section-kicker {
        justify-content: flex-start !important;
    }

    .ec-section-heading > :is(h1,h2,p) {
        margin-inline: 0 !important;
    }

    .ec-section-heading h2 {
        font-size: clamp(1.75rem, 7.7vw, 2.15rem);
    }

    .ec-service-grid,
    .ec-problem-grid,
    .ec-image-service-grid,
    .ec-home-feature-grid,
    .ec-blog-grid-large,
    .ec-related-grid,
    .ec-footer-columns,
    .ec-service-detail-grid,
    .ec-info-card-row,
    .ec-related-links,
    .ec-resource-grid,
    .ec-resource-mini-grid,
    .ec-glossary-grid,
    .ec-neighborhood-grid,
    .ec-sitemap-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .ec-service-card {
        min-height: 0;
        padding: 19px;
        border-radius: 14px;
    }

    .ec-service-card h3 {
        font-size: 1.08rem;
    }

    .ec-problem-card {
        display: grid;
        grid-template-columns: 112px minmax(0, 1fr);
        align-items: stretch;
        min-height: 112px;
    }

    .ec-problem-card > a {
        min-height: 100%;
    }

    .ec-problem-card img {
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
        object-fit: cover;
    }

    .ec-problem-card > div {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 15px;
    }

    .ec-problem-card h3 {
        margin-bottom: 9px;
        font-size: 0.98rem;
    }

    .ec-problem-card .ec-text-link {
        font-size: 0.76rem;
    }

    .ec-page-hero,
    .ec-article-hero {
        padding-top: 36px;
        padding-bottom: 46px;
    }

    .ec-page-hero-copy h1,
    .ec-article-hero h1 {
        font-size: clamp(1.9rem, 8.8vw, 2.45rem);
        line-height: 1.05;
    }

    .ec-seo-media-hero {
        border-radius: 16px;
    }

    .ec-content-layout,
    .ec-article-layout {
        gap: 34px;
    }

    .ec-content-main,
    .ec-article-content {
        font-size: 0.98rem;
        line-height: 1.7;
    }

    .ec-faq > summary {
        min-height: 58px;
        padding: 14px 15px;
    }

    .ec-contact-section .ec-contact-copy,
    .ec-guide-copy,
    .ec-footer-columns,
    .ec-footer-bottom {
        text-align: left !important;
    }

    .ec-footer-columns,
    .ec-footer-about,
    .ec-footer-column {
        justify-items: start !important;
    }

    .ec-footer-brand {
        justify-content: flex-start !important;
    }

    .ec-footer-bottom {
        align-items: flex-start;
    }

    .ec-footer-bottom-links {
        justify-content: flex-start !important;
    }
}

@media (max-width: 420px) {
    .ec-container {
        width: min(calc(100% - 20px), var(--ec-container));
    }

    .ec-brand-mark {
        width: 27px;
        flex-basis: 27px;
    }

    .ec-brand-copy strong {
        font-size: 0.82rem;
    }

    .ec-problem-card {
        grid-template-columns: 96px minmax(0, 1fr);
        min-height: 104px;
    }

    .ec-problem-card > div {
        padding: 13px;
    }

    .ec-cookie-panel {
        max-height: calc(100dvh - 24px);
        overflow-y: auto;
    }
}

/* =========================================================
   V8: menú móvil/tablet accesible y estable
   ========================================================= */

.ec-mobile-menu[hidden] {
    display: none !important;
}

.ec-menu-button-label {
    display: none;
    font-size: .82rem;
    font-weight: 800;
    line-height: 1;
}

.ec-mobile-navigation.is-open .ec-menu-open {
    display: none !important;
}

.ec-mobile-navigation.is-open .ec-menu-close {
    display: block !important;
}

@media (max-width: 980px) {
    .ec-header {
        z-index: 10030;
    }

    .ec-mobile-navigation {
        position: static;
    }

    .ec-menu-button {
        gap: 8px;
        width: auto;
        min-width: 48px;
        padding-inline: 12px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .ec-menu-button-label {
        display: inline;
    }

    .ec-mobile-menu {
        position: fixed !important;
        z-index: 10020;
        top: calc(var(--ec-header-height) + var(--ec-admin-offset)) !important;
        right: 0 !important;
        bottom: 0 !important;
        left: 0 !important;
        display: block;
        max-height: none !important;
        overflow-y: auto !important;
        visibility: visible !important;
        background: rgba(255, 255, 255, .995);
        border-top: 1px solid var(--ec-border);
        box-shadow: 0 24px 60px rgba(16, 24, 40, .18);
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: none !important;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .ec-mobile-menu::before {
        display: block;
        height: 10px;
        background: linear-gradient(180deg, rgba(16,24,40,.06), transparent);
        content: "";
    }

    .ec-mobile-menu-inner {
        width: min(calc(100% - 28px), 720px);
        gap: 8px;
        padding-top: 10px;
        padding-bottom: max(34px, env(safe-area-inset-bottom));
    }

    .ec-mobile-menu-inner > a:not(.ec-mobile-cta) {
        min-height: 58px;
        padding: 14px 16px;
        background: #fff;
        border: 1px solid var(--ec-border);
        border-radius: 14px;
        box-shadow: 0 2px 8px rgba(16,24,40,.035);
        font-size: 1rem;
        touch-action: manipulation;
    }

    .ec-mobile-menu-inner > a:not(.ec-mobile-cta) .ec-icon {
        flex: 0 0 auto;
    }

    .ec-mobile-cta {
        position: sticky;
        bottom: 0;
        min-height: 56px;
        margin-top: 8px;
        box-shadow: 0 10px 28px rgba(23,92,211,.22);
    }
}

@media (max-width: 520px) {
    .ec-menu-button {
        width: 46px;
        min-width: 46px;
        padding-inline: 0;
    }

    .ec-menu-button-label {
        display: none;
    }

    .ec-mobile-menu-inner {
        width: min(calc(100% - 20px), 720px);
    }
}
