:root { --primary: #0056b3; --secondary: #e9ecef; --text-dark: #333; --text-light: #666; --bg-color: #f8f9fa; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; margin: 0; background-color: var(--bg-color); color: var(--text-dark); line-height: 1.6; }

/* ================= HEADER ACTUALIZADO ================= */
header { display: flex; flex-direction: column; background-color: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.header-main { display: flex; justify-content: space-between; align-items: center; padding: 15px 5%; border-bottom: 1px solid #f0f0f0; gap: 20px; }
.header-logo { font-size: 1.8rem; font-weight: 700; color: var(--primary); text-decoration: none; white-space: nowrap; }

/* Estilos de la caja de búsqueda del Header */
.header-search-container { flex-grow: 1; display: flex; justify-content: flex-end; padding: 0; }
.header-form { display: flex; width: 100%; max-width: 500px; }
.header-form input { flex-grow: 1; padding: 10px 20px; border: 1px solid #ccc; border-right: none; border-radius: 20px 0 0 20px; font-size: 1rem; background-color: var(--secondary); outline: none; transition: all 0.3s; }
.header-form input:focus { background-color: #fff; border-color: var(--primary); }
.header-form button { padding: 10px 20px; background-color: var(--primary); color: #fff; border: 1px solid var(--primary); border-radius: 0 20px 20px 0; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background-color 0.2s; }
.header-form button:hover { background-color: #004494; }

/* Navegación del Header */
.header-nav { display: flex; justify-content: center; gap: 30px; padding: 12px 5%; flex-wrap: wrap; background-color: #fafafa; }
.header-nav a { text-decoration: none; color: var(--text-dark); font-weight: 500; font-size: 0.95rem; transition: color 0.2s; }
.header-nav a:hover { color: var(--primary); }

/* LAYOUT PRINCIPAL */
.container { display: flex; max-width: 1200px; margin: 30px auto; gap: 30px; padding: 0 20px; min-height: 60vh; }
.sidebar { width: 280px; flex-shrink: 0; background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); height: fit-content; }
.sidebar-wide { width: 300px; }
.sidebar h3 { margin-top: 0; color: var(--primary); border-bottom: 2px solid var(--secondary); padding-bottom: 10px; font-size: 1.1rem; }
.sidebar ul { list-style: none; padding: 0; margin-bottom: 20px; }
.sidebar li { margin-bottom: 12px; }
.sidebar a { text-decoration: none; color: var(--text-light); transition: color 0.2s; font-size: 0.95rem; display: block;}
.sidebar a:hover { color: var(--primary); font-weight: 500; padding-left: 5px; }
.sidebar-search-form { display: flex; flex-direction: column; gap: 10px; margin-bottom: 30px; }
.sidebar-search-form input { padding: 10px; border: 1px solid #ddd; border-radius: 6px; font-size: 0.95rem; }
.sidebar-search-form button { padding: 12px; background-color: var(--primary); color: #fff; border: none; border-radius: 6px; font-size: 1rem; font-weight: 600; cursor: pointer; }
.sidebar-search-form button:hover { background-color: #004494; }

/* MAIN Y BUSCADOR CENTRAL */
.main-content { flex: 1; }
.hero-search-box { background: #fff; padding: 40px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.08); text-align: center; margin-bottom: 40px; }
.hero-search-box h1 { margin-top: 0; font-size: 2.2rem; color: var(--text-dark); }
.hero-search-box p { color: var(--text-light); margin-bottom: 30px; }
.advanced-search-form { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.advanced-search-form input { padding: 15px; border: 1px solid #ddd; border-radius: 6px; font-size: 1rem; }
.advanced-search-form button { grid-column: span 2; padding: 15px; background-color: var(--primary); color: #fff; border: none; border-radius: 6px; font-size: 1.2rem; font-weight: 600; cursor: pointer; }
.advanced-search-form button:hover { background-color: #004494; }

/* GRIDS DE TARJETAS */
.cards-section { margin-top: 20px; margin-bottom: 40px; }
.cards-section h2 { color: var(--primary); margin-bottom: 20px; font-size: 1.5rem; border-bottom: 2px solid var(--secondary); padding-bottom: 10px; }
.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.card { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); transition: transform 0.2s ease, box-shadow 0.2s ease; border: 1px solid var(--secondary); display: flex; flex-direction: column; }
.card:hover { transform: translateY(-5px); box-shadow: 0 6px 15px rgba(0,0,0,0.1); }
.card h3 { margin-top: 0; color: var(--text-dark); font-size: 1.15rem; margin-bottom: 10px; }
.card p { color: var(--text-light); font-size: 0.9rem; margin-bottom: 15px; flex-grow: 1; }
.card a { color: var(--primary); text-decoration: none; font-weight: 600; font-size: 0.9rem; margin-top: auto; }
.card a:hover { text-decoration: underline; }

/* ARTÍCULOS RELACIONADOS */
.related-articles-container { max-width: 1200px; margin: 0 auto 40px auto; padding: 0 20px; }

/* FOOTER */
footer { background: #222; color: #ccc; padding: 50px 5%; display: flex; justify-content: space-around; flex-wrap: wrap; margin-top: 20px;}
.footer-widget { width: 30%; min-width: 250px; margin-bottom: 20px; }
.footer-widget h3 { color: #fff; font-size: 1.2rem; margin-bottom: 20px; }
.footer-widget a { color: #aaa; text-decoration: none; display: block; margin-bottom: 10px; transition: color 0.2s; }
.footer-widget a:hover { color: #fff; }

/* ================= CABECERA DE CATEGORÍAS ================= */
.category-header { margin-top: 0; }
.category-header h1 { color: var(--primary); margin-top: 0; margin-bottom: 10px; font-size: 2rem; }
.category-header p { color: var(--text-light); margin-bottom: 30px; }

/* ================= ESTILOS DE ARTÍCULO ================= */
.article-content { background: #fff; padding: 40px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.08); }
.article-header h1 { color: var(--text-dark); font-size: 2.2rem; margin-top: 0; margin-bottom: 10px; line-height: 1.2; }
.article-meta { color: var(--text-light); font-size: 0.9rem; margin-bottom: 30px; padding-bottom: 15px; border-bottom: 1px solid var(--secondary); }
.article-meta a { color: var(--primary); text-decoration: none; font-weight: 500; }
.article-meta a:hover { text-decoration: underline; }
.article-body h2 { color: var(--primary); margin-top: 35px; margin-bottom: 15px; border-bottom: 2px solid var(--secondary); padding-bottom: 8px; font-size: 1.5rem; }
.article-body p { margin-bottom: 20px; font-size: 1.05rem; line-height: 1.7; }
.article-body ul, .article-body ol { margin-bottom: 25px; font-size: 1.05rem; padding-left: 25px; line-height: 1.7; }
.article-body li { margin-bottom: 10px; }

/* Caja de Alertas / Consejos */
.alert-box { background-color: var(--bg-color); color: var(--text-dark); padding: 20px; border-radius: 6px; border-left: 5px solid var(--primary); margin: 30px 0; }

/* ================= RESULTADOS TIPO GOOGLE SERP ================= */
.serp-container { margin-top: 20px; padding: 20px; background: #fff; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.serp-header { margin-top: 0; margin-bottom: 25px; font-size: 1.4rem; color: var(--text-dark); border-bottom: 1px solid var(--secondary); padding-bottom: 10px; }
.serp-result { margin-bottom: 30px; }
.serp-url { color: #202124; font-size: 0.85rem; display: block; margin-bottom: 4px; display: flex; align-items: center; gap: 5px; }
.serp-url::before { content: "🌐"; font-size: 0.8rem; }
.serp-title { color: #1a0dab; font-size: 1.25rem; font-weight: 400; text-decoration: none; display: inline-block; margin-bottom: 4px; }
.serp-title:hover { text-decoration: underline; }
.serp-snippet { color: #4d5156; font-size: 0.95rem; line-height: 1.6; margin: 0; max-width: 800px; }


/* ================= TABLAS ================= */
.summary-table { width: 100%; border-collapse: collapse; margin: 20px 0; }
.summary-table th, .summary-table td { border: 1px solid var(--secondary); padding: 12px; text-align: left; }
.summary-table th { background-color: var(--secondary); color: var(--text-dark); }