/* ==========================================================================
   AYUDAS Y PRESTACIONES — Hoja de estilos global
   Diseño SaaS/Premium institucional. Responsive (Flexbox + Grid).
   ========================================================================== */

:root {
    --navy: #1a3a5c;
    --navy-mid: #24527f;
    --navy-light: #f0f6fc;
    --orange: #d9531e;
    --orange-hover: #c44111;
    --yellow: #f4b41a;
    --yellow-hover: #dfa111;
    --border: #dde3eb;
    --surface: #ffffff;
    --bg: #f5f7fa;
    --text: #1f2733;
    --text-soft: #4a5568;
    --text-mute: #718096;
    --font-heading: 'Source Serif 4', Georgia, 'Times New Roman', serif;
    --font-body: 'DM Sans', system-ui, -apple-system, sans-serif;
    --radius-lg: 16px;
    --radius-md: 8px;
    --radius-sm: 6px;
    --shadow-sm: 0 4px 6px rgba(16, 42, 67, 0.04);
    --shadow-md: 0 8px 24px rgba(16, 42, 67, 0.08);
    --maxw: 1200px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--navy-mid); }
img { max-width: 100%; height: auto; }

/* ----------------------------- Skip link (accesibilidad) ---------------- */
.skip-link {
    position: absolute; left: -999px; top: 0; z-index: 999;
    background: var(--yellow); color: #1a1a1a; padding: 10px 16px;
    border-radius: 0 0 var(--radius-md) 0; font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ----------------------------------- Navbar ----------------------------- */
.navbar {
    background: var(--navy);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand-icon {
    background: var(--orange); color: #fff; width: 34px; height: 34px;
    border-radius: var(--radius-md); display: flex; align-items: center;
    justify-content: center; font-weight: 700; font-size: 18px;
}
.brand-text { color: #fff; font-family: var(--font-heading); font-size: 20px; font-weight: 700; }
.brand-text span { color: #a8b6c8; font-family: var(--font-body); font-size: 16px; font-weight: 500; }

.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a { color: #e2e8f0; text-decoration: none; font-size: 14px; font-weight: 500; transition: color .15s; }
.nav-links a:hover, .nav-links a:focus { color: #fff; }

.btn-calc {
    background: var(--yellow); color: #1a1a1a !important; padding: 8px 16px;
    border-radius: 20px; font-weight: 600 !important; display: inline-flex;
    align-items: center; gap: 6px; box-shadow: 0 2px 4px rgba(0,0,0,0.12);
    transition: background .15s;
}
.btn-calc:hover { background: var(--yellow-hover); }

/* Buscador en cabecera (lupa) */
.nav-search { position: relative; }
.search-toggle {
    background: rgba(255,255,255,0.12); border: none; color: #fff; cursor: pointer;
    width: 38px; height: 38px; border-radius: 50%; font-size: 16px;
    display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.search-toggle:hover { background: rgba(255,255,255,0.25); }
.nav-search-panel {
    position: absolute; right: 0; top: 48px; width: 320px; max-width: 80vw;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-md); padding: 10px; display: none; z-index: 200;
}
.nav-search-panel.open { display: block; }
.nav-search-panel input {
    width: 100%; border: 1px solid var(--border); padding: 10px 12px;
    border-radius: var(--radius-sm); font-size: 15px; font-family: var(--font-body); outline: none;
}
.nav-search-panel input:focus { border-color: var(--navy-mid); }

/* Menú hamburguesa */
.menu-toggle {
    display: none; background: none; border: none; cursor: pointer;
    width: 40px; height: 40px; flex-direction: column; justify-content: center;
    align-items: center; gap: 5px; padding: 0;
}
.menu-toggle span { width: 24px; height: 2px; background: #fff; border-radius: 2px; transition: .25s; }
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Resultados de búsqueda */
.search-results {
    list-style: none; margin-top: 8px; max-height: 320px; overflow-y: auto;
}
.search-results li { border-top: 1px solid var(--border); }
.search-results li:first-child { border-top: none; }
.search-results a {
    display: block; padding: 10px 12px; text-decoration: none; color: var(--navy-mid);
    font-size: 14px; font-weight: 500; border-radius: var(--radius-sm); transition: background .12s;
}
.search-results a:hover { background: var(--navy-light); }
.search-results .res-cat { display: block; font-size: 11px; color: var(--text-mute); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.search-results .res-empty { padding: 12px; color: var(--text-mute); font-size: 14px; }

/* ----------------------------------- Hero ------------------------------- */
.hero {
    background: linear-gradient(180deg, var(--navy) 0%, var(--navy-mid) 100%);
    color: #fff; padding: 64px 20px 84px; text-align: center; position: relative;
}
.hero::after {
    content: ""; position: absolute; inset: 0; opacity: .06; pointer-events: none;
    background-image: radial-gradient(circle at 20% 30%, #fff 1px, transparent 1px),
                      radial-gradient(circle at 70% 60%, #fff 1px, transparent 1px);
    background-size: 60px 60px;
}
.hero-container { max-width: 800px; margin: 0 auto; position: relative; z-index: 1; }
.hero h1 { font-family: var(--font-heading); font-size: clamp(28px, 5vw, 42px); line-height: 1.2; margin-bottom: 16px; }
.hero p { color: #cbd5e1; font-size: clamp(15px, 2.5vw, 18px); margin-bottom: 32px; }

.search-box {
    background: #fff; padding: 6px; border-radius: var(--radius-md); display: flex;
    max-width: 600px; margin: 0 auto; box-shadow: 0 4px 12px rgba(0,0,0,0.15); position: relative;
}
.search-box input {
    flex-grow: 1; border: none; padding: 12px 16px; font-size: 16px;
    font-family: var(--font-body); outline: none; border-radius: var(--radius-md); color: var(--text);
}
.search-box button {
    background: var(--orange); color: #fff; border: none; padding: 0 24px; font-weight: 600;
    font-size: 16px; border-radius: var(--radius-md); cursor: pointer; transition: background .15s;
}
.search-box button:hover { background: var(--orange-hover); }
.hero .search-results {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0; background: #fff;
    border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md);
    text-align: left; padding: 6px; z-index: 50;
}
.hero .search-results:empty { display: none; }

/* --------------------------------- Layout ------------------------------- */
.main-layout {
    max-width: var(--maxw); margin: -40px auto 60px; padding: 0 20px;
    display: grid; grid-template-columns: 2fr 1fr; gap: 32px; align-items: start;
}
.stack { display: flex; flex-direction: column; gap: 32px; }

.content-section {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 40px; box-shadow: var(--shadow-sm);
}
.content-section h2 {
    font-family: var(--font-heading); color: var(--navy); font-size: 26px; margin-bottom: 8px;
    display: flex; align-items: center; gap: 12px;
}
.content-section .section-intro { color: var(--text-soft); font-size: 15px; margin-bottom: 20px; }

.article-card { border-bottom: 1px solid var(--border); padding: 22px 0; }
.article-card:last-child { border-bottom: none; padding-bottom: 0; }
.article-card a { text-decoration: none; }
.article-card h3 {
    font-family: var(--font-heading); color: var(--navy-mid); font-size: 19px; margin-bottom: 6px;
    transition: color .15s;
}
.article-card a:hover h3 { color: var(--orange); }
.article-card p { color: var(--text-soft); font-size: 14.5px; }
.article-card .read-more { color: var(--orange); font-weight: 600; font-size: 13px; display: inline-block; margin-top: 6px; }

/* --------------------------------- Sidebar ------------------------------ */
.sidebar { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 84px; }
.widget {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 24px; box-shadow: var(--shadow-sm);
}
.widget h3 {
    font-family: var(--font-heading); color: var(--navy); font-size: 18px; margin-bottom: 16px;
    display: flex; align-items: center; gap: 8px;
}
.widget-list { display: flex; flex-direction: column; gap: 12px; }
.widget-item {
    background: #f8fafc; border: 1px solid var(--border); padding: 12px 16px; border-radius: var(--radius-md);
    text-decoration: none; color: var(--navy-mid); font-weight: 500; font-size: 14px;
    display: flex; align-items: center; justify-content: space-between; gap: 8px; transition: .15s;
}
.widget-item:hover { background: var(--navy-light); border-color: #cbd5e1; transform: translateX(2px); }

/* Espacio reservado para AdSense */
.ad-banner {
    background: #edf2f7; border: 1px dashed #cbd5e1; padding: 22px; text-align: center;
    color: var(--text-mute); font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
    border-radius: var(--radius-md);
}
.ad-banner.in-article { margin: 36px 0; }

/* --------------------------- Página de artículo ------------------------- */
.article-wrap { max-width: 820px; margin: 0 auto; padding: 40px 20px 64px; }
.breadcrumb { font-size: 13px; color: var(--text-mute); margin-bottom: 20px; }
.breadcrumb a { color: var(--navy-mid); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.article-cat-tag {
    display: inline-block; background: var(--navy-light); color: var(--navy-mid);
    font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
    padding: 5px 12px; border-radius: 20px; margin-bottom: 16px;
}
.post {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 48px; box-shadow: var(--shadow-sm);
}
.post h1 { font-family: var(--font-heading); color: var(--navy); font-size: clamp(26px, 4vw, 34px); line-height: 1.25; margin-bottom: 16px; }
.post .meta { color: var(--text-mute); font-size: 13.5px; margin-bottom: 28px; border-bottom: 1px solid var(--border); padding-bottom: 20px; }
.post h2 { font-family: var(--font-heading); color: var(--navy); font-size: 23px; margin: 32px 0 14px; }
.post h3 { font-family: var(--font-heading); color: var(--navy-mid); font-size: 19px; margin: 24px 0 10px; }
.post p { color: var(--text); font-size: 16.5px; line-height: 1.7; margin-bottom: 16px; }
.post ul, .post ol { margin: 0 0 18px 22px; }
.post li { font-size: 16.5px; line-height: 1.7; margin-bottom: 8px; color: var(--text); }
.post strong { color: var(--navy); font-weight: 600; }
.post a { color: var(--orange); font-weight: 500; }
.post blockquote {
    background: var(--navy-light); border-left: 4px solid var(--orange);
    padding: 18px 22px; margin: 24px 0; border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-size: 16px; color: var(--navy); font-style: italic;
}
.disclaimer {
    background: #fff8ec; border: 1px solid #f4d99a; border-radius: var(--radius-md);
    padding: 16px 18px; font-size: 14px; color: #7a5a12; margin-bottom: 28px;
}
.disclaimer strong { color: #7a5a12; }

/* Navegación entre artículos */
.post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 36px; flex-wrap: wrap; }
.post-nav a {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 12px 18px; text-decoration: none; color: var(--navy-mid); font-weight: 500;
    font-size: 14px; flex: 1; min-width: 200px; transition: .15s;
}
.post-nav a:hover { border-color: var(--navy-mid); background: var(--navy-light); }
.post-nav .nav-label { display: block; font-size: 11px; color: var(--text-mute); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.post-nav .next { text-align: right; }

/* ---------------------------- Páginas legales --------------------------- */
.page-wrap { max-width: 820px; margin: 0 auto; padding: 40px 20px 64px; }
.page-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 48px; box-shadow: var(--shadow-sm);
}
.page-card h1 { font-family: var(--font-heading); color: var(--navy); font-size: clamp(26px, 4vw, 34px); margin-bottom: 8px; }
.page-card .updated { color: var(--text-mute); font-size: 13px; margin-bottom: 28px; }
.page-card h2 { font-family: var(--font-heading); color: var(--navy); font-size: 22px; margin: 30px 0 12px; }
.page-card h3 { font-family: var(--font-heading); color: var(--navy-mid); font-size: 18px; margin: 22px 0 10px; }
.page-card p { color: var(--text); font-size: 16px; line-height: 1.7; margin-bottom: 14px; }
.page-card ul { margin: 0 0 16px 22px; }
.page-card li { font-size: 16px; line-height: 1.7; margin-bottom: 8px; }
.page-card strong { color: var(--navy); }
.page-card a { color: var(--orange); }
.page-card table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14.5px; }
.page-card th, .page-card td { border: 1px solid var(--border); padding: 10px 12px; text-align: left; }
.page-card th { background: var(--navy-light); color: var(--navy); font-weight: 600; }

/* Quiénes somos: equipo */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; margin: 24px 0; }
.team-card { background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; }
.team-card .avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--navy-mid); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--font-heading); font-size: 20px; font-weight: 700; margin-bottom: 12px; }
.team-card h3 { font-size: 17px; margin: 0 0 2px; }
.team-card .role { color: var(--orange); font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.team-card p { font-size: 14px; color: var(--text-soft); line-height: 1.55; margin: 0; }

/* ---------------------------- Formulario contacto ----------------------- */
.contact-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: start; }
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-size: 14px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.form-field input, .form-field textarea {
    width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 12px 14px; font-size: 15px; font-family: var(--font-body); outline: none; color: var(--text);
    transition: border-color .15s;
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--navy-mid); }
.form-field textarea { min-height: 140px; resize: vertical; }
.form-check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; font-size: 14px; color: var(--text-soft); }
.form-check input { margin-top: 3px; width: 16px; height: 16px; flex-shrink: 0; }
.form-check a { color: var(--orange); }
.btn-submit {
    background: var(--orange); color: #fff; border: none; padding: 13px 28px; font-size: 15px;
    font-weight: 600; border-radius: var(--radius-md); cursor: pointer; transition: background .15s;
}
.btn-submit:hover { background: var(--orange-hover); }
.form-msg { margin-top: 16px; padding: 12px 16px; border-radius: var(--radius-md); font-size: 14px; display: none; }
.form-msg.ok { display: block; background: #e6f4ea; color: #1e6b3a; border: 1px solid #aed8bd; }
.form-msg.err { display: block; background: #fde8e8; color: #9b2c2c; border: 1px solid #f5b5b5; }
.contact-info { background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 24px; }
.contact-info h3 { font-family: var(--font-heading); color: var(--navy); font-size: 18px; margin-bottom: 12px; }
.contact-info p { font-size: 14.5px; color: var(--text-soft); line-height: 1.6; margin-bottom: 10px; }
.contact-info a { color: var(--orange); font-weight: 500; }

/* ----------------------------------- Footer ----------------------------- */
.site-footer { background: var(--navy); color: #cbd5e1; padding: 48px 20px 24px; margin-top: 40px; }
.footer-grid { max-width: var(--maxw); margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.footer-brand .brand-text { color: #fff; }
.footer-brand p { font-size: 14px; line-height: 1.6; margin-top: 12px; max-width: 320px; color: #9fb0c4; }
.footer-col h4 { color: #fff; font-family: var(--font-heading); font-size: 16px; margin-bottom: 14px; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer-col a { color: #b6c4d6; text-decoration: none; font-size: 14px; transition: color .15s; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
    max-width: var(--maxw); margin: 32px auto 0; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.12);
    display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 13px; color: #8fa1b6;
}

/* ------------------------------ Banner cookies -------------------------- */
.cookie-banner {
    position: fixed; bottom: 16px; left: 16px; right: 16px; max-width: 720px; margin: 0 auto;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md); padding: 20px 24px; z-index: 500; display: none;
    flex-wrap: wrap; align-items: center; gap: 16px;
}
.cookie-banner.show { display: flex; }
.cookie-banner p { font-size: 14px; color: var(--text-soft); flex: 1; min-width: 240px; line-height: 1.55; }
.cookie-banner p a { color: var(--orange); }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-btn { border: none; padding: 10px 18px; border-radius: var(--radius-md); font-size: 14px; font-weight: 600; cursor: pointer; }
.cookie-btn.accept { background: var(--orange); color: #fff; }
.cookie-btn.accept:hover { background: var(--orange-hover); }
.cookie-btn.reject { background: #edf2f7; color: var(--navy); }
.cookie-btn.reject:hover { background: #e2e8f0; }

/* --------------------------------- Utilidades --------------------------- */
.section-block { max-width: var(--maxw); margin: 0 auto 40px; padding: 0 20px; }
.section-title { font-family: var(--font-heading); color: var(--navy); font-size: 24px; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.section-sub { color: var(--text-soft); font-size: 15px; margin-bottom: 22px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.mini-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: 22px; text-decoration: none; transition: .15s; box-shadow: var(--shadow-sm);
}
.mini-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #cbd5e1; }
.mini-card h3 { font-family: var(--font-heading); color: var(--navy-mid); font-size: 17px; margin-bottom: 8px; }
.mini-card p { color: var(--text-soft); font-size: 14px; line-height: 1.55; }

/* ------------------------------ Media Queries --------------------------- */
@media (max-width: 968px) {
    .main-layout { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .contact-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .menu-toggle { display: flex; }
    .nav-links {
        position: fixed; top: 64px; right: 0; bottom: 0; width: 270px; max-width: 80vw;
        background: var(--navy); flex-direction: column; align-items: flex-start; gap: 4px;
        padding: 20px; transform: translateX(100%); transition: transform .28s ease;
        box-shadow: -8px 0 24px rgba(0,0,0,0.2); overflow-y: auto;
    }
    .nav-links.open { transform: translateX(0); }
    .nav-links a { display: block; width: 100%; padding: 12px 8px; border-radius: var(--radius-sm); }
    .nav-links a:hover { background: rgba(255,255,255,0.08); }
    .btn-calc { margin-top: 10px; }
}

@media (max-width: 600px) {
    .content-section, .post, .page-card { padding: 24px; }
    .footer-grid { grid-template-columns: 1fr; }
    .navbar { padding: 12px 16px; }
    .hero { padding: 48px 16px 72px; }
    .search-box { flex-direction: column; }
    .search-box button { padding: 12px; margin-top: 6px; }
    .post-nav a { min-width: 100%; }
}
