:root {
    --bg-top: #EAE6D8;
    /* Measured 0.922, 0.899, 0.852 */
    --bg-cards: #FCF5EF;
    /* Measured 0.991, 0.964, 0.940 */
    --bg-card-item: #FFFFFF;

    --text-blue: #1A2B3B;
    /* Measured 1715003 */
    --text-white: #FFFFFF;

    --line-orange: #D6A473;
    /* Measured 0.839, 0.643, 0.453 */
    --line-gray: #D0D7DA;
    /* Measured 0.814, 0.843, 0.855 */

    --font-serif: 'Marcellus', serif;
    /* Replace Marcellus */
    --font-sans: 'Inter', sans-serif;
    /* Replace SourceSans3 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-top);
    font-family: var(--font-sans);
    color: var(--text-blue);
    line-height: 1.2;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Base Wrapper for fluid width */
.page-wrapper {
    width: 100%;
    margin: 0 auto;
    background-color: var(--bg-top);
    position: relative;
    overflow: hidden;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    position: relative;
    padding: 0 5vw;
}

/* ----------- NAV ----------- */
.header {
    width: 100%;
    position: absolute;
    top: 35px;
    left: 0;
    z-index: 20;
    border-bottom: 2px solid #d3c4bc;
    padding: 10px 0;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 30px;
    font-size: 21px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-blue);
    font-weight: 400;
}

/* .logo { 
    Removed absolute positioning, now handled by flex in .header .container
    top: 17px; 
    left: 177px; 
    z-index: 20; 
} */

.logo img {
    height: 55px;
    width: auto;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 100;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--text-blue);
    border-radius: 3px;
    transition: 0.3s;
}

.hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Línea puntiaguda entre header y hero - prototipo */
.hero-pointed-line {
    position: absolute;
    top: 112px;
    left: 0;
    width: 100%;
    height: 10px;
    z-index: 18;
    background: url('../images/line_hero_pointed.svg') no-repeat center;
    background-size: 100% 100%;
}

/* ----------- HERO ----------- */
.hero {
    position: relative;
    width: 100%;

    height: 738px;
    /* Box adjusted for 75px gap */
    background-color: var(--bg-top);
}

.hero-bg-wrapper {
    position: absolute;
    left: 0;
    width: 100%;

    height: 637px;
    overflow: hidden;
    z-index: 1;
    top: 106px;
}

.hero-img-bg {
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(234, 230, 216, 0.4), rgba(234, 230, 216, 0.4)), url(../images/originales_seccion1.jpg);
    background-size: cover;
    background-position: center;
}

/* Capa overlay desactivada — el prototipo muestra texto oscuro sobre fondo claro */
.hero-overlay {
    display: none;
}

.hero-content {
    position: absolute;
    top: 230px;
    right: 8vw;
    padding-right: 2vw;
    padding-left: 2vw;
    max-width: 780px;
    z-index: 2;
    text-align: left;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.hero-content h1 {
    font-family: var(--font-serif);
    font-size: clamp(34px, 4.2vw, 56px);
    font-weight: 700;
    margin-bottom: 18px;
    line-height: 1.1;
    color: var(--text-blue);
}

.hero-content h2 {
    font-family: var(--font-sans);
    font-size: clamp(22px, 2.8vw, 32px);
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 16px;
    color: var(--text-blue);
    padding-left: 90px;
}

/* Línea decorativa tipo pleca con degradado suave */
.hero-divider-line {
    width: calc(100% - 90px);
    height: 6px;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.5) 15%, rgba(255, 255, 255, 1) 50%, rgba(255, 255, 255, 0.5) 85%, rgba(255, 255, 255, 0) 100%);
    clip-path: polygon(0 50%, 50% 0, 100% 50%, 50% 100%);
    margin: 18px 0 26px 90px;
}

.hero-content p {
    font-family: var(--font-sans);
    font-size: clamp(14px, 1.5vw, 21px);
    line-height: 1.55;
    color: #3a4a5a;
    font-weight: 700;
    padding-left: 90px;
}

/* ----------- FINANCIERA ----------- */
.financiera {
    position: relative;
    width: 100%;
    height: 587px;
    /* 1200 - 613 = 587 */
    background-color: var(--bg-top);
    z-index: 2;
    overflow: visible;
}

/* Curva inferior SVG: transición financiera → cards (prototipo pixel-perfect) */
.financiera::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: 0;
    width: 100%;
    height: 80px;
    background: url('../images/wave_financiera_bottom.svg') no-repeat center;
    background-size: 100% 100%;
    z-index: 5;
}

.financiera-bg {
    position: absolute;
    top: -167px;
    left: 0;
    width: 100%;
    height: 802px;
    background-image:
        linear-gradient(to right, var(--bg-top) 25%, transparent 65%),
        url('../images/originales_seccion2.jpg');
    background-size: cover;
    background-position: right top;
    z-index: 1;
}

.financiera-content {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1440px;
    padding: 0 5vw;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    top: -90px;
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(28px, 3vw, 36px);
    font-weight: 400;
    text-align: center;
}

.title-line {
    width: min(670px, 90vw);
    height: 6.5px;
    background-image: url('../images/line_financiera.svg');
    background-size: 100% 100%;
    border: none;
    background-color: transparent;
    margin-top: 13px;
    margin-bottom: 85px;
    margin-left: auto;
    margin-right: auto;
}

/* Left align via grid inside container max width instead of absolute negative margin */
.financiera-text-wrapper {
    width: 100%;
    max-width: 1440px;
    padding: 0 5vw;
    display: flex;
    justify-content: flex-start;
}

.financiera-text {
    width: 100%;
    max-width: 500px;
    text-align: left;
    align-self: flex-start;
}

.financiera-text p {
    font-size: clamp(16px, 2vw, 21px);
    line-height: 1.7;
    margin-bottom: 40px;
}

/* ----------- POR QUE MELQUI ----------- */
.por-que-melqui {
    position: relative;
    width: 100%;
    background-color: var(--bg-cards);
    padding: 45px 5vw 120px;
    z-index: 6;
    overflow: visible;

}

/* Curva superior SVG: transición financiera → cards (prototipo pixel-perfect) */
.por-que-melqui::before {
    content: '';
    position: absolute;
    top: -50px;
    left: 0;
    width: 100%;
    height: 80px;
    background: url('../images/wave_cards_top.svg') no-repeat center;
    background-size: 100% 100%;
    z-index: 1;
}

.center-title {
    font-family: var(--font-serif);
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 400;
    text-align: center;
}

.center-title-line {
    width: min(476.3px, 90vw);
    height: 6.3px;
    background-image: url('../images/line_por_que.svg');
    background-size: 100% 100%;
    border: none;
    background-color: transparent;
    margin: 23px auto 36px auto;
}

.cards-grid {
    width: 100%;
    max-width: 1440px;
    margin: 50px auto 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 40px;
}

.card {
    background-color: var(--bg-card-item);
    width: 100%;
    max-width: 373px;
    border-radius: 18px;
    padding: 40px 28px 36px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.07);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.card:hover {
    box-shadow: 0 20px 56px rgba(0, 0, 0, 0.18);
    background-color: rgba(255, 255, 255, 0.92);
}

.card-icon {
    width: 85px;
    height: 85px;
    margin-bottom: 20px;
}

.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card h3 {
    font-family: var(--font-sans);
    font-size: clamp(18px, 1.6vw, 22px);
    font-weight: 500;
}

.card-line {
    height: 6.5px;
    background-size: 100% 100%;
    border: none;
    background-color: transparent;
    margin-top: 10px;
    margin-bottom: 15px;
}

/* Set specific line widths based on PDF metrics */
.card:nth-child(1) .card-line {
    width: min(209.7px, 70%);
    background-image: url('../images/line_card1.svg');
}

.card:nth-child(2) .card-line {
    width: min(230.9px, 80%);
    background-image: url('../images/line_card2.svg');
}

.card:nth-child(3) .card-line {
    width: min(154.9px, 60%);
    background-image: url('../images/line_card3.svg');
}

.card p {
    font-size: clamp(13px, 1.15vw, 16px);
    line-height: 1.35;
}

/* ----------- LO QUE REPRESENTA ----------- */
.lo-que-representa {
    position: relative;
    width: 100%;
    background: linear-gradient(to right, #0083B5, #1A2B3B);
    text-align: center;
    color: var(--text-white);
    padding: 60px 5vw 50px;
    z-index: 5;
    overflow: visible;
}

/* Curva superior con gradiente: transición suave cards → azul (prototipo) */
.lo-que-representa::before {
    content: '';
    position: absolute;
    top: -80px;
    left: 0;
    width: 100%;
    height: 120px;

    clip-path: ellipse(75% 100% at 50% 100%);
    z-index: 1;
}

/* Curva inferior SVG: transición azul → footer */
.lo-que-representa::after {
    content: '';
    position: absolute;
    bottom: -50px;
    left: 0;
    width: 100%;
    height: 80px;
    background: url('../images/wave_blue_bottom.svg') no-repeat center;
    background-size: 100% 100%;
    z-index: 10;
}

.lo-que-representa h2 {
    font-size: clamp(28px, 4vw, 36px);
    font-family: var(--font-serif);
    font-weight: 400;
}

.white-line {
    width: min(549px, 90vw);
    height: 6.8px;
    background-image: url('../images/line_representa.svg');
    background-size: 100% 100%;
    border: none;
    background-color: transparent;
    margin: 24px auto 36px;
}

.representa-text {
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
}

.representa-text p {
    font-size: clamp(15px, 1.8vw, 20px);
    line-height: 1.25;
    margin-bottom: 30px;
}

.slogan-text {
    font-family: var(--font-sans);
    font-size: clamp(10px, 1vw, 12px);
    color: #ffffff;
    letter-spacing: 1.2px;
    margin: 8px 0 0;
    padding: 5px 14px;
    background-color: #0a1628;
    border-radius: 3px;
    display: block;
    width: fit-content;
    font-weight: 400;
}

.footer-logo {
    margin-top: 32px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: transparent !important;
}

.footer-logo img,
.footer-logo svg {
    height: clamp(36px, 5vw, 135px);
    width: auto;
    object-fit: contain;
    background-color: transparent !important;
}

.footer {
    width: 100%;
    background-color: #FFFFFF;
    color: var(--text-blue);
    padding: 30px 5vw 40px;
    font-size: clamp(12px, 1.2vw, 16px);
    text-align: center;
    margin-top: 0;
    position: relative;
    z-index: 6;
    overflow: visible;
}

/* Botón subir */
.btn-subir {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background-color: var(--text-blue);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s, visibility 0.3s, background-color 0.2s;
}

.btn-subir.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.btn-subir:hover {
    background-color: #026B9C;
}

/* Br solo en desktop - móvil: texto fluido */
.br-desktop {
    display: inline;
}

/* ----------- RESPONSIVE / MOBILE ----------- */
@media (max-width: 768px) {
    .br-desktop {
        display: none;
    }

    .header {
        position: relative;
        top: 0;
        border-bottom: none;
        padding: 14px 0;
        background-color: var(--bg-top);
    }

    .hamburger {
        display: flex;
    }

    .main-nav {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--bg-top);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.3s;
        z-index: 99;
    }

    .main-nav.active {
        left: 0;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 40px;
        font-size: 28px;
    }

    .separator {
        display: none;
    }

    .container {
        padding: 0 5vw;
    }

    .logo img {
        height: 45px;
    }

    .hero-pointed-line {
        display: none;
    }

    .hero {
        height: 520px;
        position: relative;
        overflow: hidden;
    }

    .hero-bg-wrapper {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
        clip-path: ellipse(130% 100% at 50% 0%);

        mask-image: none;
        -webkit-mask-image: none;
    }

    .hero-content {
        position: absolute;
        top: 140px;
        left: 0;
        right: 0;
        padding: 0 6vw;
        text-align: center;
        z-index: 10;
        overflow-wrap: break-word;
        word-wrap: break-word;
        hyphens: auto;
    }

    .hero-content h1,
    .hero-content h2,
    .hero-content p {
        max-width: 100%;
        overflow-wrap: break-word;
        word-wrap: break-word;
    }

    .hero-content h1 {
        font-size: 24px;
        margin-bottom: 12px;
        line-height: 1.25;
    }

    .hero-content .white-line {
        margin: 0 auto 14px;
    }

    .hero-content h2 {
        font-size: 15px;
        line-height: 1.4;
        margin-bottom: 12px;
    }

    .hero-content p {
        font-size: 14px;
        line-height: 1.5;
    }

    .hero-img-bg {
        background-image: linear-gradient(to bottom, rgba(234, 230, 216, 0.85) 0%, rgba(234, 230, 216, 0.75) 35%, rgba(234, 230, 216, 0.5) 100%), url(../images/originales_seccion1.jpg);
        background-position: center center;
    }

    .hero-content h2,
    .hero-content p {
        padding-left: 0;
    }

    .hero-divider-line {
        width: 80%;
        margin: 10px auto 16px;
    }

    /* Financiera móvil */
    .financiera {
        height: auto;
        padding: 40px 5vw 80px;
    }

    .financiera-content {
        position: relative;
        top: 0;
        left: 0;
        transform: none;
        padding: 0;

    }

    .financiera-bg {
        top: 0;
        height: 100%;
        background-position: center top;
        background-image:
            linear-gradient(to bottom, var(--bg-top) 15%, rgba(234, 230, 216, 0.85) 50%, transparent 100%),
            url('../images/originales_seccion2.jpg');
    }

    .section-title {
        font-size: 26px;
        line-height: 1.3;
        margin-bottom: 0;
    }

    .title-line {
        margin-top: 12px;
        margin-bottom: 32px;
    }

    .financiera-text {
        margin-left: 0;
        text-align: center;
        align-self: center;
        max-width: 100%;
    }

    .financiera-text p {
        font-size: 16px;
        line-height: 1.6;
        margin-bottom: 24px;
    }

    /* Por qué Melqui móvil */
    .por-que-melqui {
        padding: 50px 6vw 60px;
    }

    .center-title {
        font-size: 24px;
        line-height: 1.3;
    }

    .center-title-line {
        margin: 16px auto 28px;
    }

    .cards-grid {
        gap: 32px;
        margin-top: 0;
    }

    .card {
        padding: 32px 24px 28px;
        border-radius: 28px;
        max-width: 100%;
    }

    .card-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 20px;
    }

    .card h3 {
        font-size: 20px;
    }

    .card p {
        font-size: 15px;
        line-height: 1.5;
    }

    /* Lo que representa móvil */
    .lo-que-representa {
        padding: 40px 6vw 40px;
    }

    .lo-que-representa h2 {
        font-size: 24px;
        line-height: 1.3;
    }

    .white-line {
        margin: 16px auto 24px;
    }

    .representa-text p {
        font-size: 16px;
        line-height: 1.55;
        margin-bottom: 20px;
    }

    .slogan-text {
        font-size: 9px;
        margin-top: 6px;
        padding: 4px 12px;
    }

    .footer-logo {
        margin-top: 24px;
        margin-bottom: 8px;
    }

    .footer-logo img,
    .footer-logo svg {
        height: 40px;
    }

    .footer {
        padding: 24px 6vw 32px;
        font-size: 13px;
        line-height: 1.5;
        margin-top: 0;
    }

    .footer p {
        max-width: 100%;
        word-wrap: break-word;
    }
}

/* Móvil muy pequeño */
@media (max-width: 480px) {
    .container {
        padding: 0 5vw;
    }

    .hero-content {
        padding: 0 7vw 20px;
    }

    .hero-content h1 {
        font-size: 22px;
    }

    .hero-content h2 {
        font-size: 14px;
    }

    .section-title {
        font-size: 24px;
    }

    .center-title {
        font-size: 22px;
    }

    .lo-que-representa h2 {
        font-size: 22px;
    }

    .card {
        padding: 28px 20px 24px;
    }

    .footer {
        font-size: 13px;
    }
}