/**
 * Estilos compartidos entre páginas de política legal
 * (privacidad.html, politica-cookies.html).
 *
 * Single source of truth: cambios de diseño a cards, tablas, pills o tipografía
 * van aquí — no en <style> inline de cada página.
 */

/* Fondo de grilla sutil — decorativo, detrás del contenido */
.grid-wallpaper {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image:
        linear-gradient(to right, #f3f4f6 1px, transparent 1px),
        linear-gradient(to bottom, #f3f4f6 1px, transparent 1px);
    background-size: 40px 40px;
}
.dark .grid-wallpaper {
    background-image:
        linear-gradient(to right, #1f2937 1px, transparent 1px),
        linear-gradient(to bottom, #1f2937 1px, transparent 1px);
}

/* ─── Cards de sección ─── */
.policy-section {
    background-color: #ffffff;
    padding: 1.25rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    border: 1px solid #e5e7eb;
    margin-bottom: 1.25rem;
}
@media (min-width: 640px) {
    .policy-section {
        padding: 1.75rem;
        margin-bottom: 1.5rem;
    }
}
.dark .policy-section {
    background-color: #1e293b;
    border-color: #334155;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ─── Headings ─── */
.policy-section h2 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
    line-height: 1.3;
}
@media (min-width: 640px) {
    .policy-section h2 {
        font-size: 1.25rem;
        margin-bottom: 0.875rem;
    }
}
.dark .policy-section h2 {
    color: #f3f4f6;
    border-bottom-color: #374151;
}

.policy-section h3 {
    font-weight: 600;
    color: #374151;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.9375rem;
}
@media (min-width: 640px) {
    .policy-section h3 { font-size: 1rem; }
}
.dark .policy-section h3 { color: #d1d5db; }

/* ─── Texto ─── */
.policy-section p {
    color: #4b5563;
    line-height: 1.7;
    margin-top: 0.5rem;
    font-size: 0.9375rem;
}
@media (min-width: 640px) {
    .policy-section p { font-size: 1rem; }
}
.dark .policy-section p { color: #cbd5e1; }

.policy-section strong { color: #111827; font-weight: 600; }
.dark .policy-section strong { color: #f1f5f9; }

/* ─── Listas ─── */
.policy-section ul {
    list-style: disc;
    padding-left: 1.25rem;
    margin-top: 0.75rem;
    color: #4b5563;
    font-size: 0.9375rem;
}
@media (min-width: 640px) {
    .policy-section ul {
        padding-left: 1.5rem;
        font-size: 1rem;
    }
}
.dark .policy-section ul { color: #cbd5e1; }

.policy-section li {
    line-height: 1.7;
    margin-bottom: 0.375rem;
}
.policy-section ul li::marker { color: #9ca3af; }
.dark .policy-section ul li::marker { color: #64748b; }

/* ─── Tablas ─── */
.policy-section table {
    width: 100%;
    font-size: 0.8125rem;
    margin-top: 1rem;
    border-collapse: collapse;
    background-color: #fafafa;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}
@media (min-width: 640px) {
    .policy-section table { font-size: 0.875rem; }
}
.dark .policy-section table {
    background-color: #0f172a;
    border-color: #334155;
}
.policy-section thead,
.policy-section tr:first-child {
    background-color: #f3f4f6;
}
.dark .policy-section thead,
.dark .policy-section tr:first-child {
    background-color: #1e293b;
}
.policy-section th {
    text-align: left;
    font-weight: 600;
    color: #374151;
    padding: 0.5rem 0.625rem;
    border-bottom: 2px solid #d1d5db;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    white-space: nowrap;
}
@media (min-width: 640px) {
    .policy-section th {
        padding: 0.75rem 1rem;
        font-size: 0.8125rem;
    }
}
.dark .policy-section th {
    color: #e2e8f0;
    border-bottom-color: #475569;
}
.policy-section td {
    padding: 0.625rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: top;
    color: #4b5563;
    line-height: 1.55;
}
@media (min-width: 640px) {
    .policy-section td { padding: 0.875rem 1rem; }
}
.dark .policy-section td {
    color: #cbd5e1;
    border-bottom-color: #1e293b;
}
.policy-section tr:last-child td { border-bottom: none; }
.policy-section tbody tr:hover td,
.policy-section tr:not(:first-child):hover td {
    background-color: #f9fafb;
}
.dark .policy-section tbody tr:hover td,
.dark .policy-section tr:not(:first-child):hover td {
    background-color: #1e293b;
}

/* ─── Inline code ─── */
.policy-section code {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    background-color: #f3f4f6;
    color: #be185d;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.8125rem;
    word-break: break-all;
}
.dark .policy-section code {
    background-color: #334155;
    color: #f9a8d4;
}

/* ─── Links ─── */
.policy-section a {
    color: #218acb;
    text-decoration: underline;
    text-decoration-color: rgba(33, 138, 203, 0.3);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.15s;
    word-break: break-word;
}
.policy-section a:hover { text-decoration-color: currentColor; }
.dark .policy-section a { color: #60a5fa; }

/* ─── Pills de categoría (sólo politica-cookies) ─── */
.category-pill {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.2;
}
.pill-essential  { background-color: #d1fae5; color: #065f46; }
.pill-functional { background-color: #dbeafe; color: #1e40af; }
.pill-analytics  { background-color: #fef3c7; color: #92400e; }
.pill-marketing  { background-color: #fce7f3; color: #9d174d; }
.dark .pill-essential  { background-color: rgba(6, 95, 70, 0.4);  color: #6ee7b7; }
.dark .pill-functional { background-color: rgba(30, 64, 175, 0.4); color: #93c5fd; }
.dark .pill-analytics  { background-color: rgba(146, 64, 14, 0.4); color: #fcd34d; }
.dark .pill-marketing  { background-color: rgba(157, 23, 77, 0.4); color: #f9a8d4; }

/* ─── Header / nav superior compartido ─── */
.policy-topbar {
    position: relative;
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #e5e7eb;
}
.dark .policy-topbar {
    background-color: rgba(30, 41, 59, 0.8);
    border-bottom-color: #334155;
}
.policy-topbar-inner {
    max-width: 64rem;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.policy-topbar a.back-link {
    color: #218acb;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    text-decoration: none;
}
.policy-topbar a.back-link:hover { text-decoration: underline; }
.dark .policy-topbar a.back-link { color: #60a5fa; }
.policy-topbar-logo {
    height: 1.875rem;
    width: auto;
}

/* ─── Container central ─── */
.policy-container {
    position: relative;
    z-index: 10;
    max-width: 56rem;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    flex-grow: 1;
}
@media (min-width: 640px) {
    .policy-container { padding: 2rem 1.5rem; }
}
@media (min-width: 1024px) {
    .policy-container { padding: 2.5rem 2rem; }
}

/* ─── Header de la página (H1) ─── */
.policy-header h1 {
    font-size: 1.625rem;
    font-weight: 800;
    color: #111827;
    line-height: 1.2;
}
@media (min-width: 640px) {
    .policy-header h1 { font-size: 1.875rem; }
}
.dark .policy-header h1 { color: #ffffff; }
.policy-header { margin-bottom: 1.5rem; }
@media (min-width: 640px) {
    .policy-header { margin-bottom: 2rem; }
}

/* ─── Banner superior (pill alert) ─── */
.policy-banner {
    position: relative;
    z-index: 10;
    background-color: rgba(33, 138, 203, 0.1);
    border-bottom: 1px solid rgba(33, 138, 203, 0.2);
    color: #218acb;
    font-weight: 500;
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    line-height: 1.4;
}
@media (min-width: 640px) {
    .policy-banner { font-size: 0.875rem; }
}

/* ─── Footer ─── */
.policy-footer {
    position: relative;
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(8px);
    margin-top: auto;
    border-top: 1px solid #e5e7eb;
}
.dark .policy-footer {
    background-color: rgba(30, 41, 59, 0.7);
    border-top-color: #334155;
}
.policy-footer-inner {
    max-width: 80rem;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
}
.dark .policy-footer-inner { color: #9ca3af; }
.policy-footer-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}
.policy-footer-links a {
    color: #218acb;
    text-decoration: none;
}
.policy-footer-links a:hover { text-decoration: underline; }
.dark .policy-footer-links a { color: #60a5fa; }
.policy-footer-sep {
    color: #d1d5db;
    user-select: none;
}
.dark .policy-footer-sep { color: #475569; }
