/**
 * ==========================================================================
 * POLÍTICA DE COOKIES - ESTILOS ESPECÍFICOS (politica-cookies.css)
 * ==========================================================================
 * Contiene los estilos de la sección legal y la tabla responsiva de cookies.
 * Los estilos de Header, Footer y variables se importan de global.css.
 * ==========================================================================
 */

/* ==========================================================================
 * MEJORAS DE ACCESIBILIDAD (WCAG 2.2 AA)
 * ========================================================================== */
:focus-visible {
    outline: 3px solid var(--color-verde-acento, #28CC43) !important;
    outline-offset: 4px !important;
    border-radius: inherit;
}

[data-theme="light"] :focus-visible {
    outline: 3px solid #000957 !important;
}

/* Indicador de foco específico para la tabla con scroll horizontal en teclado */
.table-responsive:focus-visible {
    outline: 3px solid var(--color-verde-acento, #28CC43) !important;
    outline-offset: 2px !important;
    border-radius: 8px;
}

/* ==========================================================================
 * 1. ESTILOS BASE (Escritorio y compartidos)
 * ========================================================================== */

.legal-section {
    display: flex;
    justify-content: center;
    padding: 60px 20px;
    min-height: 55vh;
}

.legal-box {
    background-color: rgba(255, 255, 255, 0.03);
    padding: 60px;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    border-left: 4px solid var(--color-verde-acento, #28CC43);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

[data-theme="light"] .legal-box {
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 15px 35px rgba(0,0,0,0.05);
}

/* Títulos Principales */
.main-legal-title {
    color: var(--color-verde-acento, #28CC43);
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 800;
    text-align: center;
}

[data-theme="light"] .main-legal-title {
    color: #000957;
}

/* Imagen superior - Ajustada para verse completa */
.legal-hero-img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: contain;
    border-radius: 8px;
    margin: 20px auto 40px auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

[data-theme="light"] .legal-hero-img {
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Párrafos y Secciones Numeradas */
.legal-clause {
    margin-bottom: 35px;
}

.legal-clause h3 {
    color: var(--color-verde-acento, #28CC43);
    font-size: 1.25rem;
    margin-bottom: 15px;
    font-weight: 800;
}

.legal-clause h4 {
    color: #ffffff;
    font-size: 1.1rem;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 700;
}

[data-theme="light"] .legal-clause h4 {
    color: #000957;
}

.legal-clause p {
    color: var(--color-texto-claro, #ffffff);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 15px;
    text-align: justify;
}

[data-theme="light"] .legal-clause p {
    color: #000957;
}

/* Listas */
.legal-clause ul {
    list-style-type: disc;
    padding-left: 20px;
    margin-bottom: 20px;
}

.legal-clause li {
    color: var(--color-texto-claro, #ffffff);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 8px;
    padding-left: 5px;
}

[data-theme="light"] .legal-clause li {
    color: #000957;
}

.legal-clause strong {
    color: #ffffff;
    font-weight: 700;
}

[data-theme="light"] .legal-clause strong {
    color: #000957;
}

/* Enlaces dentro del texto legal */
.legal-link {
    color: var(--color-verde-acento, #28CC43);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.3s ease;
}

.legal-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
 * 2. TABLA DE COOKIES (Diseño Corporativo)
 * ========================================================================== */
.table-responsive {
    overflow-x: auto;
    margin-top: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* El indicador de scroll nace oculto en computadoras de escritorio */
.table-scroll-hint {
    display: none;
}

[data-theme="light"] .table-responsive {
    border: 1px solid rgba(0, 9, 87, 0.1);
}

.cookies-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.cookies-table th, .cookies-table td {
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-texto-claro, #ffffff);
    font-size: 1rem;
    line-height: 1.5;
}

.cookies-table th {
    background-color: rgba(40, 204, 67, 0.1);
    color: var(--color-verde-acento, #28CC43);
    font-weight: 800;
    white-space: nowrap;
}

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

/* Enlaces de políticas dentro de la tabla */
.cookies-table a {
    color: var(--color-verde-acento, #28CC43);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-block;
}

.cookies-table a:hover {
    text-decoration: underline;
}

[data-theme="light"] .cookies-table th, [data-theme="light"] .cookies-table td {
    border-bottom: 1px solid rgba(0, 9, 87, 0.1);
    color: #000957;
}

[data-theme="light"] .cookies-table th {
    background-color: rgba(40, 204, 67, 0.15);
}

/* ==========================================================================
 * 3. BOTÓN DE RETORNO
 * ========================================================================== */
.btn-return {
    display: inline-block;
    margin-top: 40px;
    border: 2px solid var(--color-verde-acento, #28CC43);
    padding: 12px 35px;
    font-weight: 700;
    color: var(--color-verde-acento, #28CC43);
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-return:hover {
    background-color: var(--color-verde-acento, #28CC43);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(40, 204, 67, 0.4);
}

/* ==========================================================================
 * 4. DISEÑO RESPONSIVO (Móviles y Tablets)
 * ========================================================================== */
@media (max-width: 768px) {
    .legal-section {
        padding: 40px 15px;
    }

    .legal-box {
        padding: 30px 20px;
    }

    .main-legal-title {
        font-size: 2rem;
    }

    .legal-clause h3 {
        font-size: 1.15rem;
    }

    /* Párrafos y listas justificados con guiones automáticos */
    .legal-clause p, .legal-clause li {
        font-size: 0.95rem;
        text-align: justify;
        -webkit-hyphens: auto;
        -moz-hyphens: auto;
        -ms-hyphens: auto;
        hyphens: auto;
        word-break: break-word;
    }

    /* Las celdas de la tabla se mantienen alineadas a la izquierda */
    .cookies-table th, .cookies-table td {
        font-size: 0.95rem;
        text-align: left;
    }

    /* EL INJECT DE UX: Indicador visual animado para la tabla móvil */
    .table-scroll-hint {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        background-color: rgba(40, 204, 67, 0.1);
        border: 1px solid rgba(40, 204, 67, 0.25);
        color: var(--color-verde-acento, #28CC43);
        padding: 10px 14px;
        border-radius: 8px;
        font-size: 0.85rem;
        font-weight: 700;
        margin-top: 15px;
        margin-bottom: -5px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .table-scroll-hint .icon-hint {
        animation: slide-arrow 1.6s infinite ease-in-out;
        flex-shrink: 0;
    }

    @keyframes slide-arrow {
        0%, 100% { transform: translateX(-3px); opacity: 0.6; }
        50% { transform: translateX(4px); opacity: 1; }
    }

    [data-theme="light"] .table-scroll-hint {
        background-color: rgba(40, 204, 67, 0.15);
        color: #000957;
        border: 1px solid rgba(0, 9, 87, 0.15);
    }

    /* Forzamos la visualización de la barra de scroll en smartphones */
    .table-responsive::-webkit-scrollbar {
        height: 5px;
        display: block !important;
    }
    .table-responsive::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 10px;
    }
    .table-responsive::-webkit-scrollbar-thumb {
        background: var(--color-verde-acento, #28CC43);
        border-radius: 10px;
    }
    
    [data-theme="light"] .table-responsive::-webkit-scrollbar-track {
        background: rgba(0, 9, 87, 0.05);
    }
}
