* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
    padding-top: 90px; 
}

/* --- ENCABEZADO (HEADER) --- */
header {
    background-color: #ffffff;
    height: 80px;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eaeaea;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* 1. SECCIÓN LOGO */
.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-img {
    height: 100px; 
    width: auto;
}

.logo-text {
    font-size: 22px;
    font-weight: 900;
    color: #1a202c;
    letter-spacing: -0.5px;
}

.logo-text span {
    color: #d32f2f; 
    font-weight: 700;
    font-size: 16px;
    vertical-align: super;
}

/* 2. NAVEGACIÓN PRINCIPAL (Centro) */
.main-nav > ul {
    list-style: none;
    display: flex;
    gap: 25px;
    align-items: center;
}

.main-nav a {
    text-decoration: none;
    color: #4a5568;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.main-nav a:hover, .main-nav a.active {
    color: #0056b3; 
}

/* Menú Desplegable (Dropdown) */
.dropdown {
    position: relative;
    padding: 10px 0; 
}

.main-nav .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    
    /* CAMBIA ESTO DE 200px a 320px */
    min-width: 320px; 
    
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-radius: 6px;
    border: 1px solid #eaeaea;
    list-style: none;
    flex-direction: column; 
}

.main-nav .dropdown:hover .dropdown-menu {
    display: flex; 
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu a {
    padding: 12px 20px;
    color: #4a5568;
    font-weight: 400;
    border-bottom: 1px solid #f4f4f4;
}

.dropdown-menu a:hover {
    background-color: #f8f9fa;
    color: #0056b3;
    padding-left: 25px; 
    transition: all 0.2s;
}

/* 3. SECCIÓN DERECHA (Buscador e Idioma) */
.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* --- BUSCADOR EXPANDIBLE --- */
.search-container {
    display: flex;
    align-items: center;
    border: 2px solid transparent; 
    border-radius: 4px;
    transition: all 0.4s ease; 
    background-color: transparent;
    overflow: hidden; 
}

.search-container.active {
    border: 2px solid #0056b3; 
    background-color: #ffffff;
}

.search-input {
    width: 0; 
    border: none;
    outline: none;
    padding: 0;
    font-size: 15px;
    background-color: transparent;
    transition: width 0.4s ease, padding 0.4s ease;
    color: #333;
}

.search-container.active .search-input {
    width: 160px; 
    padding: 6px 10px;
}

.search-btn {
    background: transparent;
    border: none;
    color: #0056b3; 
    font-size: 18px;
    padding: 6px 10px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Selector de Idioma */
.lang-selector {
    position: relative;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.lang-current {
    font-weight: bold;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    list-style: none;
    min-width: 120px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.lang-selector:hover .lang-menu {
    display: block;
}

.lang-menu a {
    text-decoration: none;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
}

.lang-menu a:hover {
    background-color: #f4f7f6;
    color: #0056b3;
}

/* --- CONTENIDO PRINCIPAL --- */
main {
    max-width: 1100px;
    margin: 20px auto;
    padding: 0 20px;
}

.texto-patrocinado {
    text-align: center;
    font-size: 12px;
    color: #999; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    margin-top: 15px; 
    margin-bottom: 15px; 
}

/* --- BANNER PRINCIPAL CENTRADO (¡AHORA SÍ FUNCIONA EN PC!) --- */
.banner-contenedor {
    width: 100%;
    display: flex; 
    justify-content: center; 
    margin: 20px 0 40px 0; 
}

.banner-pantalla-completa {
    width: 95%; 
    max-width: 1100px; 
    height: auto;
    border-radius: 12px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
}

.hero {
    background-color: #ffffff;
    padding: 15px 30px; 
    border-radius: 8px;
    margin-top: -10px; 
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    border-left: 6px solid #0056b3;
}

.hero p {
    font-size: 16px; 
    color: #333; 
    margin-bottom: 18px; 
    line-height: 1.7; 
}

.hero .linea-elegante {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.15); 
    margin: 25px 0; 
}
.hero h1 { color: #222; margin-bottom: 15px; font-size: 32px; }

.ad-banner {
    display: none; 
}

.seccion-titulo {
    margin: 40px 0 20px;
    font-size: 26px;
    color: #111;
    border-bottom: 3px solid #0056b3;
    display: inline-block;
    padding-bottom: 5px;
}

/* --- CUADRÍCULA DE ARTÍCULOS --- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
}

.article-card {
    background: #ffffff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
    display: flex;           /* Activa flexbox dentro de la tarjeta */
    flex-direction: column;  /* Apila los elementos verticalmente */
    height: 100%;            /* Obliga a todas las tarjetas a medir lo mismo */
}

.article-card:hover {
    transform: translateY(-5px);
    border-bottom: 4px solid #0056b3;
}

.article-card h3 { color: #222; margin-bottom: 12px; font-size: 20px; }
.article-card p { 
    color: #555; 
    margin-bottom: 20px; 
    font-size: 15px; 
    flex-grow: 1; /* ESTO ES LA MAGIA: El texto empuja al botón hacia abajo */
}

.btn-leer {
    display: inline-block;
    background-color: #0056b3;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    align-self: flex-start; /* Evita que el botón se estire a lo ancho */
    margin-top: auto;       /* Se pega matemáticamente al fondo */
}

.btn-leer:hover { background-color: #004494; }

/* --- FOOTER --- */
footer { background-color: #1a1a1a; color: #ccc; text-align: center; padding: 40px 20px; margin-top: 60px; }

.footer-links {
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap; 
    gap: 20px; 
}

.footer-links a {
    color: #adb5bd; 
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #ffffff; 
    text-decoration: underline;
}

/* --- PÁGINA DE CONTACTO --- */
.contacto-container {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    max-width: 800px; 
    margin: 40px auto; 
}

.contacto-container h1 {
    color: #003366; 
    margin-bottom: 30px;
    font-size: 28px;
}

.formulario-contacto .form-group {
    margin-bottom: 25px; 
}

.formulario-contacto label {
    display: block;
    margin-bottom: 8px;
    color: #1a202c;
    font-size: 14px;
    font-weight: 500;
}

.formulario-contacto input[type="text"],
.formulario-contacto input[type="email"],
.formulario-contacto textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #cbd5e0; 
    border-radius: 4px;
    font-size: 15px;
    font-family: inherit;
    color: #333;
    transition: border-color 0.3s;
}

.formulario-contacto input:focus,
.formulario-contacto textarea:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 5px rgba(0, 86, 179, 0.2);
}

.formulario-contacto textarea {
    resize: vertical; 
}

.btn-enviar {
    background-color: #0056b3; 
    color: white;
    padding: 12px 35px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;
}

.btn-enviar:hover {
    background-color: #004494; 
}

/* --- BOTÓN IR ARRIBA --- */
#btn-subir {
    display: none; 
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999; 
    font-size: 18px;
    border: none;
    outline: none;
    background-color: #2f55d3; 
    color: white;
    cursor: pointer;
    padding: 15px 20px;
    border-radius: 50%; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.3); 
    transition: background-color 0.3s, transform 0.2s;
}

#btn-subir:hover {
    background-color: #2f55d3; 
    transform: scale(1.1); 
}

/* --- SECCIONES DE TEXTO INFORMATIVO --- */
.info-section {
    margin-top: 50px;
    margin-bottom: 30px;
}

.info-texto p {
    color: #4a5568;
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 15px;
}

/* --- PREGUNTAS FRECUENTES (FAQ) --- */
.faq-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.faq-item {
    background-color: #ffffff;
    padding: 20px 25px;
    border-radius: 8px;
    border-left: 4px solid #0056b3;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}

.faq-item h4 {
    color: #1a202c;
    font-size: 18px;
    margin-bottom: 10px;
}

.faq-item p {
    color: #555;
    font-size: 15px;
}

/* --- BANNER CELESTE CENTRADO --- */
.banner-celeste {
    background-color: #5fa3ec; 
    padding: 50px 30px;
    border-radius: 8px;
    text-align: center; 
    max-width: 800px;  /* ¡Añadido para centrar todo el bloque! */
    margin: 50px auto 40px auto; 
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.banner-celeste h2 {
    color: #ffffff; 
    font-size: 28px;
    margin-bottom: 15px;
    font-weight: 800;
}

.banner-celeste p {
    color: #f8f9fa; 
    font-size: 16px;
    max-width: 750px;
    margin: 0 auto 25px auto; 
    line-height: 1.6;
}

.banner-celeste .btn-blanco {
    background-color: #ffffff;
    color: #007bff; 
    padding: 12px 35px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    display: inline-block; 
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.banner-celeste .btn-blanco:hover {
    transform: translateY(-3px); 
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    background-color: #f1f1f1;
}

/* --- PÁGINAS LEGALES Y DE TEXTO LARGO --- */
.legal-container {
    background-color: #ffffff;
    padding: 50px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    max-width: 900px; 
    margin: 40px auto; 
}

.legal-container h1 {
    color: #003366;
    font-size: 32px;
    margin-bottom: 10px;
    border-bottom: 2px solid #eaeaea;
    padding-bottom: 15px;
}

.legal-meta {
    color: #888;
    font-size: 14px;
    margin-bottom: 30px;
    font-style: italic;
}

.legal-container h2 {
    color: #1a202c;
    font-size: 22px;
    margin-top: 35px;
    margin-bottom: 15px;
}

.legal-container p {
    color: #4a5568;
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 15px;
}

.legal-container ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.legal-container li {
    color: #4a5568;
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 10px;
}

/* --- PLANTILLA DE LECTURA DE ARTÍCULO INDIVIDUAL --- */
.contenedor-articulo {
    max-width: 800px; /* Ancho más estrecho para que la lectura sea cómoda y no canse el ojo */
    margin: 40px auto;
    padding: 0 20px;
    background-color: transparent;
}

.cabecera-articulo {
    margin-bottom: 30px;
    text-align: center;
}

.cabecera-articulo .categoria {
    color: #0056b3;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    display: inline-block;
}

.cabecera-articulo h1 {
    color: #1a202c;
    font-size: 38px;
    line-height: 1.2;
    margin-bottom: 20px;
}

.cabecera-articulo .meta-info {
    color: #718096;
    font-size: 15px;
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
}

.imagen-destacada {
    width: 100%;
    height: auto;
    max-height: 450px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.cuerpo-articulo {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.cuerpo-articulo p {
    font-size: 18px; /* Letra un poco más grande para leer bien */
    color: #333;
    line-height: 1.8;
    margin-bottom: 25px;
}

.cuerpo-articulo h2 {
    font-size: 26px;
    color: #003366;
    margin-top: 40px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eaeaea;
    padding-bottom: 10px;
}

.cuerpo-articulo ul {
    margin-left: 20px;
    margin-bottom: 25px;
}

.cuerpo-articulo li {
    font-size: 18px;
    color: #333;
    line-height: 1.8;
    margin-bottom: 12px;
}

/* Espacio para tus anuncios dentro del texto */
.bloque-anuncio-interno {
    background-color: #f8f9fa;
    border: 1px dashed #ccc;
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
    margin: 30px 0;
    border-radius: 4px;
}

/* --- CAJAS DE ANUNCIOS EN LA CUADRÍCULA DE ARTÍCULOS --- */
.ad-card-slot {
    background-color: #f8f9fa;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    color: #a0aec0;
    min-height: 400px; /* Obliga a que mida parecido a un artículo real */
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.ad-card-slot span {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    font-weight: bold;
    color: #cbd5e0;
}

/* --- PAGINACIÓN (Estilo similar a la foto) --- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 60px;
    margin-bottom: 20px;
    padding-top: 20px;
    border-top: 1px solid #eaeaea; /* Línea separadora sutil arriba */
}

.pagination a {
    text-decoration: none;
    color: #4a5568;
    font-size: 15px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

/* El número de la página actual */
.pagination a.active {
    background-color: #0056b3;
    color: white;
}

.pagination a:hover:not(.active) {
    background-color: #f1f5f9;
    color: #003366;
}

.pagination .prev, .pagination .next {
    font-weight: bold;
    color: #1a202c;
}

/* Para ocultar el botón Previous en la página 1 */
.pagination .hidden {
    display: none;
}


/* --- CUADRÍCULA PARA PÁGINAS DE ARTÍCULOS Y RETAIL (3 Columnas) --- */
/* --- CUADRÍCULA PARA PÁGINAS DE ARTÍCULOS Y RETAIL --- */
.articles-prev-grid {
    display: grid;
    /* MAGIA RÍGIDA: Obligamos a que sean exactamente 3 columnas del mismo tamaño */
    grid-template-columns: repeat(3, 1fr); 
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Diseño de cada tarjeta individual */
.article-card-prev {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%; /* Obliga a que todas midan lo mismo */
}

.article-card-prev:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
}

.article-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.article-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Empuja el botón hacia abajo */
}

.article-sector {
    color: #0056b3;
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.article-content h3 {
    color: #1a202c;
    font-size: 20px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.article-meta {
    color: #718096;
    font-size: 13px;
    margin-bottom: 15px;
    font-style: italic;
}

.article-content p {
    color: #4a5568;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.btn-leer-mas {
    color: #0056b3;
    font-weight: bold;
    text-decoration: none;
    font-size: 15px;
    align-self: flex-start;
    margin-top: auto;
}

.btn-leer-mas:hover {
    text-decoration: underline;
    color: #003366;
}

/* =========================================
   DISEÑO RESPONSIVO (MÓVILES Y TABLETS)
========================================= */
@media (max-width: 768px) {
    
    body {
        padding-top: 0; 
    }

    header {
        position: static; 
        padding: 15px;
        height: auto;
        flex-direction: column; 
        gap: 15px;
    }

    .main-nav > ul {
        flex-wrap: wrap; 
        justify-content: center;
        gap: 15px;
    }

    /* Adaptación a celulares para páginas legales */
    .legal-container {
        padding: 25px 20px;
        margin: 20px 15px;
    }
    .legal-container h1 { font-size: 26px; }
    .legal-container h2 { font-size: 20px; }

    .hero {
        display: flex; 
        flex-direction: column; 
        align-items: center; 
        width: 100%;
        position: relative; 
        padding-bottom: 50px; 
    }

    .hero h1 {
        font-size: 22px; 
    }

    .articles-prev-grid {
        grid-template-columns: 1fr;
    }

    .seccion-titulo {
        font-size: 22px;
    }
}