
/* =====================================================
   VARIABLES
===================================================== */
:root {
    --azul-cecopi: #C9A227;      /* mostaza principal */
    --azul-oscuro: #A8871F;      /* mostaza oscuro */
    --azul-claro: #D4A84B;       /* mostaza claro */
    --amarillo-cecopi: #123B70;  /* azul */
    --rojo-cecopi: #D10D16;
    --blanco: #FFFFFF;
    --gris-claro: #EDEFF2;       /* fondo plomo bajo */
    --gris-medio: #E2E5EA;
    --gris: #6B7280;
    --negro: #18202A;
}

/* =====================================================
   RESET Y BASE
===================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--negro);
    background: var(--gris-claro);
    overflow-x: hidden;
    line-height: 1.6;
}

img { max-width: 100%; height: auto; }

section { background: transparent; }

/* =====================================================
   ANIMACIONES GLOBALES
===================================================== */
@keyframes flotar {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

@keyframes latido {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.08); }
}

@keyframes girarSuave {
    0%   { transform: rotate(-4deg) scale(1); }
    50%  { transform: rotate(4deg) scale(1.05); }
    100% { transform: rotate(-4deg) scale(1); }
}

@keyframes girarLogo {
    0%   { transform: rotateY(0deg); }
    50%  { transform: rotateY(180deg); }
    100% { transform: rotateY(360deg); }
}

@keyframes aparecer {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes brillar {
    0%, 100% { box-shadow: 0 0 0 rgba(201,162,39,0); }
    50%      { box-shadow: 0 0 25px rgba(201,162,39,.6); }
}

/* =====================================================
   TOPBAR
===================================================== */
.topbar {
    background: var(--azul-oscuro);
    color: #fff;
    padding: 9px 0;
    font-size: 13px;
}

.topbar a {
    color: #fff;
    text-decoration: none;
    margin-left: 14px;
    transition: color .3s, transform .3s;
    display: inline-block;
}

.topbar a:hover {
    color: var(--amarillo-cecopi);
    transform: translateY(-2px) scale(1.15);
}

.topbar-right { display: flex; align-items: center; gap: 5px; }

.topbar-divider {
    width: 1px;
    height: 16px;
    background: rgba(255,255,255,.3);
    margin: 0 10px;
}

.topbar .login-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    margin-left: 0;
}

.topbar .login-link:hover {
    background: var(--amarillo-cecopi);
    transform: translateY(-2px);
}

/* =====================================================
   HEADER
===================================================== */
.header-principal {
    background: #DCDCDA;
    padding: 10px 0;
    border-bottom: 1px solid #e8e8e8;
}

.logos-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

/* LOGO CECOPI — gira y flota */
.logo-cecopi {
    width: 260px;
    height: 100px;
    object-fit: contain;
    object-position: left center;
    display: block;
    animation: girarSuave 6s ease-in-out infinite;
    transform-origin: center;
    transition: filter .3s;
}

.logo-cecopi:hover {
    animation: girarLogo 2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(201,162,39,.7));
}

.slogan-header {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 10px;
}

.slogan-header p {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 26px;
    color: #222;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .3s, transform .3s;
    animation: flotar 5s ease-in-out infinite;
}

.slogan-header p:hover { color: var(--amarillo-cecopi); transform: scale(1.05); }

.slogan-line {
    width: 90px;
    height: 4px;
    background: var(--amarillo-cecopi);
    margin: 8px auto 0;
    border-radius: 10px;
    transition: width .3s, background .3s;
}

.slogan-header:hover .slogan-line { width: 140px; background: var(--rojo-cecopi); }

.logo-radio {
    flex: 0 0 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
}

/* LOGO RADIO — gira y flota */
.logo-atipiri {
    width: 190px;
    height: 95px;
    object-fit: contain;
    display: block;
    animation: girarSuave 6s ease-in-out infinite reverse;
    transform-origin: center;
    transition: filter .3s;
}

.logo-atipiri:hover {
    animation: girarLogo 2s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(209,13,22,.7));
}

/* =====================================================
   NAVBAR
===================================================== */
.navbar-cecopi {
    background: var(--azul-cecopi);
    padding: 0;
}

.navbar-cecopi .navbar-nav { margin: auto; }

.navbar-cecopi .nav-link {
    color: black; !important;
    font-size: 15px;
    font-weight: 600;
    padding: 17px 15px !important;
    text-transform: uppercase;
    transition: background .3s, color .3s, letter-spacing .3s;
    position: relative;
}

.navbar-cecopi .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background: var(--amarillo-cecopi);
    transition: width .3s;
    transform: translateX(-50%);
}

.navbar-cecopi .nav-link:hover::after { width: 80%; }

.navbar-cecopi .nav-link:hover {
    background: var(--amarillo-cecopi);
    color: #fff !important;
    letter-spacing: .5px;
}

.navbar-toggler { border-color: rgba(255,255,255,.5); }
.navbar-toggler-icon { filter: brightness(0) invert(1); }

/* =====================================================
   SUBMENÚ PUBLICACIONES (DROPDOWN)
===================================================== */
.navbar-cecopi .dropdown-menu-cecopi {
    background: var(--azul-cecopi);
    border: none;
    border-radius: 0;
    margin-top: 0;
    padding: 0;
    min-width: 220px;
    box-shadow: 0 4px 10px rgba(0,0,0,.2);
}

.navbar-cecopi .dropdown-menu-cecopi .dropdown-item {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    padding: 12px 20px;
    transition: background .3s, color .3s, padding-left .3s;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.navbar-cecopi .dropdown-menu-cecopi .dropdown-item:hover,
.navbar-cecopi .dropdown-menu-cecopi .dropdown-item:focus {
    background: var(--amarillo-cecopi);
    color: #fff;
    padding-left: 28px;
}

.navbar-cecopi .dropdown-menu-cecopi .dropdown-divider {
    border-color: rgba(255,255,255,.15);
    margin: 0;
}

/* Indicador (flecha) del dropdown */
.navbar-cecopi .dropdown-toggle::after {
    margin-left: 6px;
    vertical-align: 2px;
}

/* Ajuste responsive: en móvil el submenú se vea dentro del flujo */
@media (max-width: 991.98px) {
    .navbar-cecopi .dropdown-menu-cecopi {
        background: rgba(0,0,0,.15);
        box-shadow: none;
        padding-left: 15px;
    }
    
    .navbar-cecopi .dropdown-menu-cecopi .dropdown-item {
        font-size: 12px;
        padding: 10px 20px;
    }
}

/* =====================================================
   CARRUSEL — CAMBIO RÁPIDO HACIA LA IZQUIERDA
===================================================== */
.hero-carousel { position: relative; overflow: hidden; }

.carousel-item {
    height: 610px;
    position: relative;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(.65);
}

/* Animación de zoom de imagen solo cuando está activo */
.carousel-item.active img { animation: zoomImagen 6s ease-in-out forwards; }

@keyframes zoomImagen {
    from { transform: scale(1); }
    to   { transform: scale(1.08); }
}

/* Transición rápida tipo slide hacia la izquierda */
#carouselCecopi .carousel-item {
    transition: transform .45s ease-in-out !important;
}

.carousel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
        rgba(9,42,80,.90),
        rgba(9,42,80,.35),
        rgba(9,42,80,.15));
}

.carousel-caption-custom {
    position: absolute;
    top: 50%;
    left: 9%;
    transform: translateY(-50%);
    max-width: 650px;
    color: #fff;
    z-index: 5;
    animation: aparecer .8s ease-out;
}

.carousel-caption-custom small {
    display: inline-block;
    background: var(--amarillo-cecopi);
    color: #fff;
    font-weight: 800;
    padding: 8px 15px;
    border-radius: 4px;
    margin-bottom: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: latido 3s ease-in-out infinite;
}

.carousel-caption-custom h1 {
    font-size: 55px;
    font-weight: 800;
    line-height: 1.08;
    margin-bottom: 20px;
    animation: aparecer 1s ease-out;
}

.carousel-caption-custom p {
    font-size: 18px;
    line-height: 1.7;
    max-width: 600px;
    animation: aparecer 1.2s ease-out;
}

.btn-cecopi {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--amarillo-cecopi);
    color: #fff;
    border: none;
    padding: 13px 25px;
    border-radius: 5px;
    font-weight: 700;
    text-decoration: none;
    transition: transform .3s, background .3s, box-shadow .3s;
    margin-top: 12px;
    animation: brillar 3s ease-in-out infinite;
}

.btn-cecopi:hover {
    background: #fff;
    color: var(--amarillo-cecopi);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0,0,0,.2);
}

.carousel-indicators button {
    width: 35px !important;
    height: 4px !important;
    border: none !important;
    border-radius: 10px;
    transition: width .3s, background .3s;
}

.carousel-indicators .active {
    background: var(--amarillo-cecopi);
    width: 50px !important;
}

/* =====================================================
   SECCIONES Y TÍTULOS
===================================================== */
section { padding: 90px 0; position: relative; }

.section-title { text-align: center; margin-bottom: 55px; }

.section-title .mini-title {
    color: var(--rojo-cecopi);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
    transition: letter-spacing .3s, color .3s;
    animation: aparecer .6s ease-out;
}

.section-title .mini-title:hover {
    letter-spacing: 4px;
    color: var(--azul-cecopi);
}

.section-title h2 {
    color: var(--amarillo-cecopi);
    font-size: 38px;
    font-weight: 800;
    margin-bottom: 15px;
    animation: aparecer .8s ease-out;
}

.section-title .line {
    width: 65px;
    height: 4px;
    background: var(--amarillo-cecopi);
    margin: auto;
    border-radius: 10px;
    transition: width .5s, background .5s;
}

.section-title:hover .line { width: 120px; background: var(--rojo-cecopi); }

.section-title p {
    color: var(--gris);
    max-width: 750px;
    margin: 20px auto 0;
    line-height: 1.8;
}

/* =====================================================
   TARJETAS GENÉRICAS
===================================================== */
.card-cecopi {
    height: 100%;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 10px 35px rgba(15,45,75,.08);
    transition: transform .4s, box-shadow .4s;
}

.card-cecopi:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 45px rgba(15,45,75,.18);
}

.card-icon {
    width: 75px;
    height: 75px;
    background: rgba(201,162,39,.15);
    color: var(--azul-cecopi);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 20px;
    transition: background .3s, color .3s, transform .6s;
}

.card-cecopi:hover .card-icon {
    background: var(--azul-cecopi);
    color: #fff;
    transform: rotate(360deg) scale(1.1);
}

.card-cecopi .card-body { padding: 30px; }

.card-cecopi h4 {
    color: var(--amarillo-cecopi);
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 14px;
    transition: color .3s;
}

.card-cecopi:hover h4 { color: var(--azul-cecopi); }

.card-cecopi p { color: var(--gris); margin: 0; }

/* =====================================================
   PROYECTOS
===================================================== */
.proyectos { background: var(--gris-medio); }

.proyecto-card {
    position: relative;
    min-height: 270px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--azul-cecopi);
    color: #fff;
    padding: 35px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    transition: transform .4s, box-shadow .4s;
}

.proyecto-card:hover {
    transform: translateY(-8px) rotate(-1deg);
    box-shadow: 0 20px 50px rgba(201,162,39,.4);
}

.proyecto-card i {
    position: absolute;
    right: 25px;
    top: 20px;
    font-size: 55px;
    color: #fff;
    animation: flotar 4s ease-in-out infinite;
    transition: color .3s, transform .3s;
}

.proyecto-card:hover i {
    color: #123B70;
    transform: scale(1.2) rotate(10deg);
}

.proyecto-card h4 { font-size: 22px; font-weight: 800; position: relative; color: #123B70 }
.proyecto-card p  { color: rgba(255,255,255,.85); position: relative; }

.proyecto-card::before {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 5px;
    background: var(--amarillo-cecopi);
    transition: height .4s, background .4s;
}

.proyecto-card:hover::before { height: 8px; background: #fff; }

/* =====================================================
   POBLACIÓN
===================================================== */
.poblacion { background: var(--gris-claro); }

.poblacion-card {
    text-align: center;
    background: #fff;
    border-radius: 12px;
    padding: 35px 20px;
    height: 100%;
    box-shadow: 0 8px 25px rgba(0,0,0,.05);
    transition: transform .3s, box-shadow .3s;
}

.poblacion-card:hover {
    transform: translateY(-7px) scale(1.03);
    box-shadow: 0 15px 40px rgba(0,0,0,.12);
}

.poblacion-card i {
    font-size: 45px;
    color: var(--azul-cecopi);
    margin-bottom: 20px;
    animation: latido 3s ease-in-out infinite;
    display: inline-block;
    transition: color .3s, transform .3s;
}

.poblacion-card:hover i { color: var(--rojo-cecopi); transform: scale(1.2); }

.poblacion-card h4 {
    font-size: 18px;
    font-weight: 800;
    color: var(--amarillo-cecopi);
    transition: color .3s;
}

.poblacion-card:hover h4 { color: var(--azul-cecopi); }

/* =====================================================
   RADIO
===================================================== */
.radio-section {
    background: linear-gradient(135deg, var(--azul-oscuro), var(--azul-cecopi));
    color: #fff;
    position: relative;
    overflow: hidden;
}

.radio-section::after {
    content: "";
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: rgba(18,59,112,.08);
    right: -150px;
    top: -150px;
    animation: flotar 8s ease-in-out infinite;
}

.radio-content { position: relative; z-index: 2; }

.radio-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--rojo-cecopi);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 45px;
    margin-bottom: 25px;
    box-shadow: 0 15px 35px rgba(0,0,0,.25);
    transition: transform .4s;
    animation: latido 2.5s ease-in-out infinite;
}

.radio-icon:hover { transform: scale(1.15) rotate(15deg); }

.radio-content h2 { font-size: 42px; font-weight: 800; }

.radio-content p {
    color: rgba(255,255,255,.85);
    line-height: 1.8;
    max-width: 650px;
}

.btn-radio {
    background: var(--rojo-cecopi);
    color: #fff;
    padding: 14px 28px;
    border-radius: 5px;
    text-decoration: none;
    display: inline-block;
    font-weight: 700;
    margin-top: 15px;
    transition: transform .3s, background .3s, box-shadow .3s;
}

.btn-radio:hover {
    background: var(--amarillo-cecopi);
    color: #fff;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0,0,0,.3);
}

/* =====================================================
   BIBLIOTECA
===================================================== */
.biblioteca { background: var(--gris-medio); }

.biblioteca-card {
    background: #fff;
    border-radius: 12px;
    padding: 35px;
    text-align: center;
    height: 100%;
    box-shadow: 0 8px 25px rgba(0,0,0,.06);
    transition: transform .4s, box-shadow .4s;
}

.biblioteca-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 45px rgba(0,0,0,.12);
}

.biblioteca-card i {
    font-size: 45px;
    color: var(--rojo-cecopi);
    display: inline-block;
    transition: transform .4s, color .3s;
}

.biblioteca-card:hover i {
    transform: scale(1.2) rotate(-10deg);
    color: var(--azul-cecopi);
}

.biblioteca-card h4 {
    margin-top: 20px;
    color: var(--amarillo-cecopi);
    font-weight: 800;
    transition: color .3s;
}

.biblioteca-card:hover h4 { color: var(--azul-cecopi); }

/* =====================================================
   FOOTER
===================================================== */
footer {
    background: var(--azul-cecopi);
    color: #fff;
    padding-top: 65px;
}

.footer-logo {
    max-width: 260px;
    background: #fff;
    padding: 10px;
    border-radius: 5px;
    animation: flotar 5s ease-in-out infinite;
    transition: transform .3s, box-shadow .3s;
}

.footer-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0,0,0,.3);
}

footer h5 {
    color: var(--amarillo-cecopi);
    font-weight: 800;
    margin-bottom: 20px;
    transition: letter-spacing .3s, color .3s;
}

footer h5:hover { letter-spacing: 2px; color: #fff; }

footer p, footer li {
    color: rgba(255,255,255,.75);
    line-height: 1.8;
}

footer ul { list-style: none; padding: 0; }

footer ul li { margin-bottom: 8px; transition: transform .3s; }
footer ul li:hover { transform: translateX(8px); }

footer ul a {
    color: rgba(255,255,255,.75);
    text-decoration: none;
    transition: color .3s, padding-left .3s;
}

footer ul a:hover { color: var(--amarillo-cecopi); padding-left: 5px; }

/* Footer bottom */
.footer-bottom {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 25px;
    padding: 18px 5%;
    border-top: 1px solid rgba(255,255,255,.15);
    font-size: 14px;
    line-height: 1.6;
}

.footer-copyright {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: rgba(255,255,255,.85);
}

.footer-copyright span:first-child { font-weight: 600; color: #fff; }
.footer-separator { color: rgba(255,255,255,.4); }

.footer-developer {
    display: flex;
    align-items: center;
    gap: 7px;
    color: rgba(255,255,255,.75);
    white-space: nowrap;
}

.developer-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #fff;
    text-decoration: none;
    transition: color .3s, transform .3s;
}

.developer-link:hover { color: black; transform: translateY(-2px) scale(1.05); }

/* =====================================================
   WHATSAPP Y BOTÓN TOP
===================================================== */
.whatsapp {
    position: fixed;
    right: 25px;
    bottom: 25px;
    width: 58px;
    height: 58px;
    background: #25D366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 29px;
    text-decoration: none;
    z-index: 999;
    box-shadow: 0 8px 25px rgba(0,0,0,.25);
    transition: transform .3s;
    animation: latido 2s ease-in-out infinite;
}

.whatsapp:hover {
    color: #fff;
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 10px 35px rgba(37,211,102,.5);
    animation: none;
}

.btn-top {
    position: fixed;
    right: 25px;
    bottom: 95px;
    width: 45px;
    height: 45px;
    background: var(--amarillo-cecopi);
    color: #fff;
    border-radius: 5px;
    display: none;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    z-index: 998;
    transition: transform .3s, background .3s;
}

.btn-top.show { display: flex; }

.btn-top:hover {
    transform: translateY(-5px) scale(1.1);
    background: #fff;
    color: var(--amarillo-cecopi);
}

/* =====================================================
   RESPONSIVE
===================================================== */
@media (max-width: 991px) {
    .logo-cecopi { width: 190px; height: 85px; object-position: center; }
    .slogan-header p { font-size: 20px; }
    .slogan-line { width: 50px; height: 3px; }
    .logo-radio { flex: 0 0 150px; height: 85px; }
    .logo-atipiri { width: 150px; height: 85px; }
    .carousel-item { height: 520px; }
    .carousel-caption-custom h1 { font-size: 42px; }
}

@media (max-width: 767px) {
    section { padding: 65px 0; }

    .topbar-contact { display: none; }
    .topbar { padding: 6px 0; }
    .topbar-right { justify-content: center; width: 100%; }

    .logos-header { gap: 4px; }
    .logo-cecopi { width: 28vw; min-width: 80px; height: 60px; }
    .slogan-header p { font-size: clamp(10px, 2.6vw, 14px); white-space: normal; }
    .slogan-line { width: 35px; height: 2px; }
    .logo-radio { flex: 0 0 28vw; height: 60px; }
    .logo-atipiri { width: 100%; max-width: 115px; height: 55px; }

    .carousel-item { height: 520px; }
    .carousel-caption-custom { left: 7%; right: 7%; max-width: none; }
    .carousel-caption-custom h1 { font-size: 32px; }
    .carousel-caption-custom p { font-size: 15px; }

    .section-title h2 { font-size: 28px; }

    .footer-bottom {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 12px;
        padding: 20px;
    }
    .footer-copyright { justify-content: center; }
    .footer-separator { display: none; }

    .whatsapp { width: 52px; height: 52px; right: 18px; bottom: 18px; font-size: 25px; }
    .btn-top { right: 18px; bottom: 82px; width: 40px; height: 40px; }
}

@media (max-width: 380px) {
    .logo-cecopi { width: 27vw; min-width: 72px; height: 55px; }
    .slogan-header p { font-size: 9px; }
    .logo-radio { flex: 0 0 27vw; height: 55px; }
    .carousel-caption-custom h1 { font-size: 26px; }
    .carousel-caption-custom p { font-size: 14px; }
    .section-title h2 { font-size: 25px; }
}
    