/* ==========================================================
   PÁGINAS LEGALES (Terms & Conditions, Privacy Policy...)
   Reutilizable: solo hay que usar .legal-page / .legal-box / .legal-block
========================================================== */

/* ---------- Estilos compartidos con la home ----------
   (copiados para que funcione aunque el CSS de la home no se cargue aquí) */
.section-with-bg {
    background-color: #0a0a0a;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

.section-title-wrap {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 1.5rem !important;
    margin-bottom: 1rem !important;
    width: 100% !important;
}

.stw-line {
    display: block !important;
    flex: 1 !important;
    max-width: 140px !important;
    min-width: 40px !important;
    height: 2px !important;
    background-color: #4cff00 !important;
    position: relative;
    z-index: 10;
}

.section-title {
    font-family: 'QarantaBold', Arial, sans-serif !important;
    font-size: clamp(1.8rem, 4vw, 2.6rem) !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    margin: 0 !important;
    color: #ffffff !important;
    text-align: center !important;
}

/* ---------- Página ---------- */
.legal-page {
    position: relative;
    min-height: 100vh;
    padding: 100px 0 80px;          /* 100px arriba deja sitio al logo del menú */
}

.legal-page .container {
    max-width: 1100px;
    margin: 0 auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.legal-page .section-title-wrap {
    margin-bottom: 50px !important; /* hueco entre el título y el bloque oscuro */
}

/* ---------- Bloque oscuro ----------
   Medidas del diseño:
   - ancho 975px
   - 80px de margen lateral  -> contenido de 815px
   - 40px entre el borde superior y el primer título (y abajo, simétrico) */
.legal-box {
    box-sizing: border-box;
    width: 100%;
    max-width: 975px;
    margin: 0 auto;
    padding: 40px 80px;
    background: rgba(0, 20, 0, 0.78);
    border-radius: 15px;
    color: #ffffff;
    text-align: center;
}

/* ---------- Secciones ----------
   30px entre título y texto, y 30px entre el final del texto y el siguiente título */
.legal-block + .legal-block {
    margin-top: 30px;
}

.legal-block h2 {
    margin: 0 0 30px;
    font-family: 'QarantaBold', Arial, sans-serif;
    font-size: 28px;
    line-height: 1.15;
    text-transform: uppercase;
    color: #4cff00;
    text-align: center;
}

.legal-block p {
    margin: 0 0 1.2em;
    font-size: 15px;
    line-height: 1.45;
    color: #ffffff;
    text-wrap: pretty;               /* evita palabras sueltas en la última línea */
}

/* ---------- Lista con viñetas (alineada a la izquierda) ---------- */
.legal-block ul {
    margin: 0 0 1.2em;
    padding: 0 0 0 1.4em;
    list-style: disc;
    text-align: left;
    font-size: 15px;
    line-height: 1.45;
    color: #ffffff;
}

.legal-block li {
    margin: 0;
    padding-left: 0.3em;
}

/* Sin margen sobrante al final de cada bloque (así los 30px son exactos) */
.legal-block > :last-child {
    margin-bottom: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 950px) {
    .legal-page {
        padding: 70px 0 50px;
    }

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

    .legal-block h2 {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .legal-block + .legal-block {
        margin-top: 24px;
    }

    .section-title {
        white-space: normal !important;
    }
}

/* ==========================================================
   PRIVACY POLICY (variante .legal-page--policy)
   Títulos pequeños en verde, texto centrado y tablas con borde verde
========================================================== */

.legal-page--policy .legal-block + .legal-block {
    margin-top: 24px;
}

.legal-page--policy .legal-block h2 {
    margin: 0 0 14px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    text-transform: uppercase;
    color: #4cff00;
}

.legal-page--policy .legal-block h3 {
    margin: 18px 0 8px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: #ffffff;
}

.legal-page--policy .legal-block h4 {
    margin: 20px 0 10px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #4cff00;
}

.legal-page--policy .legal-block p,
.legal-page--policy .legal-lines {
    font-size: 14px;
    line-height: 1.4;
    margin: 0 0 14px;
}

.legal-page--policy .legal-block a {
    color: #4cff00;
    text-decoration: underline;
    word-break: break-word;
}

/* Listas sin viñetas, centradas */
.legal-lines {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    text-align: center;
    color: #ffffff;
}

.legal-lines li {
    margin: 0 0 4px;
    padding: 0;
}

/* Separador + subtítulo "Cookies Policy" */
.legal-divider {
    height: 2px;
    margin: 40px 0 30px;
    background: #4cff00;
    opacity: 0.6;
}

.legal-subtitle {
    margin: 0 0 24px;
    font-family: 'QarantaBold', Arial, sans-serif;
    font-size: 28px;
    text-transform: uppercase;
    color: #ffffff;
    text-align: center;
}

/* ---------- Tablas ---------- */
.legal-table-wrap {
    width: 100%;
    margin: 6px 0 14px;
    overflow-x: auto;
}

.legal-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #4cff00;
    border-radius: 15px;
    font-size: 13px;
    line-height: 1.35;
    color: #ffffff;
    text-align: left;
}

.legal-table th,
.legal-table td {
    padding: 14px 20px;
    vertical-align: top;
    border-right: 1px solid #4cff00;
    border-bottom: 1px solid #4cff00;
}

.legal-table th:last-child,
.legal-table td:last-child {
    border-right: none;
}

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

.legal-table thead th {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    vertical-align: middle;
    color: #4cff00;
}

/* La cabecera "DETAILS" es más grande, como en el diseño */
.legal-table--2col thead th:last-child {
    font-size: 22px;
}

/* Primera columna en negrita y más estrecha */
.legal-table__label {
    width: 30%;
    font-weight: 700;
    padding-left: 40px !important;
}

.legal-table td p {
    margin: 0 0 10px !important;
    font-size: 13px !important;
    text-align: left;
}

.legal-table td p:last-child {
    margin-bottom: 0 !important;
}

.legal-table__list {
    margin: 0 0 0 4px;
    padding: 0 0 0 1.2em;
    list-style: disc;
    text-align: left;
}

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

.legal-table__list li:last-child {
    margin-bottom: 0;
}

/* Tablas de cookies (4 columnas) */
.legal-table--cookies th,
.legal-table--cookies td {
    padding: 10px 12px;
    font-size: 12px;
    word-break: break-word;
}

.legal-table--cookies thead th {
    font-size: 12px;
}

.legal-table--cookies th:nth-child(1) { width: 14%; }
.legal-table--cookies th:nth-child(2) { width: 24%; }
.legal-table--cookies th:nth-child(4) { width: 14%; }

@media (max-width: 950px) {
    .legal-page--policy .legal-block h2 { font-size: 13px; }
    .legal-table th,
    .legal-table td { padding: 10px 12px; }
    .legal-table__label { padding-left: 12px !important; width: 38%; }
    .legal-table--2col thead th:last-child { font-size: 16px; }
    .legal-table--cookies { min-width: 560px; }
}

/* ==========================================================
   FRAUD WARNING (variante .legal-page--fraud)
   Hereda el estilo de Terms & Conditions; aquí solo los extras
========================================================== */
.legal-page--fraud .legal-block h2 {
    font-size: 24px;
    line-height: 1.25;
    margin-bottom: 30px;
}

.legal-signature {
    margin-top: 30px !important;
    font-weight: 700;
}

/* ==========================================================
   VERSIÓN MÓVIL PULIDA (≤ 700px)
   - Las tablas ya no se cortan ni necesitan scroll lateral:
     cada fila pasa a ser una "tarjeta" apilada.
   - Tablas de 2 columnas: el título de la fila arriba y el detalle debajo.
   - Tablas de cookies (4 columnas): cada dato lleva su etiqueta delante
     (Property / Cookie / Purpose / Term), puesta con CSS.
   - Enlaces largos y nombres de cookies se parten en varias líneas.
   Va al final del archivo para ganar a las reglas anteriores.
========================================================== */
@media (max-width: 700px) {

    /* ---------- Página y bloque oscuro ---------- */
    .legal-page {
        padding: 120px 0 40px;       /* deja sitio al header y al logo, que sobresale por debajo */
        min-height: 0;
    }

    .legal-page .container {
        padding-left: 12px;
        padding-right: 12px;
    }

    .legal-page .section-title-wrap {
        margin-bottom: 28px !important;
        gap: 12px !important;
    }

    .section-title {
        font-size: clamp(1.4rem, 7vw, 1.9rem) !important;
        line-height: 1.1 !important;
        text-align: center !important;
    }

    .stw-line {
        min-width: 16px !important;
        max-width: 60px !important;
    }

    .legal-box {
        padding: 24px 16px;
        border-radius: 12px;
    }

    /* ---------- Textos ---------- */
    .legal-block h2,
    .legal-page--fraud .legal-block h2 {
        font-size: 19px;
        margin-bottom: 16px;
        overflow-wrap: anywhere;
    }

    .legal-page--policy .legal-block h2 {
        font-size: 13px;
        margin-bottom: 12px;
    }

    .legal-block p,
    .legal-block ul,
    .legal-page--policy .legal-block p,
    .legal-page--policy .legal-lines {
        font-size: 14px;
        line-height: 1.5;
        overflow-wrap: anywhere;
    }

    .legal-lines {
        text-align: left;            /* listas largas: más cómodas alineadas a la izquierda */
    }

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

    .legal-block a,
    .legal-page--policy .legal-block a {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .legal-subtitle {
        font-size: 22px;
        margin-bottom: 18px;
    }

    .legal-divider {
        margin: 32px 0 24px;
    }

    /* ---------- Tablas: cada fila = una tarjeta apilada ---------- */
    .legal-table-wrap {
        overflow: visible;           /* ya no hace falta scroll lateral */
        margin: 8px 0 14px;
    }

    .legal-table,
    .legal-table--cookies {
        display: block;
        min-width: 0 !important;
        width: 100%;
        border: 0;
        border-radius: 0;
        background: transparent;
    }

    .legal-table thead {
        /* Se ocultan las cabeceras (siguen disponibles para lectores de pantalla) */
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .legal-table tbody {
        display: block;
    }

    .legal-table tr {
        display: block;
        margin: 0 0 12px;
        border: 1px solid #4cff00;
        border-radius: 12px;
        overflow: hidden;
        background: rgba(0, 0, 0, 0.18);
    }

    .legal-table tbody tr:last-child {
        margin-bottom: 0;
    }

    .legal-table th,
    .legal-table td {
        display: block;
        width: auto !important;
        padding: 12px 14px;
        border: 0 !important;
        text-align: left;
        font-size: 13px;
        line-height: 1.45;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    /* Primera celda = título de la tarjeta */
    .legal-table__label {
        padding: 12px 14px !important;
        background: rgba(76, 255, 0, 0.14);
        border-bottom: 1px solid #4cff00 !important;
        font-weight: 700;
    }

    .legal-table td p {
        font-size: 13px !important;
    }

    .legal-table__list {
        margin-left: 0;
        padding-left: 1.2em;
    }

    /* ---------- Tablas de cookies (4 columnas) ---------- */
    .legal-table--cookies td {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        padding: 8px 14px;
        font-size: 12px;
        border-bottom: 1px solid rgba(76, 255, 0, 0.25) !important;
    }

    .legal-table--cookies td:last-child {
        border-bottom: 0 !important;
    }

    .legal-table--cookies td::before {
        flex: 0 0 74px;
        color: #4cff00;
        font-weight: 700;
        text-transform: uppercase;
        font-size: 11px;
        line-height: 1.6;
    }

    .legal-table--cookies td:nth-child(1)::before { content: "Property"; }
    .legal-table--cookies td:nth-child(2)::before { content: "Cookie"; }
    .legal-table--cookies td:nth-child(3)::before { content: "Purpose"; }
    .legal-table--cookies td:nth-child(4)::before { content: "Term"; }

    .legal-table--cookies td:nth-child(2) {
        font-weight: 700;
    }

    .legal-signature {
        margin-top: 24px !important;
    }
}

@media (max-width: 380px) {
    .legal-box {
        padding: 20px 12px;
    }

    .legal-table th,
    .legal-table td,
    .legal-table__label {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .legal-table--cookies td::before {
        flex-basis: 64px;
    }
}


/* Tablet: mismo respiro bajo el header */
@media (min-width: 701px) and (max-width: 950px) {
    .legal-page {
        padding-top: 120px;
    }
}