/* Plantillas Word — diseño portal de descargas (v2) */
:root {
    --ink: #0f172a;
    --ink-soft: #334155;
    --muted: #64748b;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --bg: #f8fafc;
    --bg-muted: #f1f5f9;
    --surface: #ffffff;
    --brand: #1d4ed8;
    --brand-light: #dbeafe;
    --brand-dark: #1e3a8a;
    --cta: #ea580c;
    --cta-hover: #c2410c;
    --cta-light: #ffedd5;
    --success: #059669;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.1);
    --font: system-ui, -apple-system, 'Segoe UI', sans-serif;
    --container: 1160px;
    --container-narrow: 720px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-gutter: stable; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.65;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { width: min(100% - 2rem, var(--container)); margin-inline: auto; }
.container-narrow { width: min(100% - 2rem, var(--container-narrow)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff; padding: .5rem 1rem; z-index: 9999; }
.skip-link:focus { left: 1rem; }

/* —— Topbar —— */
.topbar { background: var(--ink); color: #94a3b8; font-size: .78rem; }
.topbar-inner { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; justify-content: center; padding: .5rem 0; }
.topbar-item { white-space: nowrap; }

/* —— Header —— */
.site-header-shell {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}
.site-header { background: transparent; }
.header-row { display: flex; align-items: center; gap: 1rem; padding: .75rem 0; }
.header-bar { display: contents; }
.header-panel-mount { display: flex; flex: 1; min-width: 0; }
.logo { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: inherit; min-width: 0; flex-shrink: 0; }
.logo:hover { text-decoration: none; }
.logo-mark {
    width: 42px; height: 42px; border-radius: 11px;
    background: linear-gradient(145deg, #3b82f6, #1d4ed8);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.15rem; box-shadow: 0 4px 12px rgba(29, 78, 216, 0.35);
}
.logo-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.logo-text strong { font-size: 1.05rem; font-weight: 700; letter-spacing: -.02em; }
.logo-tagline { font-size: .72rem; color: var(--muted); }
.header-panel { display: flex; align-items: center; flex: 1; gap: 1rem; min-width: 0; }
.mobile-nav-head, .mobile-nav-backdrop, .mobile-nav-search { display: none; }
.site-nav { display: flex; align-items: center; flex: 1; gap: 1.35rem; justify-content: flex-end; flex-wrap: wrap; }
.site-nav a { color: var(--ink-soft); font-size: .9rem; font-weight: 500; text-decoration: none; }
.site-nav a:hover { color: var(--brand); text-decoration: none; }

.nav-dropdown { position: relative; display: inline-flex; align-items: center; }
.nav-dropdown::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: .5rem; }
.nav-dropdown-toggle {
    display: inline-flex; align-items: center; gap: .35rem; margin: 0; padding: 0;
    border: none; background: none; color: var(--ink-soft); font-family: inherit;
    font-size: .9rem; font-weight: 500; cursor: pointer; appearance: none;
}
.nav-dropdown-toggle:hover, .nav-dropdown.is-open .nav-dropdown-toggle { color: var(--brand); }
.nav-dropdown-chevron {
    width: .4rem; height: .4rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    transform: rotate(45deg); transition: transform .15s;
}
.nav-dropdown.is-open .nav-dropdown-chevron { transform: rotate(225deg); }
.nav-dropdown-menu {
    display: none; position: absolute; top: calc(100% + .45rem); left: 50%; transform: translateX(-50%);
    min-width: 16rem; margin: 0; padding: .4rem 0; list-style: none;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); z-index: 200;
    max-height: min(75vh, 24rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.nav-dropdown-menu a { display: block; padding: .55rem 1rem; color: var(--ink-soft); font-size: .88rem; text-decoration: none; }
.nav-dropdown-menu a:hover { background: var(--bg-muted); color: var(--brand); }
.nav-dropdown-menu--categories {
    left: 0;
    transform: none;
    width: 34rem;
    max-width: min(94vw, 34rem);
    padding: .5rem;
}
.nav-cat-link {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 2.5rem;
    padding: .45rem .65rem;
    border-radius: 8px;
    font-size: .82rem;
    line-height: 1.2;
    white-space: nowrap;
}
.nav-cat-emoji { flex-shrink: 0; width: 1.15rem; text-align: center; font-size: .95rem; }
.nav-cat-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-dropdown-all { border-top: 1px solid var(--line); margin-top: .35rem; padding-top: .35rem; }
.nav-dropdown-all a { font-weight: 600; color: var(--brand); min-height: 2.25rem; display: flex; align-items: center; padding: .45rem .65rem; }
@media (min-width: 961px) {
    .nav-dropdown-menu--categories {
        display: none;
        grid-template-columns: repeat(3, 1fr);
        gap: .15rem;
    }
    .nav-dropdown.is-open .nav-dropdown-menu--categories { display: grid; }
    .nav-dropdown-all { grid-column: 1 / -1; }
}
@media (min-width: 961px) and (hover: hover) {
    .nav-dropdown:hover .nav-dropdown-menu--categories { display: grid; }
}
@media (hover: hover) {
    .nav-dropdown:hover .nav-dropdown-menu:not(.nav-dropdown-menu--categories),
    .nav-dropdown:focus-within .nav-dropdown-menu:not(.nav-dropdown-menu--categories) { display: block; }
}
.nav-dropdown.is-open .nav-dropdown-menu:not(.nav-dropdown-menu--categories) { display: block; }

@media (min-width: 961px) {
    .mobile-nav-search { display: contents; }
    .mobile-nav-link { display: inline; padding: 0; border: none; font-size: inherit; font-weight: 500; }
    .nav-dropdown-toggle.mobile-nav-link {
        display: inline-flex;
        padding: 0;
        border: none;
        font-size: .9rem;
        font-weight: 500;
    }
}

.header-search {
    display: flex; flex: 0 1 280px; border: 1px solid var(--line); border-radius: 999px;
    overflow: hidden; background: var(--bg-muted); transition: border-color .15s, box-shadow .15s;
}
.header-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12); background: var(--surface); }
.header-search input { flex: 1; border: none; background: transparent; padding: .55rem 1rem; font: inherit; min-width: 0; outline: none; }
.header-search button {
    border: none; background: var(--brand); color: #fff; padding: 0 1rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.header-search button:hover { background: var(--brand-dark); }

.nav-toggle {
    display: none; flex-direction: column; justify-content: center; gap: 5px;
    background: none; border: none; padding: .5rem; cursor: pointer; margin-left: auto;
    flex-shrink: 0; border-radius: var(--radius);
}
.nav-toggle:hover { background: var(--bg-muted); }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 1px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
body.mobile-nav-open { overflow: hidden; }

/* —— Breadcrumb —— */
.breadcrumb { background: var(--surface); border-bottom: 1px solid var(--line); font-size: .84rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: 0; padding: .65rem 0; }
.breadcrumb li:not(:last-child)::after { content: '/'; margin-left: .4rem; color: var(--line-strong); }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }

/* —— Hero portal (home) —— */
.hero-portal {
    padding: 3.25rem 0 2.75rem;
    background: radial-gradient(ellipse 90% 70% at 50% -20%, #dbeafe 0%, transparent 55%), var(--bg);
}
.hero-portal-inner { display: grid; grid-template-columns: 1.15fr .85fr; gap: 2.5rem; align-items: center; }
.hero-kicker { margin: 0 0 .6rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--brand); }
.hero-portal h1 {
    margin: 0 0 1rem; font-size: clamp(2rem, 4.5vw, 2.9rem); line-height: 1.08;
    font-weight: 800; letter-spacing: -.035em; color: var(--ink);
}
.hero-lead { margin: 0 0 1.6rem; font-size: 1.08rem; color: var(--ink-soft); max-width: 34rem; }
.hero-search { display: flex; gap: .5rem; margin-bottom: 1.25rem; max-width: 520px; }
.hero-search input {
    flex: 1; border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem;
    font: inherit; background: var(--surface); box-shadow: var(--shadow); outline: none;
}
.hero-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12); }
.hero-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.hero-chip {
    display: inline-block; padding: .35rem .85rem; border-radius: 999px; font-size: .82rem; font-weight: 500;
    background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); text-decoration: none;
}
.hero-chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); text-decoration: none; }

/* Doc stack visual */
.doc-stack { position: relative; width: 280px; height: 320px; margin: 0 auto; }
.doc-stack-sheet { position: absolute; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.doc-stack-3 { width: 220px; height: 280px; top: 20px; left: 30px; transform: rotate(-6deg); opacity: .5; }
.doc-stack-2 { width: 230px; height: 290px; top: 12px; left: 22px; transform: rotate(-2deg); opacity: .75; }
.doc-stack-1 { width: 240px; height: 300px; top: 0; left: 14px; padding: 1.25rem; }
.doc-stack-bar { height: 8px; border-radius: 4px; background: var(--brand); margin-bottom: 1.25rem; }
.doc-stack-line { height: 8px; border-radius: 4px; background: var(--bg-muted); margin-bottom: .65rem; }
.doc-stack-line.w90 { width: 90%; } .doc-stack-line.w75 { width: 75%; } .doc-stack-line.w85 { width: 85%; } .doc-stack-line.w60 { width: 60%; }
.doc-stack-badge {
    position: absolute; bottom: 1rem; right: 1rem; background: var(--cta-light); color: var(--cta);
    font-size: .75rem; font-weight: 800; padding: .25rem .6rem; border-radius: 6px;
}

/* —— Stats strip —— */
.stats-strip { background: var(--surface); border-bottom: 1px solid var(--line); }
.stats-strip-inner { display: flex; flex-wrap: wrap; justify-content: center; gap: 2rem 3rem; padding: 1.1rem 0; }
.stat-item { text-align: center; }
.stat-item strong { display: block; font-size: 1.35rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.stat-item span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

/* —— Buttons —— */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .7rem 1.35rem; border-radius: var(--radius); font-weight: 600; font-size: .92rem;
    text-decoration: none; border: none; cursor: pointer; font-family: inherit; transition: background .15s, transform .1s;
}
.btn:hover { text-decoration: none; }
.btn-download { background: var(--cta-hover); color: #fff; box-shadow: 0 4px 14px rgba(194, 65, 12, 0.35); }
.btn-download:hover { background: #9a3412; color: #fff; transform: translateY(-1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn-block { width: 100%; }
.btn-lg { padding: .9rem 1.5rem; font-size: 1rem; }
.btn-sm { padding: .45rem .9rem; font-size: .84rem; }

/* —— Sections —— */
.section { padding: 3.25rem 0; }
.section-muted { background: var(--bg-muted); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.section-head-center { flex-direction: column; align-items: center; text-align: center; }
.section-head h2 { margin: 0 0 .35rem; font-size: 1.65rem; font-weight: 800; letter-spacing: -.03em; }
.section-head p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.link-arrow { font-weight: 600; font-size: .92rem; color: var(--brand); text-decoration: none; white-space: nowrap; }
.link-arrow:hover { text-decoration: underline; }
.ad-wrap-top { padding: 1.5rem 0 0; }

/* —— Document cards —— */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.doc-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    overflow: hidden; transition: box-shadow .2s, transform .2s, border-color .2s;
}
.doc-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); border-color: var(--line-strong); }
.doc-card-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }
.doc-card-link:hover { text-decoration: none; }
.doc-card-preview {
    position: relative; aspect-ratio: 4/5;
    background: linear-gradient(165deg, #eef2f7 0%, #e2e8f0 100%);
    overflow: hidden; display: flex; align-items: center; justify-content: center;
    padding: .85rem 1rem 1.1rem;
}
.doc-card-preview img {
    width: 100%; height: 100%; object-fit: contain;
    filter: drop-shadow(0 10px 22px rgba(15, 23, 42, .14));
}
.doc-card-format {
    position: absolute; top: .6rem; right: .6rem; background: var(--ink); color: #fff;
    font-size: .65rem; font-weight: 800; letter-spacing: .05em; padding: .2rem .5rem; border-radius: 5px;
}
.doc-card-body { padding: 1rem 1.1rem .75rem; flex: 1; }
.doc-card-cat { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); }
.doc-card-body h3 { margin: .3rem 0 .45rem; font-size: 1rem; font-weight: 700; line-height: 1.35; letter-spacing: -.02em; }
.doc-card-body p { margin: 0; font-size: .86rem; color: var(--ink-soft); line-height: 1.45; }
.doc-card-foot { display: flex; align-items: center; gap: .75rem; margin-top: .65rem; font-size: .78rem; color: var(--muted); }
.doc-card-dl { display: inline-flex; align-items: center; gap: .25rem; }
.doc-card-cta {
    display: block; text-align: center; padding: .7rem; background: var(--bg-muted);
    border-top: 1px solid var(--line); font-size: .88rem; font-weight: 700; color: #9a3412;
}
.doc-card:hover .doc-card-cta { background: var(--cta-light); }
.doc-card.is-filtered-out, .template-card.is-filtered-out { display: none; }

/* —— Category tiles —— */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.cat-tile {
    display: block; padding: 1.35rem; background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); text-decoration: none; color: inherit; transition: box-shadow .2s, border-color .2s;
}
.cat-tile:hover { box-shadow: var(--shadow); border-color: var(--brand); text-decoration: none; }
.cat-tile-icon { font-size: 1.75rem; display: block; margin-bottom: .6rem; }
.cat-tile h3 { margin: 0 0 .4rem; font-size: 1rem; font-weight: 700; }
.cat-tile p { margin: 0 0 .75rem; font-size: .84rem; color: var(--muted); line-height: 1.4; }
.cat-tile-count { font-size: .78rem; font-weight: 600; color: var(--brand); }

/* —— Steps —— */
.steps-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.step-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.5rem; text-align: center; }
.step-num {
    display: inline-flex; width: 36px; height: 36px; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; font-size: .95rem; margin-bottom: .75rem;
}
.step-card h3 { margin: 0 0 .4rem; font-size: 1rem; }
.step-card p { margin: 0; font-size: .88rem; color: var(--muted); }

/* —— Prose blocks —— */
.prose-block { max-width: 68ch; color: var(--ink-soft); font-size: 1.02rem; }
.prose-block h2 { color: var(--ink); font-size: 1.35rem; margin-top: 0; }
.prose-block p { margin: 0 0 1rem; }
.seo-blocks { display: grid; gap: 1.25rem; }
.seo-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.5rem; }
.seo-block h2 { margin: 0 0 .5rem; font-size: 1.1rem; }
.seo-block p { margin: 0; color: var(--muted); font-size: .92rem; }

/* —— Guides —— */
.guide-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.guide-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.35rem; }
.guide-tile h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.guide-tile h3 a { color: inherit; text-decoration: none; }
.guide-tile h3 a:hover { color: var(--brand); }
.guide-tile p { margin: 0 0 .75rem; font-size: .9rem; color: var(--muted); }
.guide-tile-link { font-size: .88rem; font-weight: 600; }

/* —— Page hero (listing) —— */
.page-hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 2.25rem 0; }
.page-hero h1 { margin: 0 0 .4rem; font-size: clamp(1.6rem, 3vw, 2.1rem); font-weight: 800; letter-spacing: -.03em; }
.page-hero p { margin: 0; color: var(--ink-soft); font-size: 1.02rem; }

.listing-layout { display: grid; grid-template-columns: 1fr 260px; gap: 2rem; padding: 2rem 0 3rem; align-items: start; }
.listing-main { min-width: 0; }
.listing-intro { margin-bottom: 1.25rem; }

/* —— Listing toolbar —— */
.listing-toolbar {
    margin-bottom: 1.25rem; padding: 1rem; background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius-lg);
}
.listing-search { display: flex; gap: .4rem; margin-bottom: .85rem; }
.listing-search input { flex: 1; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .85rem; font: inherit; }
.listing-search button { border: none; background: var(--brand); color: #fff; border-radius: var(--radius); padding: 0 .9rem; cursor: pointer; }
.listing-filters { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .6rem; }
.listing-pill {
    display: inline-flex; align-items: center; gap: .35rem; padding: .38rem .8rem;
    border: 1px solid var(--line); border-radius: 999px; background: var(--bg);
    color: var(--ink-soft); font: inherit; font-size: .8rem; font-weight: 500; cursor: pointer; text-decoration: none;
}
.listing-pill:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.listing-pill.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.listing-pill-count { font-size: .72rem; font-weight: 700; padding: .05rem .35rem; border-radius: 999px; background: rgba(0,0,0,.08); }
.listing-pill.is-active .listing-pill-count { background: rgba(255,255,255,.25); }
.listing-results-meta { margin: 0; font-size: .86rem; color: var(--muted); }
.listing-section-title { margin: 0 0 1rem; font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; }
.listing-empty-filter { margin: 0 0 1rem; padding: .75rem 1rem; background: var(--cta-light); border-radius: var(--radius); color: var(--cta-hover); font-size: .9rem; }

/* —— Detail page —— */
.doc-detail-hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 2rem 0; }
.doc-detail-hero-inner { display: grid; grid-template-columns: 1fr 300px; gap: 2rem; align-items: start; }
.doc-detail-breadcrumb { margin: 0 0 .5rem; font-size: .85rem; font-weight: 600; }
.doc-detail-breadcrumb a { color: var(--brand); text-decoration: none; }
.doc-detail-hero h1 { margin: 0 0 .75rem; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.doc-detail-lead { margin: 0 0 1rem; color: var(--ink-soft); font-size: 1.05rem; }
.doc-detail-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { font-size: .75rem; font-weight: 600; padding: .28rem .65rem; border-radius: 999px; background: var(--bg-muted); color: var(--ink-soft); }
.tag-free { background: #dcfce7; color: #166534; }
.tag-muted { color: var(--ink-soft); }

.doc-download-panel { position: sticky; top: 5.5rem; }
.doc-download-panel-inner {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 1.25rem; box-shadow: var(--shadow-lg);
}
.doc-download-panel-preview {
    border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem;
    border: 1px solid var(--line); background: linear-gradient(165deg, #eef2f7, #e2e8f0);
    padding: .85rem;
}
.doc-download-panel-preview img {
    width: 100%; height: auto; display: block; object-fit: contain;
    filter: drop-shadow(0 8px 18px rgba(15, 23, 42, .12));
}
.doc-download-meta { list-style: none; margin: 1rem 0 0; padding: 0; font-size: .84rem; color: var(--muted); }
.doc-download-meta li { margin-bottom: .35rem; }
.doc-download-meta strong { color: var(--ink-soft); }

.doc-detail-layout { display: grid; grid-template-columns: 1fr 260px; gap: 2rem; padding: 2rem 0 3rem; align-items: start; }
.doc-detail-content { min-width: 0; }
.doc-detail-content h2 { font-size: 1.25rem; font-weight: 700; margin: 2rem 0 .75rem; }
.doc-detail-content h2:first-child { margin-top: 0; }
.doc-detail-note { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--ink-soft); }
.doc-detail-aside { position: sticky; top: 5.5rem; }
.aside-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.15rem; margin-bottom: 1rem; }
.aside-box .aside-heading,
.aside-box h2 { margin: 0 0 .65rem; font-size: .92rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.aside-links { list-style: none; margin: 0; padding: 0; }
.aside-links li { margin-bottom: .35rem; }
.aside-links a { font-size: .88rem; color: var(--ink-soft); text-decoration: none; }
.aside-links a:hover { color: var(--brand); }

/* Sidebar (listing) */
.sidebar { position: sticky; top: 5.5rem; }
.sidebar-box, .trust-box {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 1.15rem; margin-bottom: 1rem;
}
.sidebar-heading { margin: 0 0 .65rem; font-size: .92rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sidebar-links { list-style: none; margin: 0; padding: 0; }
.sidebar-links li { margin-bottom: .35rem; }
.sidebar-links a { font-size: .88rem; color: var(--ink-soft); text-decoration: none; }
.trust-box ul { margin: 0; padding-left: 1rem; font-size: .86rem; color: var(--muted); }

/* Download specs */
.download-specs {
    background: var(--bg-muted); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 1.25rem; margin: 2rem 0;
}
.download-specs h2 { margin: 0 0 .75rem; font-size: 1.1rem; }
.download-specs-intro { margin: 0 0 .85rem; font-size: .9rem; color: var(--ink-soft); }
.download-specs a {
    color: var(--brand-dark);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.download-specs a:hover { color: var(--brand); }
.download-format-note {
    margin: 0 0 1rem; padding: .75rem 1rem; font-size: .88rem; background: var(--surface);
    border-left: 3px solid var(--cta); border-radius: 0 var(--radius) var(--radius) 0;
}
.download-specs-grid { display: grid; gap: 1rem; }
@media (min-width: 560px) { .download-specs-grid { grid-template-columns: 1fr 1fr; } }
.download-specs-item dt { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); margin-bottom: .2rem; }
.download-specs-item dd { margin: 0; font-size: .92rem; color: var(--ink); }
.download-specs-item code { font-size: .82em; background: var(--surface); padding: .1rem .35rem; border-radius: 4px; }
.download-specs-meta { color: var(--ink-soft); font-size: .86rem; }
.compat-list { margin: 0; padding-left: 1.1rem; font-size: .86rem; color: var(--ink-soft); }

/* FAQ */
.faq-section-title { text-align: center; margin: 0 0 1.5rem; font-size: 1.5rem; font-weight: 800; }
.faq-list { display: flex; flex-direction: column; gap: .5rem; }
.faq-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 1.1rem; }
.faq-item summary { cursor: pointer; font-weight: 600; padding: .9rem 0; list-style: none; font-size: .95rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item p { margin: 0 0 1rem; color: var(--ink-soft); font-size: .92rem; }

/* Ratings */
.template-rating { margin: 1.5rem 0; padding: 1.25rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg-muted); }
.template-rating h2 { margin: 0 0 .35rem; font-size: 1.05rem; }
.template-rating-intro { margin: 0 0 1rem; color: var(--ink-soft); font-size: .88rem; }
.template-rating-summary { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.template-rating-average { font-size: 2rem; font-weight: 800; }
.template-rating-average-max { color: var(--ink-soft); font-weight: 600; }
.template-rating-star-btn { background: none; border: none; font-size: 1.75rem; cursor: pointer; color: #78716c; padding: .1rem; }
.template-rating-star-btn.is-active, .template-rating-star-btn.is-hover { color: #b45309; }
.template-star-full, .template-star-half { color: #b45309; }
.template-star-empty { color: #78716c; }
.meta-pill.meta-rating { color: #b45309; background: #fffbeb; }

/* Ads — display responsive (auto), tamaño generoso para mejor CTR */
.ad-slot { margin: 1.75rem 0; width: 100%; }
.ad-slot ins.adsbygoogle { display: block; width: 100%; min-height: inherit; }
.ad-placeholder {
    min-height: 120px; background: repeating-linear-gradient(-45deg, #f1f5f9, #f1f5f9 8px, #e8ecf0 8px, #e8ecf0 16px);
    border: 1px dashed var(--line-strong); border-radius: var(--radius);
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem;
    color: var(--muted); font-size: .78rem; text-align: center; padding: 1rem;
}
.ad-in_content .ad-placeholder, .ad-in_content { min-height: 320px; }
.ad-in_content ins.adsbygoogle { min-height: 320px; }
.ad-detail_top .ad-placeholder, .ad-detail_top { min-height: 320px; margin-top: 1.25rem; }
.ad-detail_top ins.adsbygoogle { min-height: 320px; }
.doc-detail-main .ad-slot { margin-bottom: 0; }
.ad-detail_mid .ad-placeholder, .ad-detail_mid { min-height: 300px; }
.ad-detail_mid ins.adsbygoogle { min-height: 300px; }
.ad-sidebar .ad-placeholder, .ad-sidebar { min-height: 300px; }
.ad-sidebar ins.adsbygoogle { min-height: 300px; }
.ad-listing_end .ad-placeholder, .ad-listing_end { min-height: 280px; }
.ad-listing_end ins.adsbygoogle { min-height: 280px; }
.ad-download_gate .ad-placeholder, .ad-download_gate { min-height: 280px; }
.ad-download_gate ins.adsbygoogle { min-height: 280px; }
.ad-wrap-top .ad-slot { margin-top: 0; }

/* Search page */
.search-page { padding: 2rem 0 3rem; }
.search-hero-summary { margin: 0 0 1rem; color: var(--muted); font-size: 1rem; }
.search-form { display: flex; gap: .5rem; margin-top: 1rem; max-width: 560px; }
.search-form input {
    flex: 1; padding: .75rem 1rem; border: 1px solid var(--line); border-radius: var(--radius);
    font: inherit; background: var(--surface);
}
.search-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.12); }
.search-section-header { margin: 0 0 1rem; }
.search-section-header-spaced { margin-top: 2.25rem; }
.search-section-header h2 { margin: 0; font-size: 1.15rem; font-weight: 700; letter-spacing: -.02em; }
.search-section-count { font-weight: 600; color: var(--muted); font-size: .95rem; }
.search-results-grid { margin-bottom: .5rem; }
/* Legacy alias — algunas vistas antiguas usaban template-grid */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.25rem; }
.empty-state { padding: 2.5rem; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius-lg); border: 1px dashed var(--line); }

/* Footer */
.site-footer { background: var(--ink); color: #94a3b8; margin-top: 2rem; padding: 3rem 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 2rem; padding-bottom: 2rem; }
.footer-brand .logo-mark { width: 36px; height: 36px; font-size: 1rem; margin-bottom: .75rem; }
.site-footer h3 { color: #f1f5f9; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 .85rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .4rem; }
.site-footer a { color: #94a3b8; font-size: .88rem; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-eeat { font-size: .84rem; line-height: 1.55; max-width: 32ch; }
.footer-categories {
    border-top: 1px solid #1e293b;
    padding: 1.75rem 0 2rem;
}
.footer-categories h3 { margin-bottom: 1rem; }
.footer-cat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .45rem 1rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-cat-grid a {
    display: block;
    font-size: .82rem;
    line-height: 1.35;
    padding: .2rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.footer-bottom { border-top: 1px solid #1e293b; padding: 1rem 0; font-size: .82rem; text-align: center; color: #94a3b8; }

/* Download gate */
body.download-gate-open { overflow: hidden; }
.download-gate { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.download-gate[hidden] { display: none !important; }
.download-gate-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.75); backdrop-filter: blur(6px); }
.download-gate-panel {
    position: relative; z-index: 1; width: min(100%, 440px); background: var(--surface);
    border-radius: var(--radius-lg); padding: 1.75rem; box-shadow: var(--shadow-lg); text-align: center;
}
.download-gate-close { position: absolute; top: .75rem; right: .75rem; width: 34px; height: 34px; border: none; background: var(--bg-muted); border-radius: 50%; font-size: 1.3rem; cursor: pointer; color: var(--muted); }
.download-gate-title { margin: 0 0 .35rem; font-size: 1.3rem; font-weight: 800; }
.download-gate-name { color: var(--muted); font-size: .92rem; margin: 0 0 1rem; }
.download-gate-ad { margin-bottom: 1rem; min-height: 250px; }
.download-gate-countdown { font-size: 3rem; font-weight: 800; color: var(--cta); font-variant-numeric: tabular-nums; }
.download-gate-funding { font-size: .8rem; color: var(--muted); margin: 1rem 0; }
.download-gate-actions { display: flex; flex-direction: column; gap: .5rem; }

/* Cookie consent */
html.cookie-consent-open { overflow: hidden; }
.cookie-consent { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.cookie-consent[hidden] { display: none !important; }
.cookie-consent-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.55); }
.cookie-consent-panel { position: relative; width: min(100%, 42rem); background: var(--surface); border-radius: var(--radius-lg); padding: 1.35rem; box-shadow: var(--shadow-lg); }
.cookie-consent-title { margin: 0 0 .5rem; font-size: 1.15rem; font-weight: 700; }
.cookie-consent-intro { margin: 0 0 1rem; color: var(--muted); font-size: .9rem; }
.cookie-consent-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; }

.hidden { display: none !important; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; overflow: hidden; }

/* Guide / static pages legacy */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.25rem; }
.guide-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.35rem; }
.guide-card h3 { margin: 0 0 .5rem; font-size: 1.05rem; line-height: 1.35; }
.guide-card h3 a { color: inherit; text-decoration: none; }
.guide-card h3 a:hover { color: var(--brand); }
.guide-card p { margin: 0 0 .75rem; font-size: .9rem; color: var(--muted); line-height: 1.45; }
.guide-card .link-more { font-size: .88rem; font-weight: 600; color: var(--brand); text-decoration: none; }
.guide-card .link-more:hover { text-decoration: underline; }
.page-header { background: var(--surface); border-bottom: 1px solid var(--line); padding: 2rem 0; }
.page-header h1 { margin: 0 0 .4rem; font-weight: 800; }
.prose h2 { font-size: 1.25rem; margin-top: 2rem; }
.keyword-tag { display: inline-block; font-size: .75rem; padding: .2rem .55rem; margin: 0 .3rem .3rem 0; background: var(--brand-light); color: var(--brand-dark); border-radius: 999px; }

/* Responsive */
@media (max-width: 960px) {
    .doc-detail-hero-inner, .doc-detail-layout, .listing-layout { grid-template-columns: 1fr; }
    .doc-download-panel, .doc-detail-aside, .sidebar { position: static; }
    .steps-row { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
    .footer-cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
    .footer-cat-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
    .header-row {
        display: block;
        padding: .55rem 0;
    }
    .header-bar {
        display: flex;
        align-items: center;
        gap: .75rem;
    }
    .header-panel-mount {
        display: block;
        flex: none;
    }
    .logo { flex: 1; min-width: 0; }
    .logo-tagline { display: none; }
    .nav-toggle { display: flex; }

    .mobile-nav-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 10040;
        background: rgba(15, 23, 42, 0.5);
    }
    .mobile-nav-backdrop.is-visible { display: block; }

    .header-panel {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 10050;
        width: 100%;
        max-width: none;
        height: 100%;
        height: 100dvh;
        flex: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin: 0;
        padding:
            env(safe-area-inset-top, 0)
            env(safe-area-inset-right, 0)
            env(safe-area-inset-bottom, 0)
            env(safe-area-inset-left, 0);
        background: var(--surface);
        box-shadow: none;
        transform: none;
        overflow: hidden;
    }
    .header-panel.is-open { display: flex; }

    .mobile-nav-head {
        display: grid;
        grid-template-columns: 2.5rem 1fr 2.5rem;
        align-items: center;
        flex-shrink: 0;
        gap: .5rem;
        padding: .85rem 1rem;
        border-bottom: 1px solid var(--line);
        background: var(--surface);
    }
    .mobile-nav-back { grid-column: 1; }
    .mobile-nav-title {
        grid-column: 2;
        font-weight: 700;
        font-size: 1.05rem;
        color: var(--ink);
        text-align: center;
    }
    .mobile-nav-close { grid-column: 3; justify-self: end; }
    .mobile-nav-back,
    .mobile-nav-close {
        width: 2.5rem; height: 2.5rem; border: none; border-radius: 50%;
        background: var(--bg-muted); color: var(--ink-soft);
        font-size: 1.25rem; line-height: 1; cursor: pointer;
        display: flex; align-items: center; justify-content: center;
        flex-shrink: 0;
    }
    .mobile-nav-back[hidden] { display: none !important; }
    .mobile-nav-close { font-size: 1.5rem; }

    .site-nav {
        flex: 1;
        min-height: 0;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        width: 100%;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding: .25rem 1rem 1rem;
    }
    .mobile-nav-link,
    .site-nav > a,
    .nav-dropdown-toggle.mobile-nav-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: .95rem 0;
        border-bottom: 1px solid var(--line);
        font-size: 1.02rem;
        font-weight: 600;
        color: var(--ink);
        text-align: left;
        background: none;
        border-left: none;
        border-right: none;
        border-top: none;
        cursor: pointer;
    }
    .nav-dropdown-toggle.mobile-nav-link .nav-dropdown-chevron {
        width: .5rem;
        height: .5rem;
        margin-right: .15rem;
        opacity: .75;
    }
    .nav-dropdown {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    .nav-dropdown::after { display: none; }

    /* Vista principal: categorías ocultas */
    .header-panel:not(.mobile-nav-show-cats) .mobile-nav-cats {
        display: none !important;
    }

    /* Vista categorías: pantalla dedicada con lista scroll */
    .header-panel.mobile-nav-show-cats .site-nav > a,
    .header-panel.mobile-nav-show-cats .nav-dropdown-toggle {
        display: none !important;
    }
    .header-panel.mobile-nav-show-cats .mobile-nav-search {
        display: none;
    }
    .header-panel.mobile-nav-show-cats .site-nav {
        padding: 0;
        overflow: hidden;
    }
    .header-panel.mobile-nav-show-cats .nav-dropdown {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }
    .header-panel.mobile-nav-show-cats .mobile-nav-cats {
        display: flex !important;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        margin: 0;
        padding: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        background: var(--surface);
        border: none;
        box-shadow: none;
        width: 100%;
        max-width: none;
        max-height: none;
        list-style: none;
    }
    .mobile-nav-cats li { margin: 0; }
    .mobile-nav-cats .nav-cat-link {
        display: flex;
        align-items: center;
        gap: .75rem;
        min-height: 3rem;
        padding: .75rem 1rem;
        margin: 0;
        border: none;
        border-bottom: 1px solid var(--line);
        border-radius: 0;
        background: var(--surface);
        font-size: .96rem;
        font-weight: 500;
        color: var(--ink-soft);
        white-space: nowrap;
        text-decoration: none;
    }
    .mobile-nav-cats .nav-cat-link:active,
    .mobile-nav-cats .nav-cat-link:hover {
        color: var(--brand);
        background: var(--bg-muted);
        text-decoration: none;
    }
    .mobile-nav-cats .nav-cat-emoji {
        width: 1.5rem;
        font-size: 1.1rem;
        text-align: center;
        flex-shrink: 0;
    }
    .mobile-nav-cats .nav-cat-label {
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .mobile-nav-cats .nav-dropdown-all {
        border-top: 1px solid var(--line);
        margin-top: 0;
        padding-top: 0;
        flex-shrink: 0;
        position: sticky;
        bottom: 0;
        background: var(--bg-muted);
    }
    .mobile-nav-cats .nav-dropdown-all a {
        display: flex;
        align-items: center;
        min-height: 3rem;
        padding: .75rem 1rem;
        font-weight: 600;
        color: var(--brand);
        font-size: .95rem;
        text-decoration: none;
    }

    .nav-dropdown-menu,
    .nav-dropdown-menu--categories {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
    }
    .nav-dropdown:hover .nav-dropdown-menu { display: none; }

    .mobile-nav-search {
        display: block;
        flex-shrink: 0;
        padding: .85rem 1rem calc(.85rem + env(safe-area-inset-bottom, 0));
        border-top: 1px solid var(--line);
        background: var(--bg-muted);
    }
    .mobile-nav-search .header-search {
        width: 100%;
        flex: none;
        margin: 0;
        background: var(--surface);
    }

    .hero-portal-inner { grid-template-columns: 1fr; }
    .hero-portal-visual { display: none; }
    .topbar-inner { gap: .35rem .85rem; font-size: .72rem; }
}
