/* --- variables y reset --- */
:root {
    --azul-oscuro: #0d2c54;
    --azul-claro: #1a5b8c;
    --dorado: #c5a059;
    --gris-fondo: #f4f6f9;
    --blanco: #ffffff;
    --texto-oscuro: #333333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--gris-fondo);
    color: var(--texto-oscuro);
    line-height: 1.6;
}

/* --- barra superior de contacto --- */
.top-bar {
    background-color: var(--azul-oscuro);
    color: var(--blanco);
    padding: 8px 5%;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    flex-wrap: wrap;
}

/* --- encabezado / menu --- */
header {
    background-color: var(--blanco);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
}

.logo {
    font-weight: bold;
    font-size: 24px;
    color: var(--azul-oscuro);
    text-transform: uppercase;
    letter-spacing: 1px;
}

nav ul {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    text-decoration: none;
    color: var(--texto-oscuro);
    font-weight: 600;
    transition: color 0.3s;
}

nav ul li a:hover {
    color: var(--azul-claro);
}

nav button {
    padding: 0.4rem 0.8rem;
    font-size: 0.6rem;
}

/* --- banner principal --- */
.hero {
    background: linear-gradient(rgba(13, 44, 84, 0.8), rgba(26, 91, 140, 0.8)), url('https://via.placeholder.com') no-repeat center center/cover;
    color: var(--blanco);
    min-height: 70vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero p {
    font-size: 19px;
    max-width: 800px;
    margin-bottom: 30px;
}

.btn-principal {
    background-color: var(--dorado);
    color: var(--blanco);
    padding: 12px 30px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 1rem;
    display: inline-block;
}

.btn-principal:hover {
    background-color: #b08d4b;
}

/* --- secciones generales --- */
.section {
    padding: 60px 5%;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    color: var(--azul-oscuro);
    font-size: 32px;
    margin-bottom: 40px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--dorado);
    margin: 10px auto 0;
}

/* --- mostrar/ocultar secciones (navegación por botones) --- */
.seccion-navegable {
    display: none;
}

.seccion-navegable.activa {
    display: block;
}

.btn-volver {
    display: block;
    margin: 0 auto 30px auto;
    background-color: var(--azul-oscuro);
}

.btn-volver:hover {
    background-color: var(--azul-claro);
}

.grid-nosotros {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: flex-start;
    margin-top: 25px;
}

.parrafo-intro {
    text-align: center;
    font-size: 17px;
    max-width: 900px;
    margin: 0 auto 30px;
    color: #022e75;
}

/* --- tarjetas de servicio --- */
.bg-blanco {
    background-color: var(--blanco);
}

.grid-servicios {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.card {
    background: var(--blanco);
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    border-top: 4px solid var(--azul-claro);
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.card-icon {
    font-size: 40px;
    color: var(--dorado);
    margin-bottom: 15px;
}

.card-img {
    width: auto;
    max-width: 200px;
    max-height: 200px;
    object-fit: cover;
    border-radius: 12px;
    margin: 0 auto 0.8rem auto;
    background: #0a0a1e;
    display: block;
}

.card h3 {
    color: var(--azul-oscuro);
    margin-top: 0.5rem;
    font-size: 1.1rem;
}

/* --- afiliacion --- */
.grid-afiliacion {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 20px;
}

.bloque-requisitos {
    background: var(--gris-fondo);
    padding: 25px;
    border-radius: 8px;
    border-left: 5px solid var(--dorado);
}

.bloque-requisitos h3 {
    color: var(--azul-oscuro);
    margin-bottom: 15px;
}

.bloque-requisitos ul {
    list-style-position: inside;
    margin-bottom: 20px;
}

.bloque-requisitos ul li {
    margin-bottom: 8px;
}

/* --- noticias --- */
.grid-noticias {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.noticia-item {
    background: var(--blanco);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.noticia-img {
    width: 100%;
    height: 200px;
    background-color: #ddd;
    object-fit: cover;
}

.noticia-body {
    padding: 20px;
}

/* --- pie de la pagina --- */
footer {
    background-color: var(--azul-oscuro);
    color: var(--blanco);
    padding: 50px 5%;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-col h3 {
    color: var(--dorado);
    margin-bottom: 20px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a {
    color: #ccc;
    text-decoration: none;
}

.footer-col ul li a:hover {
    color: var(--blanco);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
    color: #aaa;
}

/* --- contenedores de listas dinámicas --- */
#reinas-container,
#presidentes-container,
#reina-actual,
#consejo-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

#presidente-actual {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3.5rem;
    padding: 3rem;
}

/* --- botón / modal de afiliación --- */
.contenedor-btn-afiliarse {
    text-align: center;
    margin: 40px 0 20px 0;
}

.btn-afiliarse {
    display: inline-block;
    padding: 15px 35px;
    background-color: var(--azul-claro);
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.btn-afiliarse:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* Fondo oscuro de la Modal (Overlay) */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-y: auto;
}

.modal-overlay.activo {
    display: flex;
}

.modal-contenido {
    background-color: #ffffff;
    width: 100%;
    max-width: 600px;
    padding: 30px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
}

.btn-cerrar-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
}

.btn-cerrar-modal:hover {
    color: #000;
}

.titulo-form {
    text-align: center;
    margin-bottom: 8px;
    color: #333;
}

.subtitulo-form {
    text-align: center;
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 20px;
}

.form-afiliacion {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.grupo-campo {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.grupo-doble {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.grupo-campo label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #444;
}

.grupo-campo input,
.grupo-campo select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.grupo-campo input:focus,
.grupo-campo select:focus {
    border-color: var(--azul-claro);
}

.btn-enviar-registro {
    padding: 14px;
    background-color: #28a745;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.btn-enviar-registro:hover {
    background-color: #218838;
}

/* --- redes sociales flotantes --- */
.redes-flotantes {
    position: fixed;
    bottom: 1.5rem;
    left: 1.2rem;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.red-social {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    text-decoration: none;
    transition: transform 0.22s, box-shadow 0.22s;
}

.red-social:hover {
    transform: scale(1.15);
}

.red-social.facebook {
    background: #1877f2;
    box-shadow: 0 4px 18px rgba(24, 119, 242, 0.5);
}

.red-social.facebook:hover {
    box-shadow: 0 6px 24px rgba(24, 119, 242, 0.75);
}

.red-social.instagram {
    background: radial-gradient(circle at 30% 110%, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    box-shadow: 0 4px 18px rgba(220, 39, 67, 0.5);
}

.red-social.instagram:hover {
    box-shadow: 0 6px 24px rgba(220, 39, 67, 0.75);
}

/* --- responsivo --- */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    nav ul li {
        margin-left: 0;
    }

    .grid-nosotros,
    .grid-afiliacion {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 30px;
    }
}

@media (max-width: 600px) {
    .grupo-doble {
        grid-template-columns: 1fr;
    }
}

/*
*/
/* ---------- Carrusel de convenios ---------- */
.carrusel {
    position: relative;
    max-width: 700px;
    /* más pequeño que antes (900px) */
    margin: 0 auto;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: 0 0 60px rgba(57, 255, 20, 0.08);
}

.carrusel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.carrusel-track img {
    flex: 0 0 100%;
    width: 100%;
    height: 300px;
    /* alto fijo: todas quedan iguales */
    object-fit: contain;
    /* el logo se ve completo, sin recortar */
    padding: 20px 20px 40px;
    /* abajo más espacio para los puntos */
    box-sizing: border-box;
    background: #fff;
    display: block;
}

.carrusel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
}

.carrusel-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: background 0.2s ease;
}

.carrusel-dots span.active-dot {
    background: var(--green);
}

/* Celulares */
@media (max-width: 600px) {
    .carrusel-track img {
        height: 200px;
        padding: 12px 12px 32px;
    }
}

.carrusel {
    max-width: 700px !important;
    background: #fff !important;
}

.carrusel .carrusel-track img {
    flex: 0 0 100% !important;
    width: 100% !important;
    height: 300px !important;
    aspect-ratio: auto !important;
    object-fit: contain !important;
    padding: 20px 20px 40px !important;
    box-sizing: border-box !important;
    background: #fff !important;
    display: block !important;
}

@media (max-width: 600px) {
    .carrusel .carrusel-track img {
        height: 200px !important;
        padding: 12px 12px 32px !important;
    }
}

.hero {
    position: relative;
    --lado: 40px;
    /* separación con el borde */
    --arriba: 40px;
    /* separación con el top */
    --alto: 300px;
    /* alto de AMBOS, cámbialo y se ajustan los dos */
}

/* Logo izquierdo */
.hero .logo-left {
    position: absolute;
    top: var(--arriba);
    left: var(--lado);
    height: var(--alto);
    width: auto;
    object-fit: contain;
}

/* Foto derecha */
.hero .logo-right {
    position: absolute;
    top: var(--arriba);
    right: var(--lado);
    height: var(--alto);
    width: 240px;
    object-fit: cover;
    /* recorta sin deformar la foto */
    object-position: center;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Tablet */
@media (max-width: 992px) {
    .hero {
        --lado: 20px;
        --arriba: 20px;
        --alto: 240px;
    }

    .hero .logo-right {
        width: 180px;
    }
}

/* Móvil: se apilan arriba, centrados */
@media (max-width: 600px) {

    .hero .logo-left,
    .hero .logo-right {
        position: static;
        display: inline-block;
        height: 120px;
        width: auto;
        margin: 0 8px 15px;
    }

    .hero .logo-right {
        width: 120px;
        border-radius: 12px;
    }
}

.carrusel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #c9a45a;
    color: #fff;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: background 0.2s, transform 0.2s;
}

.carrusel-btn:hover {
    background: #b08d45;
    transform: translateY(-50%) scale(1.08);
}

.carrusel-btn.prev {
    left: 10px;
}

.carrusel-btn.next {
    right: 10px;
}

@media (max-width: 600px) {
    .carrusel-btn {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }
}

/* Ajustes para el telefono */
@media (max-width: 600px) {

    /* 1. Quitar la barra azul de contacto */
    .top-bar {
        display: none;
    }

    /* 2. Header compacto: título y botón en una sola fila, sin puntito */
    .nav-container {
        flex-direction: row;
        gap: 10px;
        padding: 10px 4%;
    }

    .nav-container ul {
        list-style: none;
    }

    .nav-container ul li {
        margin: 0;
    }

    .logo {
        font-size: 15px;
        letter-spacing: 0.5px;
        line-height: 1.2;
    }

    .nav-container .btn-principal {
        padding: 8px 14px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* 3. Hero en grid: logo y foto lado a lado, el resto ocupa todo el ancho */
    .hero {
        display: grid;
        grid-template-columns: 1fr 1fr;
        column-gap: 12px;
        justify-items: center;
        align-content: center;
        padding: 25px 16px 35px;
    }

    .hero> :not(img) {
        grid-column: 1 / -1;
    }

    .hero .logo-left,
    .hero .logo-right {
        position: static;
        height: 170px;
        margin: 0 0 18px;
    }

    .hero .logo-left {
        width: auto;
        justify-self: end;
    }

    .hero .logo-right {
        width: 150px;
        justify-self: start;
        object-fit: cover;
        border-radius: 14px;
    }

    .hero h1 {
        font-size: 24px;
        margin-bottom: 10px;
    }

    .hero p {
        font-size: 16px;
        margin-bottom: 22px;
    }

    /* 4. Botones del menú en 2 columnas */
    .hero nav {
        width: 100%;
        max-width: 340px;
    }

    .hero nav ul {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .hero nav ul li {
        margin: 0;
    }

    .hero nav .btn-principal {
        width: 100%;
        padding: 12px 6px;
        font-size: 0.95rem;
    }

    /* Convenios (el 7.º, queda solo) ocupa las dos columnas */
    .hero nav ul li:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    /* Redes flotantes un poco más chicas para que tapen menos */
    .red-social {
        width: 40px;
        height: 40px;
    }
}