:root {
    --eg-black: #202020;
    --eg-black-soft: #2b2b2b;
    --eg-white: #ffffff;
    --eg-cream: #fbfaf6;
    --eg-text: #141414;
    --eg-muted: #e7e2da;
    --eg-gold: #f7a83a;
    --eg-gold-dark: #df9021;
    --eg-font-serif: Georgia, "Times New Roman", Times, serif;
    --eg-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
}

html {
    scroll-behavior: smooth;
}

body.eg-body {
    margin: 0;
    background: var(--eg-white);
    color: var(--eg-text);
    font-family: var(--eg-font-serif);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

.eg-body *,
.eg-body *::before,
.eg-body *::after {
    box-sizing: border-box;
}

.eg-body img,
.eg-body svg {
    max-width: 100%;
    display: block;
}

.eg-container {
    width: min(1120px, calc(100% - 48px));
    margin-inline: auto;
}

.eg-skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 9999;
    transform: translateY(-140%);
    background: var(--eg-white);
    color: var(--eg-black);
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
}

.eg-skip-link:focus {
    transform: translateY(0);
}

.eg-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 0 clamp(24px, 4vw, 48px);
    background: rgba(32, 32, 32, 0.98);
    color: var(--eg-white);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body.admin-bar .eg-topbar {
    top: 32px;
}

.eg-topbar__brand,
.eg-topbar__phone {
    color: var(--eg-white);
    text-decoration: none;
}

.eg-topbar__brand {
    font-size: clamp(1.28rem, 2.4vw, 1.9rem);
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    white-space: nowrap;
}

.eg-topbar__phone {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: clamp(1rem, 2vw, 1.35rem);
    line-height: 1;
    white-space: nowrap;
}

.eg-topbar__phone:hover,
.eg-topbar__brand:hover {
    color: var(--eg-gold);
}

.eg-main {
    overflow: hidden;
}

.eg-hero {
    position: relative;
    min-height: calc(100svh - 64px);
    display: grid;
    place-items: center;
    color: var(--eg-white);
    text-align: center;
    background-color: #121212;
    background-image:
        linear-gradient(180deg, rgba(0, 0, 0, 0.56), rgba(0, 0, 0, 0.72)),
        var(--eg-hero-bg, url("../img/hero.webp"));
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

.eg-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.08), transparent 42%);
    pointer-events: none;
}

.eg-hero__content {
    position: relative;
    z-index: 1;
    max-width: 920px;
    padding: clamp(72px, 11vh, 140px) 0 clamp(88px, 12vh, 150px);
}

.eg-eyebrow {
    margin: 0 0 18px;
    font-size: clamp(1.05rem, 2.5vw, 1.55rem);
    font-weight: 700;
    letter-spacing: 0.02em;
    text-shadow: 0 3px 14px rgba(0, 0, 0, 0.35);
}

.eg-hero__title {
    margin: 0;
    font-size: clamp(3.5rem, 9.8vw, 7.3rem);
    line-height: 0.95;
    font-weight: 800;
    letter-spacing: -0.035em;
    text-wrap: balance;
    text-shadow: 0 5px 24px rgba(0, 0, 0, 0.42);
}

.eg-hero__lead {
    max-width: 820px;
    margin: clamp(32px, 6vw, 58px) auto 0;
    font-size: clamp(1.35rem, 3vw, 2.05rem);
    line-height: 1.35;
    font-weight: 800;
    text-shadow: 0 3px 16px rgba(0, 0, 0, 0.45);
}

.eg-hero__text {
    max-width: 900px;
    margin: 28px auto 0;
    font-size: clamp(1.2rem, 2.4vw, 1.8rem);
    line-height: 1.6;
    text-shadow: 0 3px 16px rgba(0, 0, 0, 0.45);
}

.eg-scroll {
    width: 54px;
    height: 54px;
    margin: clamp(42px, 7vw, 76px) auto 0;
    display: grid;
    place-items: center;
    color: var(--eg-gold);
    text-decoration: none;
    font-size: 3.2rem;
    line-height: 1;
    filter: drop-shadow(0 5px 9px rgba(0, 0, 0, 0.46));
    animation: egArrow 1.6s ease-in-out infinite;
}

@keyframes egArrow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(9px); }
}

.eg-services {
    background: var(--eg-white);
    padding: clamp(64px, 8.5vw, 112px) 0;
    text-align: center;
}

.eg-section-title {
    max-width: 820px;
    margin: 0 auto;
    color: #050505;
    font-size: clamp(2.3rem, 5vw, 4rem);
    line-height: 1.05;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-wrap: balance;
}

.eg-section-rule {
    width: 100%;
    height: 1px;
    margin: clamp(34px, 5vw, 58px) auto;
    background: #e6e1da;
}

.eg-services__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px;
}

.eg-service-card {
    min-height: 238px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    padding: 34px 22px;
    border: 2px solid #242424;
    background: var(--eg-white);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.eg-service-card:hover {
    transform: translateY(-4px);
    border-color: var(--eg-gold-dark);
    box-shadow: var(--eg-shadow);
}

.eg-service-card__icon {
    width: 112px;
    height: 112px;
    display: grid;
    place-items: center;
    border: 4px solid rgba(247, 168, 58, 0.88);
    border-radius: 999px;
    color: var(--eg-gold);
}

.eg-service-card__icon svg {
    width: 54px;
    height: 54px;
}

.eg-service-card__logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.eg-service-card__title {
    margin: 0;
    color: #050505;
    font-size: clamp(1.42rem, 2.2vw, 1.85rem);
    line-height: 1.2;
    font-weight: 500;
}

.eg-closing {
    position: relative;
    color: var(--eg-white);
    text-align: center;
    background-color: #111;
    background-image:
        linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.82)),
        var(--eg-closing-bg, url("../img/cierre-bg.webp"));
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

.eg-closing__content {
    max-width: 980px;
    padding: clamp(78px, 12vw, 150px) 0 clamp(82px, 12vw, 150px);
}

.eg-closing__kicker {
    margin: 0 0 34px;
    font-size: clamp(1.35rem, 2.7vw, 2.15rem);
    line-height: 1.45;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.eg-closing__headline {
    max-width: 880px;
    margin: 0 auto 34px;
    font-size: clamp(2rem, 4.5vw, 4.1rem);
    line-height: 1.12;
    font-weight: 800;
    text-wrap: balance;
}

.eg-closing__lines {
    display: grid;
    gap: 22px;
    margin: 0 auto 38px;
    font-size: clamp(1.32rem, 2.5vw, 2rem);
    line-height: 1.45;
    font-weight: 800;
    text-transform: uppercase;
}

.eg-closing__lines p,
.eg-closing__text {
    margin: 0;
}

.eg-closing__text {
    max-width: 900px;
    margin-inline: auto;
    font-size: clamp(1.22rem, 2.45vw, 1.78rem);
    line-height: 1.65;
}

.eg-closing__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 56px;
    margin-top: 42px;
    padding: 14px 26px;
    border: 2px solid var(--eg-white);
    border-radius: 999px;
    color: var(--eg-white);
    text-decoration: none;
    font-size: clamp(1.12rem, 2vw, 1.45rem);
    font-weight: 800;
    transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.eg-closing__cta:hover {
    background: var(--eg-white);
    color: var(--eg-black);
    border-color: var(--eg-white);
}

.eg-footer {
    background: var(--eg-black-soft);
    color: var(--eg-white);
    text-align: center;
    padding: 34px 0;
    font-size: clamp(1rem, 2vw, 1.35rem);
    line-height: 1.6;
}

.eg-footer p {
    margin: 0;
}

.eg-footer__inner {
    display: grid;
    gap: 12px;
}

.eg-footer__nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 12px;
}

.eg-footer__nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    color: var(--eg-white);
    background: rgba(255, 255, 255, 0.06);
    text-decoration: none;
    font-size: clamp(0.95rem, 1.7vw, 1.1rem);
    font-weight: 800;
    line-height: 1.2;
    transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.eg-footer__nav a:hover,
.eg-footer__nav a:focus-visible {
    color: var(--eg-black);
    background: var(--eg-gold);
    border-color: var(--eg-gold);
    transform: translateY(-1px);
}

@media (max-width: 980px) {
    .eg-services__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 782px) {
    body.admin-bar .eg-topbar {
        top: 46px;
    }
}

@media (max-width: 640px) {
    .eg-container {
        width: min(100% - 40px, 1120px);
    }

    .eg-topbar {
        min-height: 58px;
        padding-inline: 23px;
    }

    .eg-topbar__brand {
        font-size: 1.18rem;
        max-width: 46vw;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .eg-topbar__phone {
        gap: 7px;
        font-size: 1.02rem;
    }

    .eg-topbar__phone-icon {
        width: 20px;
        height: 20px;
        flex: 0 0 auto;
    }

    .eg-hero {
        min-height: calc(100svh - 58px);
        background-position: center top;
    }

    .eg-hero__content {
        padding-top: 66px;
        padding-bottom: 76px;
    }

    .eg-eyebrow {
        font-size: 1.08rem;
        margin-bottom: 18px;
    }

    .eg-hero__title {
        font-size: clamp(3.9rem, 15vw, 5.25rem);
        line-height: 0.96;
    }

    .eg-hero__lead {
        margin-top: 34px;
        font-size: 1.38rem;
        line-height: 1.32;
    }

    .eg-hero__text {
        margin-top: 22px;
        font-size: 1.16rem;
        line-height: 1.55;
    }

    .eg-scroll {
        margin-top: 42px;
        font-size: 3rem;
    }

    .eg-services {
        padding: 58px 0;
    }

    .eg-section-title {
        font-size: clamp(2.25rem, 9.2vw, 3rem);
    }

    .eg-section-rule {
        margin: 34px 0 28px;
    }

    .eg-services__grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .eg-service-card {
        min-height: 212px;
        padding: 30px 20px;
    }

    .eg-service-card__icon {
        width: 104px;
        height: 104px;
    }

    .eg-service-card__title {
        font-size: 1.55rem;
    }

    .eg-closing__content {
        padding: 72px 0 78px;
    }

    .eg-closing__kicker {
        font-size: 1.28rem;
        line-height: 1.6;
    }

    .eg-closing__headline {
        font-size: 2.12rem;
    }

    .eg-closing__lines {
        gap: 22px;
        font-size: 1.3rem;
        line-height: 1.55;
    }

    .eg-closing__text {
        font-size: 1.18rem;
    }

    .eg-footer {
        padding: 30px 0;
    }
}

@media (max-width: 380px) {
    .eg-container {
        width: min(100% - 32px, 1120px);
    }

    .eg-topbar {
        padding-inline: 18px;
    }

    .eg-topbar__brand {
        font-size: 1.05rem;
    }

    .eg-topbar__phone {
        font-size: 0.95rem;
    }

    .eg-hero__title {
        font-size: 3.55rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .eg-scroll {
        animation: none;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}

/* =========================================================
   Fix v1.2: ocultar el texto/botón nativo de Astra "Scroll al inicio".
   En esta landing no usamos el botón scroll-top de Astra; al quitar CSS/JS
   del tema padre para mejorar velocidad, ese texto podía quedar visible.
   ========================================================= */
body.eg-landing-page #ast-scroll-top,
body.eg-landing-page .ast-scroll-top-icon,
body.eg-landing-page .ast-scroll-to-top,
body.eg-landing-page .ast-scroll-to-top-left,
body.eg-landing-page .ast-scroll-to-top-right {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

body.eg-landing-page .screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(1px, 1px, 1px, 1px) !important;
    clip-path: inset(50%) !important;
    border: 0 !important;
    white-space: nowrap !important;
    word-wrap: normal !important;
}

body.eg-landing-page .screen-reader-text:focus {
    clip: auto !important;
    clip-path: none !important;
    height: auto !important;
    width: auto !important;
    margin: 0 !important;
    overflow: visible !important;
    white-space: normal !important;
}

/* =========================================================
   Fix v1.6: 404 con diseño propio y logos externos más claros.
   ========================================================= */
.eg-services,
.eg-closing {
    scroll-margin-top: 86px;
}

.eg-service-card__logo {
    width: 72px;
    height: 72px;
    max-width: 72px;
    max-height: 72px;
    object-fit: contain;
}

.eg-404-page .eg-404-hero {
    min-height: calc(72svh - 64px);
}

.eg-404-hero__content {
    max-width: 900px;
    padding-top: clamp(74px, 10vh, 120px);
    padding-bottom: clamp(74px, 10vh, 120px);
}

.eg-404-hero__title {
    font-size: clamp(3rem, 7vw, 6rem);
}

.eg-404-hero__text {
    max-width: 760px;
}

.eg-404-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    margin-top: 36px;
}

.eg-404-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 13px 23px;
    border: 2px solid var(--eg-white);
    border-radius: 999px;
    text-decoration: none;
    font-size: clamp(1.05rem, 2vw, 1.28rem);
    font-weight: 800;
    line-height: 1.2;
    transition: transform 180ms ease, background 180ms ease, color 180ms ease, border-color 180ms ease;
}

.eg-404-button:hover,
.eg-404-button:focus-visible {
    transform: translateY(-2px);
}

.eg-404-button--light {
    color: var(--eg-white);
    background: rgba(255, 255, 255, 0.04);
}

.eg-404-button--light:hover,
.eg-404-button--light:focus-visible {
    color: var(--eg-black);
    background: var(--eg-white);
}

.eg-404-button--gold {
    color: var(--eg-black);
    background: var(--eg-gold);
    border-color: var(--eg-gold);
}

.eg-404-button--gold:hover,
.eg-404-button--gold:focus-visible {
    color: var(--eg-black);
    background: #ffc267;
    border-color: #ffc267;
}

@media (max-width: 640px) {
    .eg-services,
    .eg-closing {
        scroll-margin-top: 78px;
    }

    .eg-service-card__logo {
        width: 66px;
        height: 66px;
        max-width: 66px;
        max-height: 66px;
    }

    .eg-404-page .eg-404-hero {
        min-height: calc(72svh - 58px);
    }

    .eg-404-hero__title {
        font-size: clamp(2.85rem, 12vw, 4.5rem);
    }

    .eg-404-actions {
        flex-direction: column;
        align-items: stretch;
        max-width: 330px;
        margin-inline: auto;
    }
}
