/* ============================================================
   Epatec · Zona de descargas
   Estilo alineado con las fichas de producto de la tienda
   ============================================================ */

@font-face {
    font-family: "Source Sans 3";
    src: url("fonts/SourceSans3-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Source Sans 3";
    src: url("fonts/SourceSans3-Semibold.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Source Sans 3";
    src: url("fonts/SourceSans3-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

:root {
    --brand:        #154889;
    --brand-dark:   #10386B;
    --brand-tint:   #E8EEF5;
    --brand-ring:   rgba(21, 72, 137, .18);

    --ink:          #14181F;   /* títulos */
    --text:         #2B323C;   /* texto */
    --muted:        #5E6773;   /* texto secundario */
    --faint:        #8B939E;
    --line:         #E1E5EB;
    --band:         #F3F5F8;   /* franjas grises (hero, ayuda, pie) */
    --head:         #EDF0F4;   /* cabecera de grupo */
    --surface:      #FFFFFF;

    --radius-lg:    16px;
    --radius:       12px;
    --radius-sm:    8px;

    --font: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--surface);
    color: var(--text);
    font: 16px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a { color: var(--brand); }

.wrap {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ---------- Botones ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    padding: 0 18px;
    border-radius: var(--radius-sm);
    font: 700 15px/1 var(--font);
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s, color .15s, border-color .15s;
}
.btn-solid {
    border: 1.5px solid var(--brand);
    background: var(--brand);
    color: #fff;
}
.btn-solid:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-outline {
    border: 1.5px solid var(--brand);
    background: var(--surface);
    color: var(--brand);
}
.btn-outline:hover { background: var(--brand); color: #fff; }
.btn-lg { height: 56px; padding: 0 48px; font-size: 17px; }
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--brand-ring);
}

/* ---------- Cabecera ---------- */

.site-header {
    position: relative;
    z-index: 10;
    background: linear-gradient(to bottom, #FFFFFF 0%, #F0F1F2 100%);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}

/* Logo + menú agrupados en el centro, teléfono a la derecha (como epatec.es) */
.header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 64px;
    padding: 0 28px;
}
.header-center {
    grid-column: 2;
    display: flex;
    align-items: center;
    gap: 40px;
    min-width: 0;
}
.logo { display: inline-flex; flex: none; }
.logo img { display: block; height: 36px; width: auto; }

.main-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    min-width: 0;
}
.main-nav a {
    color: #4A4A4A;
    font-size: 17px;
    font-weight: 400;
    text-decoration: none;
    white-space: nowrap;
    transition: color .15s;
}
.main-nav a:hover,
.main-nav a.is-active { color: var(--brand); }

.phone {
    grid-column: 3;
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4A4A4A;
    font-size: 15px;
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}
.phone svg { color: #555; }
.phone:hover,
.phone:hover svg { color: var(--brand); }

/* ---------- Hero (franja gris, como la de características) ---------- */

.hero {
    background: var(--band);
    padding: 56px 0 52px;
}

.section-title {
    margin: 0 0 22px;
    color: var(--ink);
    font-size: 34px;
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -.005em;
}
.section-title::after {
    content: "";
    display: block;
    width: 44px;
    height: 3px;
    margin-top: 14px;
    border-radius: 2px;
    background: var(--brand);
}
.lead {
    margin: 0;
    max-width: 640px;
    font-size: 18px;
    color: var(--muted);
}

/* ---------- Tarjeta principal ---------- */

main.wrap { flex: 1; padding-top: 40px; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 32px 36px 36px;
}

.toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.search {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}
.search svg {
    position: absolute;
    left: 14px;
    color: var(--faint);
    pointer-events: none;
}
.search input {
    width: 100%;
    height: 44px;
    padding: 0 44px 0 42px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    transition: border-color .15s, box-shadow .15s;
}
.search input::placeholder { color: var(--faint); }
.search input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}
.search kbd {
    position: absolute;
    right: 12px;
    padding: 0 7px;
    border: 1px solid var(--line);
    border-radius: 4px;
    font: 600 12px/20px var(--font);
    color: var(--faint);
    background: var(--band);
}
.search input:focus ~ kbd,
.search input:not(:placeholder-shown) ~ kbd { display: none; }

.status {
    font-size: 14px;
    color: var(--muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.toolbar .btn { height: 44px; }

/* ---------- Árbol (mismo lenguaje que las tablas de especificaciones) ---------- */

.tree {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.folder + .folder,
.folder + .files,
.files + .folder { border-top: 1px solid var(--line); }

.folder > summary {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background-color .15s;
}
.folder > summary::-webkit-details-marker { display: none; }
.folder > summary:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
}

/* Flecha */
.folder > summary::after {
    content: "";
    order: 3;
    flex: none;
    width: 8px;
    height: 8px;
    margin: 0 4px 3px 4px;
    border-right: 2px solid var(--brand);
    border-bottom: 2px solid var(--brand);
    transform: rotate(45deg);
    transition: transform .2s;
}
.folder[open] > summary::after { transform: translateY(3px) rotate(-135deg); }

.folder-name { flex: 1; min-width: 0; }

/* Nivel 1: cabecera gris con filete azul (como "System & Architecture") */
.folder.level-0 > summary {
    min-height: 56px;
    padding: 12px 20px 12px 18px;
    background: var(--head);
    box-shadow: inset 4px 0 0 var(--brand);
    color: var(--ink);
    font-weight: 700;
}
.folder.level-0 > summary:hover { background: #E4E9EF; }

/* Nivel 2+: etiqueta azul en negrita (como "Processor Options") */
.folder.level-1 > summary {
    min-height: 52px;
    padding: 10px 20px;
    color: var(--brand);
    font-weight: 700;
}
.folder.level-1 > summary:hover { background: var(--band); }

.folder-body > .folder:first-child,
.folder-body > .files:first-child { border-top: 1px solid var(--line); }
.folder.level-1 .folder-body {
    margin-left: 20px;
    border-left: 1px solid var(--line);
}

/* Contador tipo chip ("Core 12th Gen") */
.chip {
    order: 2;
    flex: none;
    padding: 3px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

/* ---------- Archivos (como las fichas de "Documents & downloads") ---------- */

.files {
    list-style: none;
    margin: 0;
    padding: 0;
}
.file + .file { border-top: 1px solid var(--line); }

.file a {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    color: var(--text);
    text-decoration: none;
    transition: background-color .15s;
}
.file a:hover { background: #F7F9FB; }
.file a:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
}

.badge {
    flex: none;
    display: grid;
    place-items: center;
    width: 40px;
    height: 46px;
    border: 1.5px solid var(--brand);
    border-radius: 6px;
    color: var(--brand);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
}

.file-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.file-name {
    color: var(--ink);
    font-weight: 700;
    overflow-wrap: anywhere;
}
.file-meta {
    font-size: 14px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.file-action {
    flex: none;
    color: var(--brand);
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}
.file a:hover .file-name { color: var(--brand); }
.file a:hover .file-action { text-decoration: underline; text-underline-offset: 3px; }

.empty {
    margin: 0;
    padding: 40px 20px;
    text-align: center;
    color: var(--muted);
}

/* ---------- Bloque de ayuda ---------- */

.help {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    margin-top: 32px;
    padding: 36px 40px;
    background: var(--band);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}
.help h2 {
    margin: 0 0 6px;
    color: var(--ink);
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
}
.help p {
    margin: 0;
    max-width: 640px;
    font-size: 17px;
    color: var(--muted);
}

/* ---------- Pie ---------- */

.site-footer {
    margin-top: 40px;
    padding: 28px 0;
    background: var(--band);
    font-size: 15px;
}
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 32px;
}
.footer-links,
.footer-langs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
}
.footer-links a { color: var(--brand); text-decoration: none; font-size: 17px; }
.footer-links a:hover { text-decoration: underline; }
.footer-langs { flex: 1; justify-content: flex-end; }
.footer-langs a { color: var(--muted); text-decoration: none; }
.footer-langs a:hover,
.footer-langs a.is-active { color: var(--brand); }
.footer-langs a.is-active { font-weight: 700; }
.copyright {
    flex-basis: 100%;
    margin: 4px 0 0;
    color: var(--faint);
    font-size: 14px;
}

/* ---------- Tablet ---------- */

/* Pantallas medianas: todo sigue en una línea; logo y menú a la izquierda */
@media (max-width: 1100px) {
    .header-inner { grid-template-columns: 1fr auto; padding: 0 24px; gap: 24px; }
    .header-center { grid-column: 1; gap: 32px; }
    .phone { grid-column: 2; }
    .main-nav { gap: 22px; }
}

/* Pantallas estrechas: el menú baja a su propia fila y se desplaza */
@media (max-width: 760px) {
    .header-center { display: contents; }
    .logo { grid-column: 1; grid-row: 1; padding: 14px 0; }
    .phone { grid-column: 2; grid-row: 1; }
    .main-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        overflow-x: auto;
        padding: 2px 0 14px;
        scrollbar-width: none;
    }
    .main-nav::-webkit-scrollbar { display: none; }
}

/* ---------- Móvil ---------- */

@media (max-width: 640px) {
    .wrap { padding: 0 16px; }
    .header-inner { padding: 0 16px; }
    .logo img { height: 30px; }
    .main-nav { gap: 22px; }
    .main-nav a { font-size: 16px; }
    .phone span { display: none; }        /* en móvil, solo el icono */
    .phone svg { width: 20px; height: 20px; }

    .hero { padding: 36px 0 32px; }
    .section-title { font-size: 28px; margin-bottom: 16px; }
    .lead { font-size: 16px; }

    main.wrap { padding-top: 20px; }
    .card { padding: 16px; border-radius: var(--radius); }
    .toolbar { flex-wrap: wrap; gap: 10px 12px; margin-bottom: 16px; }
    .search { flex-basis: 100%; }
    .search kbd { display: none; }
    .toolbar .btn { height: 38px; margin-left: auto; padding: 0 14px; font-size: 14px; }

    .folder.level-0 > summary { padding: 10px 14px 10px 16px; }
    .folder.level-1 > summary { padding: 10px 14px; }
    .folder.level-1 .folder-body { margin-left: 12px; }

    .file a { padding: 12px 14px; gap: 12px; }
    .badge { width: 34px; height: 40px; font-size: 9px; }
    .file-action { font-size: 0; }            /* solo la flecha */
    .file-action span { font-size: 18px; }

    .help { flex-direction: column; align-items: flex-start; padding: 24px; gap: 20px; }
    .help h2 { font-size: 21px; }
    .help p { font-size: 16px; }
    .btn-lg { width: 100%; height: 50px; padding: 0 20px; }

    .footer-langs { justify-content: flex-start; flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
