/* ============================================================
   LEGAL PAGES — UX corporativa loteria3.es
   Navy #0E4F8A · Gold #c9a961 · Cream #fffdf6
   Base font ≥ 1.5rem para audiencia 50+
   ============================================================ */

/* Reset del wrapper de Bootstrap 3 para que las paginas legales ocupen el ancho completo */
body:has(.legal-hero) #fondoprincipal,
#fondoprincipal:has(.legal-hero) {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.legal-hero,
.legal-toc,
.legal-main {
    font-family: 'Lato', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #1a1a1a;
}

/* ---------- HERO ---------- */
.legal-hero {
    background: linear-gradient(135deg, #0E4F8A 0%, #103a6b 60%, #0a2c52 100%);
    color: #fff;
    padding: 64px 24px 80px;
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
    margin-top: -20px;
    border-radius: 0 0 14px 14px;
}

.legal-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 6px;
    background: linear-gradient(90deg, transparent 0%, #c9a961 50%, transparent 100%);
}

.legal-hero__inner {
    max-width: 980px;
    margin: 0 auto;
    text-align: center;
}

.legal-hero__kicker {
    display: inline-block;
    font-family: 'Lato', sans-serif;
    font-size: 1.05rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #c9a961;
    margin-bottom: 18px;
    font-weight: 600;
}

.legal-hero__title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(2.2rem, 4.6vw, 3.6rem);
    line-height: 1.15;
    margin: 0 0 22px;
    color: #fff;
    font-weight: 400;
}

.legal-hero__title span {
    display: inline-block;
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    color: #f0e3c1;
    font-style: italic;
    font-weight: 300;
    margin-top: 6px;
}

.legal-hero__lead {
    font-size: 1.55rem;
    line-height: 1.55;
    color: #e9edf3;
    max-width: 760px;
    margin: 0 auto 22px;
}

.legal-hero__meta {
    font-size: 1.15rem;
    color: #c9a961;
    margin: 0;
    font-style: italic;
    letter-spacing: 0.03em;
}

/* ---------- TABLA DE CONTENIDOS ---------- */
.legal-toc {
    background: #fbfaf5;
    border: 1px solid #ece3cc;
    border-radius: 10px;
    padding: 18px 24px;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 12px rgba(14, 79, 138, 0.08);
    width: 100%;
    box-sizing: border-box;
    margin: 18px 0;
}

.legal-toc__inner {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    align-items: center;
    justify-content: center;
}

.legal-toc__label {
    font-family: Georgia, serif;
    font-size: 1.05rem;
    color: #c9a961;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
    padding-right: 12px;
    border-right: 2px solid #ece3cc;
}

.legal-toc a {
    font-size: 1.02rem;
    color: #0E4F8A;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 999px;
    transition: background 0.18s ease, color 0.18s ease;
    white-space: nowrap;
    font-weight: 500;
}

.legal-toc a:hover {
    background: #0E4F8A;
    color: #fff;
}

/* ---------- MAIN CONTAINER ---------- */
.legal-main {
    max-width: 980px;
    margin: 0 auto;
    padding: 56px 24px 96px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* ---------- CARDS ---------- */
.legal-card {
    background: #fffdf6;
    border-radius: 14px;
    padding: 38px 40px 36px;
    box-shadow: 0 4px 24px rgba(14, 79, 138, 0.07);
    position: relative;
    border-top: 3px solid #c9a961;
    scroll-margin-top: 110px;
}

.legal-card__num {
    position: absolute;
    top: -22px;
    left: 32px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0E4F8A 0%, #103a6b 100%);
    color: #c9a961;
    font-family: Georgia, serif;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(14, 79, 138, 0.3);
    font-weight: 600;
}

.legal-card h2 {
    font-family: Georgia, 'Times New Roman', serif;
    color: #0E4F8A;
    font-size: 1.95rem;
    margin: 0 0 18px;
    line-height: 1.25;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.legal-card h3 {
    font-family: Georgia, serif;
    color: #0E4F8A;
    font-size: 1.55rem;
    margin: 22px 0 12px;
    font-weight: 500;
}

.legal-card h4 {
    font-family: 'Lato', sans-serif;
    color: #0E4F8A;
    font-size: 1.3rem;
    margin: 18px 0 10px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}

.legal-card p,
.legal-card li {
    font-size: 1.5rem;
    line-height: 1.65;
    color: #2a2a2a;
    margin: 0 0 14px;
    text-align: justify;
    text-justify: inter-word;
}

.legal-card p:last-child {
    margin-bottom: 0;
}

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

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

.legal-card a {
    color: #0E4F8A;
    text-decoration: underline;
    text-decoration-color: #c9a961;
    text-underline-offset: 3px;
    font-weight: 600;
}

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

.legal-card strong {
    color: #0E4F8A;
    font-weight: 700;
}

/* ---------- CALLOUTS ---------- */
.legal-callout {
    background: #fff8e7;
    border-left: 4px solid #c9a961;
    padding: 18px 22px;
    border-radius: 6px;
    margin: 22px 0;
    font-size: 1.4rem !important;
    line-height: 1.55 !important;
}

.legal-callout--info {
    background: #eef4fb;
    border-left-color: #0E4F8A;
}

.legal-callout--danger {
    background: #fdecec;
    border-left-color: #c0392b;
}

.legal-callout strong {
    color: #0E4F8A;
}

/* ---------- CONTACTO Y DATOS ---------- */
.legal-datos {
    background: #fff8e7;
    border: 1px solid #ece3cc;
    border-radius: 10px;
    padding: 26px 30px;
    margin: 18px 0;
    list-style: none;
    padding-left: 30px !important;
}

.legal-datos li {
    font-size: 1.4rem !important;
    padding: 6px 0;
    border-bottom: 1px dashed #ece3cc;
    text-align: left !important;
}

.legal-datos li:last-child {
    border-bottom: none;
}

.legal-contactbox {
    background: #fbfaf5;
    border: 1px solid #ece3cc;
    border-radius: 8px;
    padding: 18px 24px;
    margin: 16px 0 18px;
    list-style: none;
    padding-left: 24px !important;
}

.legal-contactbox li {
    font-size: 1.4rem !important;
    padding: 8px 0;
    text-align: left !important;
    border-bottom: none;
}

/* ---------- FOOTER NOTE ---------- */
.legal-footer-note {
    text-align: center;
    font-size: 1.15rem !important;
    color: #6e6e6e;
    margin: 36px 0 0 !important;
    font-style: italic;
    line-height: 1.55;
}

.legal-footer-note a {
    color: #0E4F8A;
    text-decoration: underline;
}

/* ---------- COOKIES TABLE ---------- */
.legal-cookie-table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
    font-size: 1.25rem;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(14, 79, 138, 0.06);
}

.legal-cookie-table th {
    background: #0E4F8A;
    color: #fff;
    padding: 14px 16px;
    text-align: left;
    font-family: Georgia, serif;
    font-weight: 400;
    font-size: 1.3rem;
}

.legal-cookie-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0e8d3;
    color: #2a2a2a;
    vertical-align: top;
}

.legal-cookie-table tr:last-child td {
    border-bottom: none;
}

.legal-cookie-table tr:nth-child(even) td {
    background: #fbfaf5;
}

.legal-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.legal-badge--tecnica {
    background: #e3f1e6;
    color: #1f6f3a;
}

.legal-badge--analitica {
    background: #fdf1d5;
    color: #8a6a18;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .legal-hero {
        padding: 48px 18px 60px;
    }

    .legal-toc {
        padding: 14px 12px;
    }

    .legal-toc__inner {
        gap: 6px 10px;
    }

    .legal-toc__label {
        border-right: none;
        padding-right: 0;
        width: 100%;
        text-align: center;
        margin-bottom: 6px;
    }

    .legal-toc a {
        font-size: 0.95rem;
        padding: 5px 10px;
    }

    .legal-main {
        padding: 36px 16px 60px;
        gap: 24px;
    }

    .legal-card {
        padding: 30px 22px 26px;
    }

    .legal-card__num {
        left: 22px;
        width: 42px;
        height: 42px;
        font-size: 1.3rem;
    }

    .legal-card h2 {
        font-size: 1.65rem;
    }

    .legal-card p,
    .legal-card li {
        font-size: 1.35rem;
        text-align: left;
    }

    .legal-callout,
    .legal-contactbox li,
    .legal-datos li {
        font-size: 1.25rem !important;
    }

    .legal-cookie-table {
        font-size: 1.1rem;
    }

    .legal-cookie-table th,
    .legal-cookie-table td {
        padding: 10px 10px;
    }
}
