/* ============================================================
   CAJASAN — Páginas legales (assets/css/legal.css)
   Reutiliza el hero, menú y footer del sitio.
   ============================================================ */

/* ---------- Hero ---------- */
.legal-skip {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 9999;
    padding: 12px 18px;
    background: #fff;
    color: #1a4fa0;
    font-weight: 700;
    text-decoration: none;
}

.legal-skip:focus {
    left: 12px;
    top: 12px;
    outline: 3px solid #f39200;
}

.hero-section.hero-banner.legal-hero {
    aspect-ratio: auto;
    height: auto;
    min-height: 340px;
    max-height: none;
    display: flex;
    align-items: flex-end;
    background-image:
        linear-gradient(90deg,
            rgba(11, 31, 58, 0.94) 0%,
            rgba(11, 31, 58, 0.84) 42%,
            rgba(26, 79, 160, 0.45) 100%
        ),
        url("../images/home/fondo_slider.png");
    background-size: cover;
    background-position: center center;
}

.legal-hero__inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 150px 24px 48px;
    color: #fff;
}

.legal-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 10px;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: #cbd5e1;
}

.legal-breadcrumb a {
    color: #dbeafe;
    text-decoration: none;
}

.legal-breadcrumb a:hover {
    color: #fff;
    text-decoration: underline;
}

.legal-breadcrumb li + li::before {
    content: "/";
    margin-right: 6px;
    color: #93c5fd;
}

.legal-hero h1 {
    margin: 0 0 8px;
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.25);
}

.legal-hero p {
    max-width: 720px;
    margin: 0;
    font-size: clamp(15px, 1.6vw, 18px);
    line-height: 1.55;
    color: #e2e8f0;
}

/* ---------- Contenido ---------- */
.legal-main {
    padding: 42px 0 68px;
    background: #f8fafc;
}

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

.legal-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

/* ---------- Navegación lateral ---------- */
.legal-sidebar {
    position: sticky;
    top: 96px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 16px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
}

.legal-sidebar h2 {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #64748b;
}

.legal-sidebar ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.legal-sidebar a {
    display: block;
    padding: 9px 12px;
    border-radius: 8px;
    color: #334155;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    text-decoration: none;
    transition: background 0.18s, color 0.18s;
}

.legal-sidebar a:hover {
    background: #f1f5f9;
    color: #1a4fa0;
}

.legal-sidebar a[aria-current="page"] {
    background: #e8f0fe;
    color: #1a4fa0;
    font-weight: 700;
}

.legal-sidebar a:focus-visible {
    outline: 3px solid #f39200;
    outline-offset: 2px;
}

/* ---------- Tarjeta del documento ---------- */
.legal-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 34px 38px 38px;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
    color: #1e293b;
    font-size: 15px;
    line-height: 1.75;
}

.legal-card > :first-child {
    margin-top: 0;
}

.legal-updated {
    margin: 0 0 26px;
    color: #64748b;
    font-size: 13px;
}

.legal-card h2 {
    margin: 30px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eef2f7;
    color: #0b1f3a;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
}

.legal-card h3 {
    margin: 22px 0 8px;
    color: #1a4fa0;
    font-size: 16px;
    font-weight: 700;
}

.legal-card p {
    margin: 0 0 14px;
}

.legal-card ul,
.legal-card ol {
    margin: 0 0 16px;
    padding-left: 22px;
}

.legal-card li {
    margin-bottom: 8px;
}

.legal-card a {
    color: #1a4fa0;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.legal-card a:hover {
    color: #15407f;
}

.legal-card a:focus-visible {
    outline: 3px solid #f39200;
    outline-offset: 2px;
    border-radius: 3px;
}

.legal-card code {
    padding: 2px 6px;
    border-radius: 5px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 0.9em;
}

.legal-note {
    margin: 22px 0;
    padding: 14px 18px;
    border-left: 4px solid #1a4fa0;
    border-radius: 0 10px 10px 0;
    background: #eef5ff;
    color: #1e3a5f;
    font-size: 14px;
}

.legal-warning {
    border-left-color: #f39200;
    background: #fff7ed;
    color: #7c2d12;
}

.legal-table-wrap {
    margin: 16px 0 10px;
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.legal-card table {
    width: 100%;
    min-width: 660px;
    border-collapse: collapse;
    font-size: 13.5px;
}

.legal-card th,
.legal-card td {
    padding: 10px 12px;
    border-bottom: 1px solid #eef2f7;
    text-align: left;
    vertical-align: top;
}

.legal-card th {
    background: #eef3fb;
    color: #0b1f3a;
    font-weight: 700;
    white-space: nowrap;
}

.legal-card tbody tr:last-child td {
    border-bottom: 0;
}

.legal-card tbody tr:nth-child(even) {
    background: #fafcff;
}

/* ---------- Botones ---------- */
.legal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 6px;
}

.legal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.18s, border-color 0.18s;
}

.legal-btn--primary {
    background: #1a4fa0;
    border-color: #1a4fa0;
    color: #fff;
}

.legal-btn--primary:hover {
    background: #15407f;
    color: #fff;
}

.legal-btn--secondary {
    background: #fff;
    border-color: #cfdcf0;
    color: #1a4fa0;
}

.legal-btn--secondary:hover {
    background: #eef3fb;
    color: #15407f;
}

.legal-btn:focus-visible {
    outline: 3px solid #f39200;
    outline-offset: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .legal-layout {
        grid-template-columns: 1fr;
    }

    .legal-sidebar {
        position: static;
        padding: 14px;
    }

    .legal-sidebar ul {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .legal-sidebar a {
        padding: 8px 12px;
        border: 1px solid #e2e8f0;
        font-size: 13px;
    }
}

@media (max-width: 640px) {
    .hero-section.hero-banner.legal-hero {
        min-height: 260px;
    }

    .legal-hero__inner {
        padding: 118px 20px 32px;
    }

    .legal-container {
        padding: 0 16px;
    }

    .legal-main {
        padding: 26px 0 48px;
    }

    .legal-card {
        padding: 22px 18px 26px;
        font-size: 14.5px;
    }

    .legal-card h2 {
        font-size: 18px;
    }
}

@media print {
    .legal-sidebar,
    #main-navigation,
    #footer-container,
    .legal-actions {
        display: none !important;
    }

    .legal-hero {
        min-height: 0 !important;
        background: none !important;
        color: #000 !important;
    }

    .legal-hero__inner {
        padding: 0 0 18px !important;
        color: #000 !important;
    }

    .legal-hero h1,
    .legal-hero p,
    .legal-breadcrumb,
    .legal-breadcrumb a {
        color: #000 !important;
        text-shadow: none !important;
    }

    .legal-layout {
        display: block;
    }

    .legal-card {
        border: 0;
        box-shadow: none;
        padding: 0;
    }
}
