/* GRUPO EMAB — index4 (layout independiente) */
:root {
    --header-height: 88px;
    --header-anchor-gap: 16px;
    --navy: #0B3060;
    --navy-light: #245a8f;
    --navy-deep: #061a33;
    --orange: #F07C22;
    --orange-mid: #f59a4a;
    --orange-rgb: 240, 124, 34;
    --grad-band: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 48%, var(--navy-light) 100%);
    --text-dark: #1a1a1a;
    --text-muted: #5c6b7a;
    --bg-soft: #f4f5f7;
    --white: #ffffff;
    --shadow-card: 0 8px 32px rgba(11, 48, 96, 0.08);
    --shadow-card-featured: 0 12px 40px rgba(11, 48, 96, 0.14);
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    /* Igual que main.css (index2): altura mínima de sección bajo el header fijo */
    --section-min-h: calc(100vh - var(--header-height));
    --section-min-h: calc(100dvh - var(--header-height));
}

@keyframes icon-v4-soft-float {
    0%,
    100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-2px) scale(1.02);
    }
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + var(--header-anchor-gap));
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-weight: 400;
    color: var(--text-dark);
    background: var(--white);
    line-height: 1.65;
    padding-top: var(--header-height);
}

h1, h2, h3, h4 {
    font-weight: 700;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 32px);
}

section[id]:not(#inicio),
footer[id] {
    scroll-margin-top: calc(var(--header-height) + var(--header-anchor-gap));
}

/* --- Header --- */
header#site-header {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 2000;
    padding-top: env(safe-area-inset-top, 0);
    background: var(--navy);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: var(--header-height);
    gap: 20px;
}

.logo-img {
    height: 48px;
    width: auto;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    color: var(--white);
}

.nav-toggle__bar {
    display: block;
    width: 24px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

header.nav-open .nav-toggle__bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

header.nav-open .nav-toggle__bar:nth-child(2) {
    opacity: 0;
}

header.nav-open .nav-toggle__bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

body.nav-menu-open {
    overflow: hidden;
    touch-action: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px 28px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.88);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--white);
    border-bottom-color: var(--orange);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn-orange {
    background: var(--orange);
    color: var(--white);
    border-color: var(--orange);
}

.btn-orange:hover {
    filter: brightness(1.06);
    box-shadow: 0 6px 20px rgba(var(--orange-rgb), 0.45);
}

.btn-outline-light {
    background: transparent;
    color: var(--white);
    border-color: var(--orange);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.08);
}

.btn-nav-cta,
.navbar-cta--desktop {
    padding: 10px 20px;
    border-radius: 10px;
}

.navbar-cta--desktop {
    flex-shrink: 0;
}

/* Un solo CTA de contacto: escritorio = botón a la derecha; móvil = botón dentro del menú */
.nav-item--cta {
    display: none;
    list-style: none;
}

@media (min-width: 993px) {
    .nav-item--cta {
        display: none !important;
    }

    .navbar-cta--desktop {
        display: inline-flex !important;
    }
}

@media (max-width: 992px) {
    .nav-toggle {
        display: flex;
    }

    .navbar-cta--desktop {
        display: none;
    }

    .nav-links {
        position: fixed;
        left: 0;
        right: 0;
        top: var(--header-height);
        flex-direction: column;
        align-items: stretch;
        padding: 20px 24px 28px;
        background: var(--navy-deep);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        gap: 0;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition: max-height 0.35s ease, opacity 0.25s ease, visibility 0.25s;
    }

    header.nav-open .nav-links {
        max-height: 420px;
        opacity: 1;
        visibility: visible;
    }

    .nav-links li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .nav-links a {
        display: block;
        padding: 14px 0;
        border-bottom: none;
    }

    .nav-links a.active {
        color: var(--orange);
    }

    .nav-item--cta {
        display: block;
        margin-top: 12px;
        border: 0;
    }

    .nav-item--cta .btn {
        width: 100%;
    }
}

/* --- Banda CTA: mismo bloque que main.css (index2.html) --- */
.section-cta-band {
    position: relative;
    min-height: var(--section-min-h);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(40px, 8vw, 72px) 0;
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    overflow: hidden;
}

.section-cta-band__bg {
    position: absolute;
    inset: 0;
    background: var(--grad-band);
    z-index: 0;
}

.section-cta-band__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 120% at 90% 20%, rgba(var(--orange-rgb), 0.22), transparent 50%),
        radial-gradient(ellipse 60% 80% at 5% 80%, rgba(255, 255, 255, 0.06), transparent 45%);
    pointer-events: none;
}

.cta-band-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 720px;
    margin-inline: auto;
}

.cta-band-tagline {
    font-size: clamp(1.2rem, 2.8vw, 1.55rem);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.cta-band-tagline span {
    color: var(--orange);
}

.cta-band-lead {
    font-size: 1.02rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.82);
    margin-bottom: 24px;
}

/* Botón como en main.css: píldora + gradiente (index4 .btn usa otro radio por defecto) */
.section-cta-band .btn.btn-orange.btn-cta-band {
    border-radius: 28px;
    padding: 14px 28px;
    border: none;
    background: linear-gradient(120deg, var(--orange) 0%, var(--orange-mid) 45%, var(--orange) 90%);
    background-size: 220% 100%;
    background-position: 0% 50%;
    color: var(--white);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background-position 0.55s ease;
}

.section-cta-band .btn.btn-orange.btn-cta-band:hover {
    filter: none;
    background-position: 100% 50%;
    transform: translateY(-2px);
    box-shadow: 0 12px 36px rgba(var(--orange-rgb), 0.45);
}

.section-cta-band .btn.btn-orange.btn-cta-band:active {
    transform: translateY(0);
}

@media (max-width: 992px) {
    .cta-band-tagline {
        letter-spacing: 0.04em;
    }

    .section-cta-band {
        min-height: unset;
        padding: 40px 0 44px;
    }
}

/* --- Hero v4 --- */
.hero-v4 {
    position: relative;
    min-height: min(92vh, 720px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    overflow: hidden;
}

.hero-v4__left {
    position: relative;
    background: var(--navy);
    color: var(--white);
    display: flex;
    align-items: center;
    padding: clamp(32px, 6vw, 80px) clamp(24px, 5vw, 64px) clamp(40px, 8vw, 100px);
    clip-path: polygon(0 0, 100% 0, 88% 100%, 0 100%);
}

.hero-v4__left-inner {
    max-width: 520px;
}

.hero-v4__left h1 {
    font-size: clamp(1.75rem, 3.8vw, 2.65rem);
    line-height: 1.15;
    margin: 0 0 16px;
    font-weight: 800;
}

.hero-v4__slogan {
    font-size: clamp(1rem, 2vw, 1.2rem);
    margin: 0 0 12px;
    color: rgba(255, 255, 255, 0.95);
}

.hero-v4__slogan .accent {
    color: var(--orange);
}

.hero-v4__lead {
    margin: 0 0 28px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.05rem;
    max-width: 46ch;
}

.hero-v4__ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.hero-v4__right {
    position: relative;
    background: var(--white);
    background-image: radial-gradient(rgba(11, 48, 96, 0.12) 1px, transparent 1px);
    background-size: 22px 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(28px, 5vw, 56px) clamp(20px, 4vw, 48px);
}

.hero-v4__img-wrap {
    position: relative;
    width: 100%;
    max-width: 560px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-card-featured);
}

.hero-v4__img-wrap img {
    width: 100%;
    height: auto;
    vertical-align: middle;
}

@media (max-width: 900px) {
    .hero-v4 {
        grid-template-columns: 1fr;
        min-height: unset;
    }

    .hero-v4__left {
        clip-path: none;
        padding-bottom: 40px;
    }

    .hero-v4__right {
        padding-bottom: 48px;
    }
}

/* --- Section common --- */
.section-label {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--orange);
    margin: 0 0 10px;
}

.section-head {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 48px;
}

.section-title {
    font-size: clamp(1.75rem, 3vw, 2.15rem);
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--navy);
}

.section-sub {
    margin: 0;
    color: var(--text-muted);
    font-size: 1.05rem;
}

/* --- Services --- */
.section-services-v4 {
    padding: clamp(64px, 10vw, 100px) 0;
    background: var(--white);
}

.services-grid-v4 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.services-grid-v4--extra {
    margin-top: 24px;
    grid-template-columns: 1fr;
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

.service-card-v4 {
    background: var(--white);
    border-radius: 16px;
    padding: 28px 22px 24px;
    box-shadow: var(--shadow-card);
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.service-card-v4:hover {
    border-color: var(--orange);
    box-shadow: var(--shadow-card-featured);
    transform: translateY(-3px);
}

.service-icon-v4 {
    width: 56px;
    height: 56px;
    color: var(--orange);
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transform-origin: center center;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.service-icon-v4 svg {
    width: 100%;
    height: 100%;
    display: block;
}

@media (prefers-reduced-motion: no-preference) {
    .service-icon-v4 {
        animation: icon-v4-soft-float 5s ease-in-out infinite;
    }

    .service-card-v4:nth-child(1) .service-icon-v4 {
        animation-delay: 0s;
    }

    .service-card-v4:nth-child(2) .service-icon-v4 {
        animation-delay: 0.35s;
    }

    .service-card-v4:nth-child(3) .service-icon-v4 {
        animation-delay: 0.7s;
    }

    .services-grid-v4--extra .service-icon-v4 {
        animation-delay: 0.2s;
    }

    .service-card-v4:hover .service-icon-v4 {
        animation: none;
        transform: translateY(-4px) scale(1.06);
    }
}

.service-card-v4 h3 {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0 0 12px;
    color: var(--navy);
    max-width: 22ch;
}

.service-card-v4 p {
    margin: 0 0 20px;
    flex: 1 1 auto;
    width: 100%;
    max-width: 38ch;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.6;
}

.service-card-v4__link {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--orange);
    align-self: center;
    flex-shrink: 0;
}

.service-card-v4__link:hover {
    text-decoration: underline;
}

@media (max-width: 992px) {
    .services-grid-v4 {
        grid-template-columns: 1fr;
    }

    .services-grid-v4--extra {
        max-width: none;
    }
}

/* --- About --- */
.section-about-v4 {
    padding: clamp(64px, 10vw, 100px) 0;
    background: var(--bg-soft);
}

.about-v4 {
    display: grid;
    grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
    gap: clamp(28px, 4.5vw, 48px);
    align-items: stretch;
}

/* Imagen a la altura del bloque de texto (evita hueco vacío bajo la foto) */
.about-v4__img {
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    min-height: 0;
    align-self: stretch;
}

.about-v4__img img {
    width: 100%;
    height: 100%;
    min-height: 260px;
    object-fit: cover;
    object-position: center;
}

.about-v4__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.about-v4__text .section-label {
    text-align: left;
}

.about-v4__text .section-title {
    text-align: left;
    margin-bottom: 16px;
}

.about-v4__intro {
    margin-bottom: 22px;
}

.about-v4__intro p {
    margin: 0 0 12px;
    color: var(--text-muted);
}

.about-v4__intro p:last-child {
    margin-bottom: 0;
}

.mv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(14px, 2vw, 22px);
    margin-top: 2px;
}

.mv-card {
    background: var(--white);
    border-radius: 14px;
    padding: 22px 20px 24px;
    border: 1px solid rgba(11, 48, 96, 0.08);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.mv-card__icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    color: var(--orange);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mv-card__icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

@media (prefers-reduced-motion: no-preference) {
    .mv-card__icon {
        animation: icon-v4-soft-float 5.5s ease-in-out infinite;
    }

    .mv-card:nth-child(1) .mv-card__icon {
        animation-delay: 0s;
    }

    .mv-card:nth-child(2) .mv-card__icon {
        animation-delay: 0.45s;
    }

    .mv-card:hover .mv-card__icon {
        animation: none;
        transform: translateY(-3px) scale(1.05);
    }
}

.mv-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin: 0 0 12px;
    color: var(--orange);
}

.mv-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.62;
}

@media (max-width: 900px) {
    .about-v4 {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .about-v4__img {
        max-height: 380px;
    }

    .about-v4__img img {
        height: auto;
        min-height: 200px;
        max-height: 380px;
        object-fit: cover;
    }

    .mv-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Values --- */
.section-values-v4 {
    padding: clamp(64px, 10vw, 96px) 0;
    background: var(--white);
}

.section-values-v4 .section-title {
    text-align: center;
    margin-bottom: 48px;
}

.values-grid-v4 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    text-align: center;
}

.value-item-v4__icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 18px;
    color: var(--orange);
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.value-item-v4__icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

@media (prefers-reduced-motion: no-preference) {
    .value-item-v4__icon {
        animation: icon-v4-soft-float 5s ease-in-out infinite;
    }

    .value-item-v4:nth-child(1) .value-item-v4__icon {
        animation-delay: 0s;
    }

    .value-item-v4:nth-child(2) .value-item-v4__icon {
        animation-delay: 0.3s;
    }

    .value-item-v4:nth-child(3) .value-item-v4__icon {
        animation-delay: 0.6s;
    }

    .value-item-v4:hover .value-item-v4__icon {
        animation: none;
        transform: translateY(-3px) scale(1.06);
    }
}

.value-item-v4 h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 12px;
    color: var(--navy);
}

.value-item-v4 p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.98rem;
    max-width: 34ch;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 768px) {
    .values-grid-v4 {
        grid-template-columns: 1fr;
    }
}

/* --- Footer v4 --- */
.footer-v4 {
    background: var(--navy);
    color: rgba(255, 255, 255, 0.9);
    padding: 56px 0 0;
}

.footer-v4__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(28px, 4vw, 40px);
    padding-bottom: 40px;
}

.footer-v4__brand .logo-img {
    height: 44px;
    width: auto;
    margin-bottom: 14px;
}

.footer-v4__brand p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
    max-width: 32ch;
}

.footer-v4 h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--white);
}

.footer-v4__links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-v4__links li {
    margin-bottom: 10px;
}

.footer-v4__links a {
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.95rem;
}

.footer-v4__links a:hover {
    color: var(--orange);
}

.footer-contact-v4 {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-contact-v4 li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.85);
}

.footer-contact-v4 .fi {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--orange);
    margin-top: 2px;
}

.footer-v4__social-title {
    margin-top: 22px;
    margin-bottom: 12px;
}

.footer-v4 .social-icons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-v4 .social-icons a {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.footer-v4 .social-icons a:hover {
    background: var(--orange);
    transform: translateY(-3px) scale(1.08);
}

.footer-v4 .social-icons svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    color: var(--white);
}

.footer-v4 .social-icons svg.icon-stroke {
    fill: none;
    stroke: currentColor;
}

.footer-v4 .social-icons svg.icon-stroke .ig-dot {
    fill: currentColor;
    stroke: none;
}

.footer-v4__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 20px 0 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.55);
}

.footer-v4__bottom a {
    color: rgba(255, 255, 255, 0.65);
    margin-left: 16px;
}

.footer-v4__bottom a:hover {
    color: var(--orange);
}

@media (max-width: 992px) {
    .footer-v4__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-v4__brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 560px) {
    .footer-v4__grid {
        grid-template-columns: 1fr;
    }

    .footer-v4__brand {
        grid-column: auto;
    }

    .footer-v4__bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-v4__bottom a {
        margin: 0 8px;
    }
}

/* Reveal on scroll */
.reveal-on-scroll .reveal-child {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal-on-scroll.is-inview .reveal-child {
    opacity: 1;
    transform: none;
}
