/*
=========================================================
RESULTADOS ECOVIDA
Encabezado Público
Archivo: assets/css/header-publico.css
=========================================================
*/


/* =====================================================
   CONTENEDOR GENERAL
===================================================== */

.eco-public-header {
    width: 100%;
    position: relative;
    z-index: 1000;
    font-family: "Poppins", sans-serif;
}


/* =====================================================
   CINTA SUPERIOR ANIMADA
===================================================== */

.eco-topbar {
    width: 100%;
    max-width: 100%;
    overflow: hidden;

    background: linear-gradient(
        90deg,
        #063f5c 0%,
        #006f83 50%,
        #063f5c 100%
    );

    color: #ffffff;

    position: relative;
    box-sizing: border-box;
}


/* Brillo suave */

.eco-topbar::after {
    content: "";
    position: absolute;
    inset: 0;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.06),
        transparent
    );

    pointer-events: none;
}


/* Pista que se mueve */

.eco-topbar-track {
    display: flex;
    align-items: center;

    width: max-content;

    will-change: transform;

    animation:
        ecoTickerPublico 35s linear infinite;
}


/* Cada grupo repetido */

.eco-topbar-group {
    display: flex;
    align-items: center;

    flex-shrink: 0;

    white-space: nowrap;

    padding: 0 30px;
}


/* Cada mensaje */

.eco-topbar-item {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    padding: 7px 22px;

    font-size: 11px;
    line-height: 1.4;

    font-weight: 500;

    letter-spacing: 0.1px;
}


/* Iconos */

.eco-icon {
    font-size: 12px;
    line-height: 1;
}


/* Puntos verdes */

.eco-divider {
    width: 4px;
    height: 4px;

    flex: 0 0 4px;

    background: #58c934;

    border-radius: 50%;

    box-shadow:
        0 0 6px rgba(88, 201, 52, 0.7),
        0 0 10px rgba(88, 201, 52, 0.35);
}


/* Pausa al colocar el mouse */

.eco-topbar:hover .eco-topbar-track {
    animation-play-state: paused;
}


/* Movimiento continuo */

@keyframes ecoTickerPublico {

    from {
        transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(-50%, 0, 0);
    }

}


/* =====================================================
   MENÚ PRINCIPAL
===================================================== */

.eco-navbar {
    width: 100%;

    background: rgba(255, 255, 255, 0.98);

    border-bottom:
        1px solid rgba(7, 104, 133, 0.08);

    box-shadow:
        0 8px 30px rgba(8, 58, 78, 0.08);

    position: relative;

    z-index: 1001;
}


/* Contenido interno */

.eco-navbar-contenedor {
    width: 90%;
    max-width: 1280px;

    min-height: 88px;

    padding: 12px 0;

    margin: 0 auto;

    display: flex;
    align-items: center;
}


/* =====================================================
   LOGO
===================================================== */

.eco-navbar-logo {
    display: flex;
    align-items: center;

    text-decoration: none;

    flex: 0 0 auto;
}


.eco-navbar-logo img {
    display: block;

    width: 185px;
    max-width: 100%;

    height: auto;

    transition:
        transform 0.3s ease;
}


.eco-navbar-logo:hover img {
    transform: scale(1.03);
}


/* =====================================================
   MENÚ DE NAVEGACIÓN
===================================================== */

.eco-navbar-menu {
    margin-left: auto;

    display: flex;
    align-items: center;

    gap: 28px;
}


.eco-navbar-link {
    position: relative;

    display: inline-flex;
    align-items: center;

    padding: 12px 8px;

    color: #0b3954;

    text-decoration: none;

    font-family: "Poppins", sans-serif;

    font-size: 14px;
    font-weight: 600;

    line-height: 1.3;

    transition:
        color 0.25s ease,
        transform 0.25s ease;
}


/* Línea inferior animada */

.eco-navbar-link::after {
    content: "";

    position: absolute;

    left: 50%;
    bottom: 4px;

    width: 0;
    height: 2px;

    background:
        linear-gradient(
            90deg,
            #0799b6,
            #42b72a
        );

    border-radius: 10px;

    transform:
        translateX(-50%);

    transition:
        width 0.25s ease;
}


/* Hover */

.eco-navbar-link:hover {
    color: #169447;
}


/* Enlace activo */

.eco-navbar-link-activo {
    color: #169447;
}


.eco-navbar-link:hover::after,
.eco-navbar-link-activo::after {
    width: 75%;
}


/* =====================================================
   BOTÓN HAMBURGUESA
===================================================== */

.eco-menu-toggle {
    display: none;

    width: 44px;
    height: 44px;

    padding: 9px;

    margin-left: auto;

    border: 0;

    border-radius: 12px;

    background:
        rgba(7, 153, 182, 0.08);

    cursor: pointer;

    align-items: center;
    justify-content: center;

    flex-direction: column;

    gap: 5px;

    transition:
        background 0.25s ease,
        transform 0.25s ease;
}


.eco-menu-toggle:hover {
    background:
        rgba(7, 153, 182, 0.14);

    transform: translateY(-1px);
}


.eco-menu-toggle span {
    display: block;

    width: 23px;
    height: 2px;

    background: #098aa5;

    border-radius: 10px;

    transition:
        transform 0.3s ease,
        opacity 0.3s ease;
}


/* Estado abierto */

.eco-menu-toggle.activo span:nth-child(1) {
    transform:
        translateY(7px)
        rotate(45deg);
}


.eco-menu-toggle.activo span:nth-child(2) {
    opacity: 0;
}


.eco-menu-toggle.activo span:nth-child(3) {
    transform:
        translateY(-7px)
        rotate(-45deg);
}


/* =====================================================
   TABLET
===================================================== */

@media (max-width: 980px) {

    /* Cinta */

    .eco-topbar-track {
        animation-duration: 30s;
    }


    .eco-topbar-group {
        padding: 0 20px;
    }


    .eco-topbar-item {
        padding: 7px 18px;

        font-size: 11px;
    }


    /* Menú */

    .eco-navbar-contenedor {
        width: 92%;

        min-height: 74px;

        padding: 8px 0;

        position: relative;
    }


    .eco-navbar-logo img {
        width: 155px;
    }


    /* Mostrar hamburguesa */

    .eco-menu-toggle {
        display: flex;
    }


    /* Menú desplegable */

    .eco-navbar-menu {
        position: absolute;

        top: calc(100% + 8px);
        left: 0;
        right: 0;

        width: 100%;

        margin: 0;

        padding: 12px;

        display: flex;
        flex-direction: column;
        align-items: stretch;

        gap: 0;

        background: #ffffff;

        border-top:
            3px solid #21ae5b;

        border-radius: 14px;

        box-shadow:
            0 18px 40px
            rgba(8, 58, 78, 0.18);

        opacity: 0;

        visibility: hidden;

        pointer-events: none;

        transform:
            translateY(-10px);

        transition:
            opacity 0.25s ease,
            transform 0.25s ease,
            visibility 0.25s ease;
    }


    /* Menú abierto */

    .eco-navbar-menu.activo {
        opacity: 1;

        visibility: visible;

        pointer-events: auto;

        transform:
            translateY(0);
    }


    .eco-navbar-link {
        width: 100%;

        padding: 13px 14px;

        font-size: 15px;

        border-bottom:
            1px solid
            rgba(7, 104, 133, 0.08);
    }


    .eco-navbar-link:last-child {
        border-bottom: 0;
    }


    /* Quitamos línea inferior en móvil */

    .eco-navbar-link::after {
        display: none;
    }


    .eco-navbar-link:hover,
    .eco-navbar-link-activo {
        color: #169447;

        background:
            rgba(33, 174, 91, 0.07);

        border-radius: 9px;
    }

}


/* =====================================================
   MÓVIL
===================================================== */

@media (max-width: 767px) {

    /* Cinta */

    .eco-topbar-track {
        animation-duration: 25s;
    }


    .eco-topbar-group {
        padding: 0 12px;
    }


    .eco-topbar-item {
        padding: 7px 14px;

        font-size: 10px;
    }


    .eco-icon {
        font-size: 11px;
    }


    /* Encabezado */

    .eco-navbar-contenedor {
        width: 94%;

        min-height: 68px;

        padding: 7px 0;
    }


    .eco-navbar-logo img {
        width: 135px;
    }


    .eco-menu-toggle {
        width: 42px;
        height: 42px;
    }

}


/* =====================================================
   MÓVILES PEQUEÑOS
===================================================== */

@media (max-width: 420px) {

    .eco-navbar-logo img {
        width: 125px;
    }


    .eco-menu-toggle {
        width: 40px;
        height: 40px;
    }


    .eco-menu-toggle span {
        width: 21px;
    }

}


/* =====================================================
   ACCESIBILIDAD
===================================================== */

@media (prefers-reduced-motion: reduce) {

    .eco-topbar-track {
        animation: none;
    }


    .eco-navbar-logo img,
    .eco-navbar-link,
    .eco-menu-toggle,
    .eco-menu-toggle span,
    .eco-navbar-menu {
        transition: none;
    }

}