/* ================================================
   CSS para PÁGINAS LEGALES - Mobile First
   Términos y Condiciones, Privacidad y Cookies
   ================================================ */

:root {
    --legal-primary: #22c55e;
    --legal-dark: #000000;
    --legal-gray: #6b7280;
    --legal-gray-light: #f3f4f6;
    --legal-gray-border: #e5e7eb;
    --legal-white: #ffffff;
    --legal-highlight-bg: #dcfce7;
    --legal-warning-bg: #fef3c7;
    --legal-warning-border: #fbbf24;
    --legal-info-bg: #dbeafe;
    --legal-info-border: #3b82f6;
    --legal-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* ================================================
   CONTENEDOR PRINCIPAL
   ================================================ */

.legal-content {
    background: var(--legal-white);
    min-height: calc(100vh - 200px);
}

/* ================================================
   HERO SECTION
   ================================================ */

.legal-hero {
    background: linear-gradient(135deg, var(--legal-primary) 0%, #16a34a 100%);
    color: var(--legal-white);
    padding: 2.5rem 1rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.legal-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
}

.legal-hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: 0 auto;
}

.legal-hero-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.legal-hero-subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.legal-hero-description {
    font-size: 1rem;
    opacity: 0.85;
}

/* ================================================
   ARTÍCULO LEGAL
   ================================================ */

.legal-article {
    padding: 2rem 0;
}

.legal-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ================================================
   SECCIONES
   ================================================ */

.legal-section {
    margin-bottom: 3rem;
    animation: fadeInUp 0.6s ease forwards;
}

.legal-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--legal-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--legal-primary);
}

.legal-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--legal-dark);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.legal-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--legal-dark);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.legal-section p {
    color: var(--legal-gray);
    line-height: 1.8;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.legal-section ul,
.legal-section ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.legal-section li {
    color: var(--legal-gray);
    line-height: 1.7;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.legal-section strong {
    color: var(--legal-dark);
    font-weight: 600;
}

.legal-section a {
    color: var(--legal-primary);
    text-decoration: underline;
    transition: all 0.3s ease;
}

.legal-section a:hover {
    color: #16a34a;
    text-decoration: none;
}

.legal-section code {
    background: var(--legal-gray-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #dc2626;
}

/* ================================================
   CAJAS DESTACADAS
   ================================================ */

.legal-highlight {
    background: var(--legal-highlight-bg);
    border-left: 4px solid var(--legal-primary);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.legal-highlight h3 {
    color: var(--legal-primary);
    margin-top: 0;
    font-size: 1.1rem;
}

.legal-highlight p,
.legal-highlight li {
    color: var(--legal-dark);
}

.legal-warning {
    background: var(--legal-warning-bg);
    border-left: 4px solid var(--legal-warning-border);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.legal-warning h3 {
    color: #d97706;
    margin-top: 0;
    font-size: 1.1rem;
}

.legal-warning p,
.legal-warning li {
    color: var(--legal-dark);
}

.legal-info-box {
    background: var(--legal-info-bg);
    border: 2px solid var(--legal-info-border);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.legal-info-box ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.legal-info-box li {
    padding: 0.4rem 0;
    color: var(--legal-dark);
}

/* ================================================
   DERECHOS DEL USUARIO
   ================================================ */

.legal-rights {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

.right-item {
    background: var(--legal-white);
    border: 2px solid var(--legal-gray-border);
    padding: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.right-item:hover {
    border-color: var(--legal-primary);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.1);
}

.right-item h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--legal-dark);
}

.right-item p {
    font-size: 0.9rem;
    margin: 0;
}

/* ================================================
   COOKIES - TIPOS Y CATEGORÍAS
   ================================================ */

.cookie-type {
    background: var(--legal-gray-light);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.cookie-type h4 {
    margin-top: 0;
    color: var(--legal-primary);
}

.cookie-category {
    margin: 2rem 0;
    border: 2px solid var(--legal-gray-border);
    border-radius: 12px;
    padding: 1.5rem;
    background: var(--legal-white);
}

.cookie-category-title {
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cookie-category-title.necessary {
    color: #10b981;
}

.cookie-category-title.functional {
    color: #3b82f6;
}

.cookie-category-title.analytics {
    color: #8b5cf6;
}

.cookie-category-title.advertising {
    color: #f59e0b;
}

.cookie-category-title.social {
    color: #ec4899;
}

/* Tablas de cookies */
.cookie-table {
    overflow-x: auto;
    margin: 1rem 0;
}

.cookie-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--legal-white);
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.85rem;
}

.cookie-table thead {
    background: var(--legal-gray-light);
}

.cookie-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--legal-dark);
    border-bottom: 2px solid var(--legal-gray-border);
}

.cookie-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--legal-gray-border);
    color: var(--legal-gray);
}

.cookie-table tbody tr:hover {
    background: var(--legal-gray-light);
}

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

.cookie-note {
    font-size: 0.85rem;
    color: var(--legal-gray);
    margin-top: 0.5rem;
    font-style: italic;
}

/* ================================================
   FINALIDADES Y PROPÓSITOS
   ================================================ */

.purpose-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

.purpose-item {
    background: var(--legal-gray-light);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--legal-primary);
}

.purpose-item h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--legal-dark);
}

.purpose-item ul {
    margin: 0;
}

/* ================================================
   NAVEGADORES Y HERRAMIENTAS
   ================================================ */

.browser-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

.browser-item {
    background: var(--legal-white);
    border: 2px solid var(--legal-gray-border);
    padding: 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.browser-item:hover {
    border-color: var(--legal-primary);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.1);
}

.browser-item h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--legal-dark);
}

.browser-item p {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.browser-item a {
    font-size: 0.85rem;
}

/* ================================================
   CONFIGURACIÓN DE COOKIES
   ================================================ */

.cookie-settings-button {
    text-align: center;
    margin: 2rem 0;
}

.btn-cookie-settings {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--legal-primary);
    color: var(--legal-white);
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-cookie-settings:hover {
    background: #16a34a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

/* ================================================
   ACEPTACIÓN FINAL
   ================================================ */

.legal-acceptance {
    background: var(--legal-primary);
    color: var(--legal-white);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    margin-top: 3rem;
    box-shadow: var(--legal-shadow);
}

.legal-acceptance p {
    color: var(--legal-white);
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
}

/* ================================================
   ANIMACIONES
   ================================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.legal-section:nth-child(2) {
    animation-delay: 0.1s;
}

.legal-section:nth-child(3) {
    animation-delay: 0.2s;
}

.legal-section:nth-child(4) {
    animation-delay: 0.3s;
}

/* ================================================
   RESPONSIVE - TABLET (768px+)
   ================================================ */

@media (min-width: 768px) {
    .legal-hero {
        padding: 3.5rem 1.5rem;
    }

    .legal-hero-title {
        font-size: 2.5rem;
    }

    .legal-hero-subtitle {
        font-size: 1.05rem;
    }

    .legal-hero-description {
        font-size: 1.1rem;
    }

    .legal-article {
        padding: 3rem 0;
    }

    .legal-wrapper {
        padding: 0 1.5rem;
    }

    .legal-section h2 {
        font-size: 1.8rem;
    }

    .legal-section h3 {
        font-size: 1.4rem;
    }

    .legal-section h4 {
        font-size: 1.1rem;
    }

    .legal-section p,
    .legal-section li {
        font-size: 1rem;
    }

    .legal-rights {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .purpose-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .browser-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .cookie-table table {
        font-size: 0.9rem;
    }
}

/* ================================================
   RESPONSIVE - DESKTOP (1024px+)
   ================================================ */

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

    .legal-hero-title {
        font-size: 3rem;
    }

    .legal-article {
        padding: 4rem 0;
    }

    .legal-wrapper {
        padding: 0 2rem;
    }

    .legal-section h2 {
        font-size: 2rem;
    }

    .legal-section h3 {
        font-size: 1.5rem;
    }

    .legal-rights {
        grid-template-columns: repeat(4, 1fr);
    }

    .purpose-list {
        grid-template-columns: repeat(4, 1fr);
    }

    .cookie-table table {
        font-size: 0.95rem;
    }
}

/* ================================================
   LARGE DESKTOP (1200px+)
   ================================================ */

@media (min-width: 1200px) {
    .legal-wrapper {
        max-width: 1000px;
    }

    .legal-hero-content {
        max-width: 1000px;
    }
}

/* ================================================
   ACCESIBILIDAD
   ================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    ::before,
    ::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ================================================
   IMPRESIÓN
   ================================================ */

@media print {
    .legal-hero {
        background: none;
        color: var(--legal-dark);
        border-bottom: 2px solid var(--legal-dark);
    }

    .legal-highlight,
    .legal-warning,
    .legal-info-box {
        border: 1px solid var(--legal-dark);
        background: none;
    }

    .legal-acceptance {
        background: none;
        color: var(--legal-dark);
        border: 2px solid var(--legal-dark);
    }

    .btn-cookie-settings {
        display: none;
    }

    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
    }
}

/* ================================================
   DARK MODE (Opcional - para futuras implementaciones)
   ================================================ */

@media (prefers-color-scheme: dark) {
    /* Preparado para implementación futura de modo oscuro */
    /*
    :root {
        --legal-dark: #ffffff;
        --legal-white: #1a1a1a;
        --legal-gray: #d1d5db;
        --legal-gray-light: #2d2d2d;
        --legal-gray-border: #404040;
    }
    */
}