/* ============ LEGAL PAGE STYLES ============ */
:root {
    --legal-primary: #f2460d;
    --legal-primary-dark: #d63a0a;
    --legal-bg-dark: #0a0a0a;
    --legal-bg-card: #141414;
    --legal-border: #262626;
    --legal-text: #e5e5e5;
    --legal-text-muted: #a1a1aa;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background: #050505;
    color: var(--legal-text);
}

/* ===== Layout Principal ===== */
.legal-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

@media (min-width: 768px) {
    .legal-layout {
        flex-direction: row;
    }
}

/* ===== Sidebar (Desktop/Tablet) ===== */
.legal-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--legal-bg-dark);
    border-right: 1px solid var(--legal-border);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 2rem 1rem;
    display: none;
}

@media (min-width: 768px) {
    .legal-sidebar {
        display: block;
    }
}

.legal-sidebar-header {
    padding: 0 0.75rem 1.5rem 0.75rem;
    border-bottom: 1px solid var(--legal-border);
    margin-bottom: 1rem;
}

.legal-sidebar-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.legal-sidebar-subtitle {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--legal-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 0.25rem;
}

.legal-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    color: var(--legal-text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    margin-bottom: 0.25rem;
}

.legal-nav-link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: white;
}

.legal-nav-link.active {
    background: rgba(242, 70, 13, 0.1);
    color: var(--legal-primary);
    border-left: 3px solid var(--legal-primary);
    padding-left: calc(1rem - 3px);
}

.legal-nav-link .material-symbols-outlined {
    font-size: 20px;
}

/* ===== Contenido Principal ===== */
.legal-content {
    flex: 1;
    min-width: 0;
    padding: 1rem;
    max-width: 100%;
}

@media (min-width: 768px) {
    .legal-content {
        padding: 2.5rem 3rem;
    }
}

@media (min-width: 1024px) {
    .legal-content {
        padding: 3rem 4rem;
    }
}

/* ===== Header Móvil ===== */
.legal-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--legal-bg-dark);
    border-bottom: 1px solid var(--legal-border);
    position: sticky;
    top: 0;
    z-index: 40;
}

@media (min-width: 768px) {
    .legal-mobile-header {
        display: none;
    }
}

.legal-hamburger {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--legal-bg-card);
    border: 1px solid var(--legal-border);
    border-radius: 0.75rem;
    color: white;
    cursor: pointer;
}

.legal-hamburger .material-symbols-outlined {
    font-size: 24px;
}

/* ===== Menú Móvil (Drawer) ===== */
.legal-mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.legal-mobile-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.legal-mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    background: var(--legal-bg-dark);
    border-right: 1px solid var(--legal-border);
    z-index: 60;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding: 1.5rem 1rem;
}

.legal-mobile-drawer.open {
    transform: translateX(0);
}

.legal-drawer-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--legal-bg-card);
    border: 1px solid var(--legal-border);
    border-radius: 0.5rem;
    color: var(--legal-text-muted);
    cursor: pointer;
}

/* ===== Secciones de Contenido ===== */
.legal-section {
    background: var(--legal-bg-card);
    border: 1px solid var(--legal-border);
    border-radius: 1.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    scroll-margin-top: 1rem;
}

@media (min-width: 768px) {
    .legal-section {
        padding: 2.5rem;
    }
}

.legal-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--legal-border);
}

.legal-section-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    background: rgba(242, 70, 13, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--legal-primary);
    flex-shrink: 0;
}

.legal-section-icon .material-symbols-outlined {
    font-size: 24px;
}

.legal-section-title {
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
    letter-spacing: -0.02em;
}

@media (min-width: 768px) {
    .legal-section-title {
        font-size: 1.875rem;
    }
}

.legal-section-subtitle {
    font-size: 0.75rem;
    color: var(--legal-text-muted);
    font-weight: 500;
    margin-top: 0.25rem;
}

.legal-subsection {
    margin-bottom: 1.5rem;
}

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

.legal-subsection-title {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.legal-subsection-title::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--legal-primary);
    border-radius: 50%;
    flex-shrink: 0;
}

.legal-subsection p {
    color: var(--legal-text-muted);
    line-height: 1.7;
    font-size: 0.9375rem;
}

.legal-subsection ul {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0 0;
}

.legal-subsection ul li {
    color: var(--legal-text-muted);
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.7;
    font-size: 0.9375rem;
    margin-bottom: 0.5rem;
}

.legal-subsection ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--legal-primary);
    font-weight: 700;
}

/* ===== Botón de regreso ===== */
.legal-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--legal-text-muted);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.legal-back-btn:hover {
    color: var(--legal-primary);
}

.legal-back-btn .material-symbols-outlined {
    font-size: 20px;
}

/* ===== Indicador de Sección Activa (Móvil) ===== */
.legal-active-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--legal-bg-card);
    border: 1px solid var(--legal-border);
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
}

.legal-active-section .material-symbols-outlined {
    color: var(--legal-primary);
    font-size: 18px;
}

/* ===== Footer ===== */
.legal-footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--legal-text-muted);
    font-size: 0.75rem;
    border-top: 1px solid var(--legal-border);
    margin-top: 2rem;
}

/* ===== Prevenir overflow horizontal ===== */
.legal-layout,
.legal-content,
.legal-section,
.legal-subsection,
.legal-subsection p,
.legal-subsection ul li {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ===== Botón Volver Arriba ===== */
.legal-back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: var(--legal-primary);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(242, 70, 13, 0.35);
    z-index: 30;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.legal-back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.legal-back-to-top:hover {
    background: var(--legal-primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(242, 70, 13, 0.45);
}

.legal-back-to-top:active {
    transform: translateY(0) scale(0.95);
}

.legal-back-to-top .material-symbols-outlined {
    font-size: 22px;
}

/* Ajuste para móvil: más pequeño y ligeramente desplazado */
@media (max-width: 480px) {
    .legal-back-to-top {
        width: 2.5rem;
        height: 2.5rem;
        bottom: 1rem;
        right: 1rem;
    }

    .legal-back-to-top .material-symbols-outlined {
        font-size: 20px;
    }
}
