﻿/* Utilidades */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Contenedor principal */
.legal-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.7;
    color: #374151;
}

/* Header */
.legal-header {
    text-align: center;
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 3px solid #e5e7eb;
}

    .legal-header h1 {
        font-size: 36px;
        font-weight: 800;
        color: #111827;
        margin: 0 0 16px 0;
    }

.last-updated {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f3f4f6;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    color: #6b7280;
}

/* Tabla de contenidos */
.table-of-contents {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px 32px;
    margin-bottom: 40px;
}

    .table-of-contents h2 {
        margin: 0 0 16px 0;
        font-size: 20px;
        color: #111827;
    }

    .table-of-contents ol {
        margin: 0;
        padding-left: 20px;
    }

    .table-of-contents li {
        margin-bottom: 10px;
    }

    .table-of-contents a {
        color: #2563eb;
        text-decoration: none;
        font-weight: 500;
        transition: color 0.2s;
    }

        .table-of-contents a:hover {
            color: #1d4ed8;
            text-decoration: underline;
        }

/* Secciones legales */
.legal-section {
    margin-bottom: 48px;
    scroll-margin-top: 20px;
}

    .legal-section h2 {
        font-size: 28px;
        font-weight: 700;
        color: #111827;
        margin: 0 0 20px 0;
        display: flex;
        align-items: center;
        gap: 12px;
    }

        .legal-section h2 i {
            color: #2563eb;
            font-size: 32px;
        }

    .legal-section h3 {
        font-size: 20px;
        font-weight: 600;
        color: #1f2937;
        margin: 24px 0 12px 0;
    }

    .legal-section p {
        margin-bottom: 16px;
        font-size: 16px;
    }

/* Listas de beneficios */
.benefit-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

    .benefit-list li {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 12px;
        padding: 12px;
        background: #f9fafb;
        border-radius: 8px;
    }

    .benefit-list i {
        color: #10b981;
        font-size: 20px;
        flex-shrink: 0;
        margin-top: 2px;
    }

/* Cards de tipos de cookies */
.cookie-type-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    transition: all 0.3s;
}

    .cookie-type-card:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
        border-color: #2563eb;
    }

    .cookie-type-card.required {
        background: #f0fdf4;
        border-color: #10b981;
    }

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

    .card-header h3 {
        margin: 0;
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 20px;
    }

.badge {
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-required {
    background: #10b981;
    color: #ffffff;
}

.badge-optional {
    background: #f59e0b;
    color: #ffffff;
}

.legal-basis {
    font-size: 14px;
    color: #6b7280;
    font-style: italic;
    margin-top: 12px;
}

/* Tabla de cookies */
.table-responsive {
    overflow-x: auto;
    margin: 24px 0;
}

.cookies-table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

    .cookies-table thead {
        background: #1f2937;
        color: #ffffff;
    }

    .cookies-table th {
        padding: 16px;
        text-align: left;
        font-weight: 600;
        font-size: 14px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .cookies-table tbody tr {
        border-bottom: 1px solid #e5e7eb;
    }

        .cookies-table tbody tr:hover {
            background: #f9fafb;
        }

    .cookies-table td {
        padding: 16px;
        font-size: 14px;
    }

    .cookies-table code {
        background: #f3f4f6;
        padding: 2px 6px;
        border-radius: 4px;
        font-family: "Courier New", monospace;
        font-size: 13px;
        color: #dc2626;
    }

.table-note {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    padding: 16px;
    margin-top: 16px;
    border-radius: 6px;
    font-size: 14px;
}

/* Terceros */
.third-party-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.third-party-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
}

    .third-party-card h3 {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-top: 0;
        font-size: 18px;
    }

    .third-party-card i {
        color: #2563eb;
        font-size: 24px;
    }

    .third-party-card p {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .third-party-card a {
        color: #2563eb;
        text-decoration: underline;
    }

/* Botón gestionar cookies */
.action-box {
    text-align: center;
    margin: 24px 0;
}

.btn-manage-cookies {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #2563eb;
    color: #ffffff;
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

    .btn-manage-cookies:hover {
        background: #1d4ed8;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    }

    .btn-manage-cookies:focus {
        outline: 3px solid #93c5fd;
        outline-offset: 2px;
    }

/* Instrucciones de navegadores */
.browser-instructions {
    margin: 24px 0;
}

.browser-detail {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 12px;
    cursor: pointer;
}

    .browser-detail summary {
        list-style: none;
        display: flex;
        align-items: center;
        gap: 12px;
        font-weight: 600;
        color: #111827;
    }

        .browser-detail summary::-webkit-details-marker {
            display: none;
        }

        .browser-detail summary i {
            color: #2563eb;
            font-size: 24px;
        }

    .browser-detail[open] {
        background: #f9fafb;
    }

    .browser-detail ol {
        margin: 16px 0 12px 0;
        padding-left: 24px;
    }

    .browser-detail li {
        margin-bottom: 8px;
        font-size: 15px;
    }

/* Advertencias */
.warning-box {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    border-radius: 8px;
    padding: 16px 20px;
    display: flex;
    gap: 12px;
    margin: 24px 0;
}

    .warning-box i {
        color: #f59e0b;
        font-size: 24px;
        flex-shrink: 0;
    }

/* Derechos */
.rights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.right-card {
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}

    .right-card:hover {
        border-color: #10b981;
        box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
    }

    .right-card i {
        font-size: 32px;
        color: #10b981;
        margin-bottom: 12px;
    }

    .right-card h3 {
        font-size: 16px;
        margin: 0 0 8px 0;
    }

    .right-card p {
        font-size: 14px;
        margin: 0;
        color: #6b7280;
    }

.rights-note {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    padding: 16px;
    border-radius: 6px;
    font-size: 15px;
}

/* Información de contacto */
.contact-info {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
}

    .contact-info p {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-bottom: 16px;
        font-size: 15px;
    }

    .contact-info i {
        color: #2563eb;
        font-size: 20px;
        width: 24px;
    }

    .contact-info a {
        color: #2563eb;
        text-decoration: underline;
    }

/* Responsive */
@media (max-width: 768px) {
    .legal-container {
        padding: 24px 16px;
    }

    .legal-header h1 {
        font-size: 28px;
    }

    .legal-section h2 {
        font-size: 24px;
    }

    .table-of-contents {
        padding: 20px;
    }

    .cookies-table {
        font-size: 13px;
    }

        .cookies-table thead {
            display: none;
        }

        .cookies-table tbody tr {
            display: block;
            margin-bottom: 20px;
            border: 2px solid #e5e7eb;
            border-radius: 8px;
            padding: 12px;
        }

        .cookies-table td {
            display: block;
            text-align: right;
            padding: 8px 0;
            border-bottom: 1px solid #f3f4f6;
        }

            .cookies-table td:last-child {
                border-bottom: none;
            }

            .cookies-table td::before {
                content: attr(data-label);
                float: left;
                font-weight: 600;
                color: #6b7280;
            }

    .rights-grid {
        grid-template-columns: 1fr;
    }
}

/* Alto contraste */
body.high-contrast-mode .legal-container {
    background: #000000;
    color: #ffffff;
}

body.high-contrast-mode .card-header h3 {
    color: #ffffff !important;
}
body.high-contrast-mode .legal-header h1 {
    color: #ffffff !important;
}
body.high-contrast-mode .legal-section h2 {
    color: #ffffff !important;
}
body.high-contrast-mode .right-card p{
    color: #ffffff !important;
}
body.high-contrast-mode .right-card h3 {
    color: #ffffff !important;
}
body.high-contrast-mode .benefit-list {
    color: #000000 !important;
}
body.high-contrast-mode .table-note {
    color: #000000 !important;
}
body.high-contrast-mode .browser-detail {
    color: #000000 !important;
}
body.high-contrast-mode .warning-box {
    color: #000000 !important;
}
body.high-contrast-mode .rights-note {
    color: #000000 !important;
}
body.high-contrast-mode .contact-info {
    color: #000000 !important;
}

body.high-contrast-mode .legal-header h1,
body.high-contrast-mode .legal-section h2,
body.high-contrast-mode .legal-section h3 {
    color: #ffffff;
}

body.high-contrast-mode .cookie-type-card,
body.high-contrast-mode .third-party-card,
body.high-contrast-mode .right-card {
    background: #000000;
    border-color: #ffffff;
}

body.high-contrast-mode .btn-manage-cookies {
    background: #ffff00;
    color: #000000;
}

body.high-contrast-mode a {
    color: #ffff00;

