/* Centro de prevención — mobile first */

.ce-page {
    padding: 0 0 calc(2.5rem + env(safe-area-inset-bottom, 0px));
    background: #f3f4f6;
    min-height: 60vh;
}

/* Hero compacto en móvil */
.ce-hero {
    background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    padding: 1.25rem 0 1.1rem;
    margin-bottom: 0;
}

.ce-hero__eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #d4af37;
}

.ce-hero__title {
    margin: 0 0 0.45rem;
    font-size: 1.45rem;
    line-height: 1.15;
    font-weight: 800;
}

.ce-hero__lead {
    margin: 0 0 0.75rem;
    font-size: 0.88rem;
    line-height: 1.45;
    color: #cbd5e1;
}

.ce-hero__chips {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.ce-hero__chips li {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
}

/* Layout principal */
.ce-main {
    padding-top: 0.75rem;
    padding-bottom: 1rem;
}

/* Barra de búsqueda sticky en móvil */
.ce-toolbar {
    position: sticky;
    top: var(--site-header-height, 64px);
    z-index: 40;
    margin: 0 -0.75rem 0.85rem;
    padding: 0.65rem 0.75rem 0.75rem;
    background: rgba(243, 244, 246, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.ce-search { display: grid; gap: 0.55rem; }

.ce-search__label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
}

.ce-search__bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0 0.55rem 0 0.85rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.ce-search__bar:focus-within {
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.ce-search__bar > i {
    color: #9ca3af;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.ce-search__bar input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 1rem;
    outline: none;
    padding: 0.65rem 0;
}

.ce-search__submit {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: #111827;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: grid;
    place-items: center;
}

.ce-search__submit:active { transform: scale(0.96); }

/* Filtros colapsables */
.ce-filters {
    border: 1px dashed #d1d5db;
    border-radius: 12px;
    padding: 0 0.75rem 0.75rem;
    background: #fff;
}

.ce-filters summary {
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 700;
    color: #374151;
    padding: 0.75rem 0;
    list-style: none;
    user-select: none;
}

.ce-filters summary::-webkit-details-marker { display: none; }

.ce-filters summary::before {
    content: "+ ";
    font-weight: 800;
    color: #9ca3af;
}

.ce-filters[open] summary::before { content: "− "; }

.ce-filters__grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: 1fr;
}

.ce-field label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.76rem;
    font-weight: 700;
    color: #4b5563;
}

.ce-field input {
    width: 100%;
    min-height: 46px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 0.65rem 0.8rem;
    font: inherit;
    font-size: 1rem;
    background: #fafafa;
}

.ce-field input:focus {
    outline: none;
    border-color: #111827;
    background: #fff;
}

.ce-field--wide { grid-column: 1 / -1; }

.ce-search__actions {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.ce-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 46px;
    padding: 0 1rem;
    border-radius: 12px;
    border: none;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
}

.ce-btn--primary {
    background: #d4af37;
    color: #111;
}

.ce-btn--primary:active { filter: brightness(0.95); }

.ce-btn--ghost {
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #374151;
}

/* Toast / estado */
.ce-toast {
    margin-top: 0.55rem;
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    font-size: 0.84rem;
    line-height: 1.4;
}

.ce-toast.ok { background: #ecfdf5; border: 1px solid #86efac; color: #166534; }
.ce-toast.warn { background: #fffbeb; border: 1px solid #fcd34d; color: #92400e; }
.ce-toast.err { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }

/* Lista */
.ce-list-section { display: grid; gap: 0.65rem; }

.ce-list-head { padding: 0 0.1rem; }

.ce-list-title {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    font-weight: 800;
    color: #111827;
}

.ce-list-hint {
    margin: 0;
    font-size: 0.8rem;
    color: #6b7280;
    line-height: 1.4;
}

.ce-lista {
    display: grid;
    gap: 0.75rem;
}

.ce-empty {
    text-align: center;
    color: #6b7280;
    padding: 2rem 0.75rem;
    margin: 0;
    font-size: 0.92rem;
}

/* Tarjetas mobile-first */
.ce-card {
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 16px;
    padding: 0.95rem 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ce-card-head {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
}

.ce-card-head h2 {
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
    font-weight: 800;
    color: #111827;
}

.ce-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.ce-pill {
    display: inline-block;
    border-radius: 999px;
    padding: 0.22rem 0.55rem;
    font-size: 0.68rem;
    font-weight: 700;
    background: #f3f4f6;
    color: #374151;
}

.ce-pill.warn { background: #fef3c7; color: #92400e; }
.ce-pill.bad { background: #fee2e2; color: #991b1b; }

.ce-facts {
    display: grid;
    gap: 0.35rem;
    margin: 0 0 0.55rem;
    padding: 0;
    list-style: none;
}

.ce-facts li {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    font-size: 0.82rem;
    color: #4b5563;
    line-height: 1.35;
    word-break: break-word;
}

.ce-facts i {
    width: 1rem;
    text-align: center;
    color: #9ca3af;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.ce-desc {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #374151;
    white-space: pre-wrap;
}

.ce-conv-wrap { margin-top: 0.75rem; }

.ce-conv-wrap .wa-view {
    border-radius: 12px;
    box-shadow: none;
}

.ce-conv-wrap .wa-view-body {
    max-height: min(52vh, 360px);
}

.ce-disclaimer {
    margin: 1.25rem 0 0;
    padding: 0.85rem 0.75rem;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e8eaed;
    font-size: 0.78rem;
    color: #6b7280;
    line-height: 1.45;
}

.ce-disclaimer i { color: #9ca3af; margin-right: 0.25rem; }

/* Tablet+ */
@media (min-width: 640px) {
    .ce-hero { padding: 1.75rem 0 1.5rem; }
    .ce-hero__title { font-size: 1.85rem; }
    .ce-hero__lead { font-size: 0.95rem; max-width: 36rem; }

    .ce-toolbar {
        margin: 0 0 1rem;
        padding: 0;
        position: static;
        background: transparent;
        backdrop-filter: none;
        border: 0;
    }

    .ce-search {
        background: #fff;
        border: 1px solid #e8eaed;
        border-radius: 16px;
        padding: 1rem 1.1rem;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    }

    .ce-filters__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ce-search__actions {
        grid-template-columns: auto auto;
        justify-content: flex-start;
        width: fit-content;
    }

    .ce-btn { width: auto; min-width: 140px; }

    .ce-card-head {
        grid-template-columns: 1fr auto;
        align-items: start;
    }

    .ce-card-badges { justify-content: flex-end; }
}

/* Desktop */
@media (min-width: 900px) {
    .ce-main { max-width: 860px; margin: 0 auto; }

    .ce-hero__title { font-size: 2.1rem; }

    .ce-filters__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ce-field--wide { grid-column: span 2; }

    .ce-lista { gap: 1rem; }

    .ce-card { padding: 1.1rem 1.15rem; }
}
