/* --- Variables y Estilos Base --- */
:root {
    --color-primary: #0ea5e9;
    --color-primary-dark: #0284c7;
    --color-secondary: #10b981;
    --bg-dark: #0f172a;
    --bg-light: #1e293b;
    --text-light: #f8fafc;
    --text-normal: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background: var(--bg-dark);
    color: var(--text-normal);
    line-height: 1.6;
    font-size: 16px;
}

a { color: var(--color-primary); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--color-primary-dark); }
h1, h2, h3, h4 { color: var(--text-light); line-height: 1.2; }

/* --- Header y Navegación --- */
.header {
    background: #FFFFFF; /* CAMBIO: Fondo blanco sólido */
    border-bottom: 1px solid #e2e8f0; /* CAMBIO: Borde gris muy sutil para separar */
    position: sticky; 
    top: 0; 
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); /* NUEVO: Sombra sutil para darle profundidad */
}
.nav-container {
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0.5rem 2rem; /* CAMBIO: Más espaciado vertical para que respire */
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}
.logo img {
    max-height: 150px; /* CAMBIO: Logo más grande y visible */
    width: auto;
    transition: all 0.3s ease; /* Efecto suave */
}
.nav-tabs { 
    display: flex; 
    list-style: none; 
    gap: 1.5rem; 
    align-items: center;
}
.nav-tabs a { 
    padding: 0.5rem 1rem; 
    border-radius: 8px; 
    font-weight: 600; /* Texto un poco más grueso */
    color: #334155; /* CAMBIO: Color de texto oscuro para contraste en fondo blanco */
    transition: all 0.3s ease;
}
.nav-tabs a:hover { 
    background: rgba(14, 165, 233, 0.1); 
    color: var(--color-primary); 
}
.nav-tabs .current-menu-item a, 
.nav-tabs .current-page-ancestor a { 
    background: var(--color-primary); 
    color: white; 
}
.nav-tabs .current-menu-item a:hover,
.nav-tabs .current-page-ancestor a:hover {
    color: white; /* Asegura que el texto siga blanco en hover */
}

/* --- Contenido Principal y Secciones --- */
.main-container { max-width: 1200px; margin: 0 auto; padding: 2rem; }
.section { padding: 3rem 0; }
.section h2, .page-title { font-size: clamp(2rem, 5vw, 2.5rem); margin-bottom: 2rem; text-align: center; color: var(--color-primary); }

/* --- Hero Section (Portada) --- */
.hero { text-align: center; padding: 4rem 1rem; border-radius: 16px; margin-bottom: 3rem; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 3.5rem); margin-bottom: 1rem; background: linear-gradient(135deg, var(--color-primary), #06b6d4); background-clip: text; -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: clamp(1.1rem, 3vw, 1.25rem); color: var(--text-normal); margin-bottom: 2rem; max-width: 800px; margin-left: auto; margin-right: auto; }
.cta-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.btn { display: inline-block; padding: 0.875rem 2rem; border-radius: 8px; font-weight: 600; transition: all 0.3s ease; border: none; cursor: pointer; text-align: center; }
.btn-primary { background: var(--color-primary); color: white; }
.btn-primary:hover { background: var(--color-primary-dark); transform: translateY(-2px); box-shadow: 0 10px 25px rgba(14, 165, 233, 0.3); }
.btn-secondary { background: transparent; color: var(--color-primary); border: 2px solid var(--color-primary); }
.btn-secondary:hover { background: var(--color-primary); color: white; }

/* --- Grids y Cards --- */
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }
.dark-card { background: var(--bg-light); color: var(--text-normal); padding: 2rem; border-radius: 16px; border: 1px solid var(--border-color); transition: all 0.3s ease; }
.dark-card:hover { transform: translateY(-5px); border-color: var(--color-primary); }
.dark-card h3 { color: var(--color-primary); font-size: 1.5rem; margin-bottom: 1rem; }

/* --- Blog (Página de Archivo - index.php) --- */
.blog-archive {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.blog-archive .blog-post {
    background: var(--bg-light);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-archive .blog-post:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
}

.blog-archive .blog-post img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-post-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Ocupa el espacio restante */
}

.blog-meta {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.blog-post-content h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.blog-post-content h2 a {
    color: var(--text-light);
    text-decoration: none;
}

.entry-summary {
    color: var(--text-normal);
    flex-grow: 1;
}

.read-more-link {
    display: inline-block;
    margin-top: 1rem;
    font-weight: 600;
    color: var(--color-primary);
}

/* --- Páginas Genéricas --- */
.page-header { text-align: center; margin-bottom: 3rem; }
.entry-content { max-width: 800px; margin: 0 auto; }
.entry-content h2, .entry-content h3 { margin-top: 2rem; margin-bottom: 1rem; color: var(--color-primary); }
.entry-content p, .entry-content ul, .entry-content ol { margin-bottom: 1.5rem; }
.entry-content a { text-decoration: underline; }

/* --- Footer --- */
footer { background: #020617; padding: 3rem 2rem; margin-top: 3rem; border-top: 1px solid var(--border-color); }
.footer-content { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2.5rem; }
.footer-column h4 { color: var(--color-primary); margin-bottom: 1rem; font-size: 1.1rem; }
.footer-column p, .footer-column a { color: var(--text-muted); margin: 0.5rem 0; text-decoration: none; display: block; }
.footer-column a:hover { color: var(--color-primary); }
.footer-copyright { grid-column: 1 / -1; text-align: center; margin-top: 2rem; padding-top: 2rem; border-top: 1px solid var(--border-color); color: #64748b; font-size: 0.875rem; }

/* --- Bloque Subvención --- */
.subvencion { border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; font-family: 'Gill Sans MT', sans-serif; font-size: 0.9rem; }
.subvencion-header { background: linear-gradient(135deg, #22c55e, #16a34a); padding: 0.5rem; display: flex; justify-content: center; align-items: center; gap: 1rem; flex-wrap: wrap; }
.subvencion-header img { max-height: 25px; filter: brightness(0) invert(1); }
.subvencion-body { background: white; color: #333; padding: 1rem; text-align: center; }
.subvencion-body h3 { font-size: 0.8rem; margin: 0.2rem 0; line-height: 1.3; color: #333; }
.subvencion-footer { background: #000; color: #fff; padding: 0.5rem; text-align: center; font-size: 0.75rem; }

/* --- Responsive Media Queries --- */
@media (max-width: 900px) {
    .blog-archive .blog-post { grid-template-columns: 1fr; }
    .blog-archive .blog-post img { max-height: 250px; }
}
@media (max-width: 768px) {
    .nav-tabs { display: none; }
    .footer-content { text-align: center; }
    .footer-column { margin-bottom: 2rem; }
}

/* --- Estilos para la Página de Entrada Individual (single.php) --- */

.single-post-container {
    max-width: 800px; /* Ancho ideal para la legibilidad del texto */
    margin: 0 auto;
}

.post-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.post-meta {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.post-title {
    font-size: clamp(2.2rem, 5vw, 3rem);
    color: var(--text-light);
}

.featured-image {
    margin-bottom: 2.5rem;
    border-radius: 12px;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Estilos para el contenido que se añade desde el editor de WordPress */
.post-content h2,
.post-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
    color: var(--color-primary);
    line-height: 1.3;
}

.post-content p {
    margin-bottom: 1.5rem;
}

.post-content a {
    text-decoration: underline;
}

.post-content ul,
.post-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.post-content blockquote {
    border-left: 4px solid var(--color-primary);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-muted);
}

/* Estilos básicos para la sección de comentarios */
.comments-area {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.comment-form input[type="text"],
.comment-form textarea {
    width: 100%;
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-light);
    color: var(--text-light);
    margin-bottom: 1rem;
}

.comment-form .submit {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.comment-form .submit:hover {
    background: var(--color-primary-dark);
}

/* --- Estilos para Contact Form 7 --- */
.wpcf7-form .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.wpcf7-form .form-group {
    width: 100%;
}
.wpcf7-form .full-width {
    grid-column: 1 / -1; /* Ocupa todo el ancho */
}
.wpcf7-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-normal);
}
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form textarea,
.wpcf7-form select {
    width: 100%;
    padding: 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-dark);
    color: var(--text-light);
    font-size: 1rem;
    font-family: var(--font-family);
    transition: border-color 0.3s ease;
}
.wpcf7-form input:focus,
.wpcf7-form textarea:focus,
.wpcf7-form select:focus {
    outline: none;
    border-color: var(--color-primary);
}
.wpcf7-form .wpcf7-submit {
    width: 100%;
    margin-top: 1rem;
    background: var(--color-primary);
    color: white;
    padding: 0.875rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
}
.wpcf7-form .wpcf7-submit:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
}

/* Responsive para el formulario en móviles */
@media (max-width: 768px) {
    .wpcf7-form .form-grid {
        grid-template-columns: 1fr; /* Una sola columna en móviles */
    }
}

/* --- Estilos para las Tarjetas de Servicio --- */
.dark-card .service-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1.5rem;
}

.dark-card .service-list li {
    padding: 0.5rem 0 0.5rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.dark-card .service-list li:last-child {
    border-bottom: none;
}

.dark-card .service-list li::before {
    content: "✓"; /* Check verde */
    color: var(--color-secondary);
    font-weight: bold;
    margin-right: 0.8rem;
}

.dark-card .service-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    text-align: center;
    margin-top: 1rem;
}

/* =================================================================== */
/* === CÓDIGO DE ANULACIÓN DEFINITIVO PARA HEADER EN PÁGINA INICIO === */
/* =================================================================== */

/*
 * Esta regla es ultra-específica. Se aplica solo cuando el <body>
 * tiene la clase 'home' (que WordPress solo pone en la página de inicio).
 * Esto anulará cualquier estilo de tema remanente como el de Kadence.
*/

body.home .header {
    background: #FFFFFF !important;
    border-bottom: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
}

body.home .header .logo img {
    max-height: 180px !important;
}

body.home .header .nav-tabs a {
    color: #334155 !important;
}

body.home .header .nav-tabs a:hover {
    background: rgba(14, 165, 233, 0.1) !important;
    color: var(--color-primary) !important; 
}

body.home .header .nav-tabs .current-menu-item a,
body.home .header .nav-tabs .current-page-ancestor a {
    background: var(--color-primary) !important;
    color: white !important;
}
/* --- Estilos para Menú Desplegable (Dropdown) --- */
.nav-tabs .sub-menu {
    display: none; /* Oculta el submenú por defecto */
    position: absolute;
    background: #FFFFFF;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    list-style: none;
    padding: 0.5rem 0;
    min-width: 220px;
    border-radius: 8px;
    z-index: 100;
}
.nav-tabs .menu-item-has-children:hover > .sub-menu {
  display: block; /* Muestra en hover para escritorio */
}
.nav-tabs .sub-menu li a {
    padding: 0.75rem 1.5rem;
    display: block;
    white-space: nowrap;
}
.nav-tabs .sub-menu li a:hover {
    background: rgba(14, 165, 233, 0.1);
}
@media (max-width: 767px) {
    .nav-tabs .menu-item-has-children > .sub-menu {
        display: none; /* Asegura que esté oculto en móvil */
    }
    .nav-tabs .menu-item-has-children.submenu-open > .sub-menu {
        display: block; /* Muestra el submenú al hacer clic */
    }
}
/* --- Estilos para la Caja de Aviso de Área de Servicio --- */
.service-area-notice {
    border-left: 5px solid var(--color-secondary);
    padding: 2rem;
}

.service-area-notice p strong {
    color: var(--text-light);
}
/* --- Header y Navegación --- */
.header {
    background: #FFFFFF; /* CAMBIO: Fondo blanco sólido */
    border-bottom: 1px solid #e2e8f0; /* CAMBIO: Borde gris muy sutil para separar */
    position: sticky; 
    top: 0; 
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); /* NUEVO: Sombra sutil para darle profundidad */
}
.nav-container {
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0.5rem 2rem; /* AJUSTE RECOMENDADO: Menos padding vertical para que el header no sea excesivamente alto */
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}
.logo img {
    max-height: 150px; /* CAMBIO PRINCIPAL: Aumentado de 65px a 130px. ¡Ajusta este valor a tu gusto! */
    width: auto;
    transition: all 0.3s ease; /* Efecto suave */
}
/* ...resto de reglas del header sin cambios... */