/* ================================
   legal.css — Shared styles for legal pages
   (terminos, privacidad, cookies)
   ================================ */

/* ---------- Page Layout ---------- */
.legal-page {
    background: var(--background);
    min-height: 100vh;
}

/* ---------- Hero ---------- */
.legal-hero {
    text-align: center;
    margin-bottom: 2.5rem;
}

.legal-icon-wrapper {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark, #b91c1c));
    color: #fff;
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 32px rgba(220, 38, 38, 0.25);
}

.legal-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.legal-subtitle {
    color: var(--muted-foreground, #6b7280);
    font-size: 0.9rem;
}

/* ---------- Card ---------- */
.legal-card {
    background: var(--card, #111);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
    border-radius: 16px;
    padding: 2.5rem 3rem;
    max-width: 860px;
    margin: 0 auto 2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* ---------- Sections ---------- */
.legal-section {
    margin-bottom: 2.25rem;
    padding-bottom: 2.25rem;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.07));
}

.legal-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.legal-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary, #dc2626);
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legal-section p {
    color: var(--muted-foreground, #9ca3af);
    line-height: 1.75;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.legal-section ul {
    color: var(--muted-foreground, #9ca3af);
    padding-left: 1.5rem;
    line-height: 1.8;
    font-size: 0.95rem;
}

.legal-section ul li {
    margin-bottom: 0.35rem;
}

.legal-section a {
    color: var(--primary, #dc2626);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.legal-section a:hover {
    opacity: 0.8;
}

/* ---------- Contact Block ---------- */
.legal-contact {
    background: var(--background, #0a0a0a);
    border-radius: 10px;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.07));
    margin-top: 1rem;
}

.legal-contact p {
    margin-bottom: 0.3rem !important;
    font-size: 0.9rem;
}

/* ---------- Warning Block ---------- */
.legal-warning {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    background: rgba(234, 179, 8, 0.08);
    border: 1px solid rgba(234, 179, 8, 0.25);
    border-radius: 8px;
    padding: 0.85rem 1.1rem;
    margin-top: 1rem;
    color: #ca8a04;
    font-size: 0.9rem;
    line-height: 1.5;
}

.legal-warning svg {
    flex-shrink: 0;
    margin-top: 1px;
    stroke: #ca8a04;
}

/* ---------- Cookie Table ---------- */
.cookie-table-wrapper {
    overflow-x: auto;
    margin-top: 0.75rem;
    border-radius: 10px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.cookie-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    color: var(--muted-foreground, #9ca3af);
}

.cookie-table thead tr {
    background: rgba(255, 255, 255, 0.04);
}

.cookie-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--foreground);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.cookie-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.05));
    vertical-align: middle;
}

.cookie-table tbody tr:last-child td {
    border-bottom: none;
}

.cookie-table code {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    padding: 0.1em 0.45em;
    font-size: 0.82rem;
    font-family: 'Courier New', monospace;
}

.cookie-tag {
    display: inline-block;
    padding: 0.15em 0.6em;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.cookie-tag.essential {
    background: rgba(220, 38, 38, 0.15);
    color: #f87171;
}

.cookie-tag.analytics {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.cookie-tag.functional {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.cookie-tag.marketing {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}

/* ---------- Back Link ---------- */
.legal-back {
    text-align: center;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.legal-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--muted-foreground, #6b7280);
    font-size: 0.9rem;
    text-decoration: none;
    transition: color 0.2s;
}

.legal-back-link:hover {
    color: var(--primary, #dc2626);
}

/* ==============================
   Cookie Consent Modal
   ============================== */
.cookie-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(2px);
}

.cookie-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.cookie-modal {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    width: min(540px, calc(100vw - 2rem));
    background: var(--card, #1a1a1a);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 9001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.cookie-modal.visible {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
}

.cookie-modal-inner {
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cookie-modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary, #dc2626), #b91c1c);
    color: #fff;
    margin-bottom: 0.25rem;
}

.cookie-modal-body h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 0.5rem;
}

.cookie-modal-body p {
    font-size: 0.875rem;
    color: var(--muted-foreground, #9ca3af);
    line-height: 1.6;
    margin-bottom: 0.85rem;
}

.cookie-modal-body a {
    color: var(--primary, #dc2626);
    text-decoration: underline;
}

/* Custom Checkbox */
.cookie-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--foreground);
    user-select: none;
}

.cookie-checkbox-label input[type="checkbox"] {
    display: none;
}

.cookie-checkmark {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    border: 2px solid var(--border, rgba(255, 255, 255, 0.25));
    background: transparent;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
    position: relative;
}

.cookie-checkbox-label input:checked+.cookie-checkmark {
    background: var(--primary, #dc2626);
    border-color: var(--primary, #dc2626);
}

.cookie-checkbox-label input:checked+.cookie-checkmark::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-left: none;
    border-top: none;
    transform: rotate(45deg) translate(-1px, -1px);
}

/* Modal Actions */
.cookie-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.cookie-btn {
    padding: 0.55rem 1.3rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    font-family: inherit;
}

.cookie-btn-secondary {
    background: transparent;
    color: var(--muted-foreground, #6b7280);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.12));
}

.cookie-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--foreground);
}

.cookie-btn-primary {
    background: var(--primary, #dc2626);
    color: #fff;
}

.cookie-btn-primary:hover:not(:disabled) {
    background: #b91c1c;
}

.cookie-btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---- Responsive ---- */
@media (max-width: 640px) {
    .legal-card {
        padding: 1.5rem 1.25rem;
    }

    .cookie-modal-actions {
        flex-direction: column;
    }

    .cookie-btn {
        width: 100%;
        text-align: center;
    }
}