/* =========================================================
   Páginas legales (términos, privacidad, seguro y condiciones
   por paquetera). Se montan sobre style.css y home.css: navbar
   flotante, hero azul con ola y footer son los de la portada;
   aquí vive sólo el índice lateral, la tarjeta de contenido y
   lo propio de cada página.
   ========================================================= */

body.legal-page {
    background: #f7f8fd;
}

/* ---------- Hero ---------- */
.l-hero {
    padding: 9rem 0 8.5rem;
}

.l-hero-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.l-hero h1 {
    margin: 0;
    max-width: 52rem;
    font-size: clamp(2.1rem, 3.6vw, 3rem);
    line-height: 1.15;
    text-wrap: balance;
}

.l-hero .h-lead {
    margin-inline: auto;
    max-width: 42rem;
    text-wrap: balance;
}

/* La ola del hero sale al gris del cuerpo, no al blanco */
.legal-page .h-wave path,
.legal-page .h-swoosh path[fill="#ffffff"] {
    fill: #f7f8fd;
}

/* ---------- Layout ---------- */
.legal-layout {
    padding: 1.5rem 0 6rem;
}

.legal-container {
    display: flex;
    gap: 2.5rem;
    align-items: flex-start;
}

.legal-content-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ---------- Índice lateral ---------- */
.legal-sidebar {
    position: sticky;
    top: 7.5rem;
    flex-shrink: 0;
    width: 280px;
    max-height: calc(100vh - 9rem);
    overflow-y: auto;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: #fff;
}

.legal-sidebar h3 {
    margin-bottom: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.legal-nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.legal-nav a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.85rem;
    border-radius: 12px;
    color: #475569;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
    transition: var(--transition);
}

.legal-nav a:hover {
    background: var(--accent);
    color: var(--foreground);
}

.legal-nav li.active a {
    background: var(--secondary-soft);
    color: var(--secondary);
    font-weight: 600;
}

/* ---------- Buscador e imprimir ---------- */
.legal-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #fff;
}

.search-box {
    position: relative;
    flex: 1;
}

.search-box svg {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 0.8rem 1rem 0.8rem 2.75rem;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    outline: none;
    background: #fff;
    color: var(--foreground);
    font: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-box input:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px var(--secondary-soft);
}

.btn-print {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.2rem;
    border: 0;
    border-radius: 14px;
    background: var(--secondary-soft);
    color: var(--secondary);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-print:hover {
    background: rgba(51, 49, 200, 0.16);
}

/* ---------- Tarjeta de contenido ---------- */
.legal-card {
    padding: 3rem;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: #fff;
}

.legal-section {
    scroll-margin-top: 7.5rem;
    margin-bottom: 3rem;
}

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

.legal-section h2 {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    margin-bottom: 1.1rem;
    font-size: 1.6rem;
    line-height: 1.25;
    color: var(--foreground);
}

.legal-section h2 span {
    flex-shrink: 0;
    display: inline-grid;
    place-items: center;
    min-width: 2.4rem;
    height: 2.4rem;
    padding: 0 0.4rem;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.95rem;
    font-weight: 700;
    transform: translateY(-0.15rem);
}

.legal-section h3 {
    margin: 1.5rem 0 0.85rem;
    font-size: 1.15rem;
    color: var(--foreground);
}

.legal-section p {
    margin-bottom: 1.15rem;
    color: #475569;
    font-size: 1.02rem;
    line-height: 1.75;
}

.legal-section a {
    color: var(--secondary);
    font-weight: 600;
}

mark {
    padding: 0 2px;
    border-radius: 3px;
    background: rgba(255, 196, 0, 0.35);
    color: inherit;
}

/* ---------- Listas ---------- */
.legal-list {
    list-style: none;
    margin-bottom: 1.5rem;
}

.legal-list li {
    position: relative;
    margin-bottom: 0.7rem;
    padding-left: 1.85rem;
    color: #475569;
    font-size: 1.02rem;
    line-height: 1.65;
}

.legal-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.3rem;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
    background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 0.7rem no-repeat;
}

.legal-list-negative li::before {
    background: #dc2626 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='m7 7 10 10M17 7 7 17'/%3E%3C/svg%3E") center / 0.62rem no-repeat;
}

/* ---------- Avisos destacados ---------- */
.legal-callout {
    margin: 1.75rem 0;
    padding: 1.35rem 1.6rem;
    border-left: 4px solid var(--secondary);
    border-radius: 0 16px 16px 0;
    background: var(--secondary-soft);
    color: var(--secondary);
    font-size: 0.98rem;
    line-height: 1.7;
}

.legal-callout p {
    margin: 0;
    color: var(--secondary);
    font-weight: 500;
}

.legal-callout-warning {
    border-left-color: var(--primary);
    background: var(--primary-soft);
}

.legal-callout-warning p {
    color: var(--primary-dark);
}

/* ---------- Pasos del reclamo (política de seguro) ---------- */
.steps-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.step-box {
    padding: 1.4rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #f8fafc;
}

.step-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.7rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--foreground);
}

.step-badge {
    padding: 0.15rem 0.7rem;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 600;
}

/* ---------- Tarjetas por paquetera (condiciones por paquetera) ---------- */
.carrier-grid {
    display: grid;
    gap: 1.5rem;
}

.carrier-card {
    scroll-margin-top: 7.5rem;
    padding: 2.25rem;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: #fff;
}

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

.carrier-logo-box {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    padding: 0.5rem;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #f8fafc;
}

.carrier-logo-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.carrier-title h2 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.25;
    color: var(--foreground);
}

.carrier-badge {
    display: inline-block;
    margin-top: 0.3rem;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    background: var(--secondary-soft);
    color: var(--secondary);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.carrier-specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem 1.4rem;
    border-radius: 18px;
    background: #f7f8fd;
}

.spec-item {
    display: flex;
    flex-direction: column;
}

.spec-label {
    margin-bottom: 0.2rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--muted);
}

.spec-value {
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--foreground);
}

.carrier-terms-body {
    padding: 1.4rem 1.5rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    color: #334155;
    font-size: 0.95rem;
    line-height: 1.7;
    white-space: pre-line;
}

.carrier-empty {
    padding: 3rem 2rem;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: #fff;
    color: var(--muted);
    text-align: center;
}

.carrier-empty.is-error {
    color: var(--primary-dark);
}

/* Enlace de la página actual en el navbar */
.nav-links .is-current {
    color: var(--primary);
}

/* ---------- Responsive ---------- */
@media (max-width: 968px) {
    .l-hero {
        padding: 8rem 0 7.5rem;
    }

    .legal-container {
        flex-direction: column;
        align-items: stretch;
    }

    .legal-sidebar {
        position: static;
        width: 100%;
        max-height: none;
    }

    .legal-card {
        padding: 2rem;
    }
}

@media (max-width: 640px) {
    .legal-tools {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-print {
        justify-content: center;
    }

    .legal-card,
    .carrier-card {
        padding: 1.5rem;
        border-radius: 20px;
    }

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

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

/* ---------- Impresión / PDF ---------- */
@media print {
    .navbar,
    .l-hero,
    .legal-sidebar,
    .legal-tools,
    .footer,
    button,
    #mobileMenuBtn {
        display: none !important;
    }

    body.legal-page {
        background: #fff !important;
        color: #000 !important;
    }

    .legal-layout {
        padding: 0 !important;
    }

    .legal-container {
        display: block !important;
    }

    .legal-card {
        padding: 0 !important;
        border: 0 !important;
    }

    .carrier-card {
        margin-bottom: 2rem !important;
        border: 1px solid #ccc !important;
        break-inside: avoid;
    }
}

/* Botón de acción dentro de la tarjeta (eliminación de cuenta) */
.l-accion {
    margin-top: 2rem;
    text-align: center;
}

.l-accion .btn {
    border-radius: 16px;
}
