/* ==========================================
   CONTACTOS CLIENTES (v7848–v7854) · js/contactos.js
   Usa la base visual de Venta Agua (.venta-agua, .va-*) y los modales .cj-modal
   ========================================== */
#btnIrContactos { --c: #7c8cff; --ico: '📇'; }
#pantalla-contactos .va-cerrar { top: 10px; right: max(12px, calc((100% - 1100px) / 2 + 12px)); z-index: 5; }
@media (min-width: 600px) and (max-width: 899px) { #app-container:has(#pantalla-contactos.activa) { max-width: 100%; } }
.contactos .va-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.contactos .va-hero-txt { max-width: 380px; }

/* v7852: tres pasos grandes y numerados */
.ct-pasos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.venta-agua .ct-paso { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; margin: 0; padding: 12px 14px; text-align: left; border-radius: 10px; cursor: pointer; box-shadow: none;
    color: #dfe6ee; background: var(--sup2); border: 1px solid rgba(0, 210, 255, .45); transition: background-color .15s, border-color .15s; }
.ct-paso i { flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; font-style: normal; font-size: 16px; font-weight: 800; color: #000; background: var(--c); }
.ct-paso span { min-width: 0; }
.ct-paso b { display: block; font-size: 14px; color: #fff; }
.ct-paso small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: #8a93a0; }
.venta-agua .ct-paso.hecho { border-color: rgba(46, 232, 138, .6); }
.ct-paso.hecho i { background: var(--ok); }
.venta-agua .ct-paso:disabled { opacity: .45; cursor: default; }
.venta-agua .ct-paso:not(:disabled):focus-visible { outline: none; border-color: var(--c); box-shadow: 0 0 0 1px var(--c); }
@media (hover: hover) { .venta-agua .ct-paso:not(:disabled):hover { background: rgba(255, 70, 70, .22); border-color: #ff4646; box-shadow: none; } }

/* Modales: clave, lista de los que faltan y confirmación (fuera de .venta-agua: colores propios) */
.ct-modal { --c: #00d2ff; --linea: rgba(255, 255, 255, .08); align-items: flex-start; padding: max(16px, 8vh) 16px 42px; overflow-y: auto; }
.ct-modal .cj-modal-caja { margin: 0 auto; }
.ct-caja { width: min(360px, 100%); }
.ct-caja-lista { width: min(720px, 100%); max-height: calc(100dvh - max(16px, 8vh) - 42px); overflow: hidden; }
.ct-modal .cj-modal-cab h3 { min-width: 0; font-size: 14px; line-height: 1.3; }
.ct-modal .cj-modal-cab h3 small { display: block; margin: 2px 0 0; }
.ct-modal-cuerpo { display: flex; flex-direction: column; gap: 10px; padding: 4px 16px 16px; }
.ct-modal-cuerpo p { margin: 0; font-size: 14px; line-height: 1.45; color: #dfe6ee; }
.ct-modal-cuerpo p b { color: #fff; }
.ct-modal #ct_clave { width: 100%; max-width: 100%; margin: 0; height: 44px; padding: 0 12px; font-size: 18px; text-align: center; border-radius: 8px; box-sizing: border-box; text-transform: none;
    color: #e6e6e6; background: #000; border: 1px solid rgba(255, 255, 255, .15); }
.ct-modal #ct_clave::placeholder { font-size: 14px; color: #6c7684; -webkit-text-security: none; }
.ct-modal #ct_clave:focus { outline: none; border-color: var(--c); }
.ct-conf-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ct-modal .ct-btn { width: 100%; margin: 0; height: 42px; padding: 0 12px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: none; white-space: nowrap; color: #000; background: var(--c); border: 1px solid var(--c); }
.ct-modal .ct-btn:disabled { opacity: .4; cursor: default; }
.ct-modal .ct-btn.sec { width: auto; color: #b8c0cc; background: transparent; border-color: rgba(255, 255, 255, .25); }
@media (hover: hover) { .ct-modal .ct-btn.sec:hover { color: #fff; border-color: #fff; background: transparent; } }

/* v7853: Último paso, guardar en Contactos con instrucciones */
.ct-modal .ct-btn.ct-btn-grande { height: 56px; font-size: 17px; font-weight: 700; color: #000; background: #2ee88a; border-color: #2ee88a; }
.ct-listo-pasos { margin: 0; padding: 0 0 0 20px; font-size: 14px; line-height: 1.5; color: #dfe6ee; }
.ct-listo-pasos li { margin: 0 0 6px; }
.ct-listo-pasos b { color: #fff; }

/* Lista de los que no están en el celular */
.ct-lista-herr { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding: 0 16px 10px; }
.ct-modal .ct-buscar { width: 100%; margin: 0; height: 42px; padding: 0 10px; font-size: 14px; border-radius: 8px; box-sizing: border-box; text-transform: none;
    color: #e6e6e6; background: #000; border: 1px solid rgba(255, 255, 255, .12); }
.ct-modal .ct-buscar:focus { outline: none; border-color: var(--c); }
.ct-modal .ct-lista { margin: 0 8px; padding: 0; border: 1px solid var(--linea); border-radius: 8px; scrollbar-color: #000 transparent; }
.ct-modal .ct-lista::-webkit-scrollbar-thumb { background: #000; border: 1px solid rgba(255, 255, 255, .15); }
.ct-lista-pie { padding: 12px 16px 16px; }
.ct-fila { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; margin: 0; padding: 9px 10px; cursor: pointer;
    font-size: 13px; color: #dfe6ee; border-bottom: 1px solid var(--linea); transition: background-color .15s, color .15s; }
.ct-fila:last-child { border-bottom: 0; }
.ct-fila input { width: 18px; height: 18px; margin: 0; accent-color: #ff3b3b; cursor: pointer; }
.ct-fila b { display: block; font-weight: 600; color: #fff; overflow-wrap: anywhere; }
.ct-fila small { display: block; font-size: 11px; color: #6c7684; overflow-wrap: anywhere; }
.ct-fila .ct-tel { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--c); }
@media (hover: hover) { .ct-fila:hover { background: rgba(255, 70, 70, .22); color: #fff; } .ct-fila:hover small { color: rgba(255, 255, 255, .85); } }
.ct-vacio { padding: 18px 10px; text-align: center; font-size: 13px; color: #8a93a0; }

.ct-lista-herr-1 { grid-template-columns: minmax(0, 1fr); }
.ct-fila.ct-fila-cel, .ct-fila-cel { grid-template-columns: minmax(0, 1fr) auto; cursor: default; }
.ct-modal .ct-lista-pie .ct-btn.sec { width: 100%; }

@media (max-width: 800px) {
    .ct-pasos { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .contactos .va-kpis { grid-template-columns: 1fr 1fr; }
    .ct-modal { padding: 12px 10px 34px; }
    .ct-caja-lista { max-height: calc(100dvh - 46px); }
    .ct-lista-herr { grid-template-columns: 1fr 1fr; padding: 0 10px 10px; }
    .ct-lista-herr .ct-buscar { grid-column: 1 / -1; }
    .ct-lista-pie.ct-conf-botones { grid-template-columns: minmax(0, 1fr); }
    .ct-modal .ct-btn.sec { width: 100%; }
    .ct-fila { grid-template-columns: 22px minmax(0, 1fr); }
    .ct-fila .ct-tel { grid-column: 2; }
    .ct-fila.ct-fila-cel { grid-template-columns: minmax(0, 1fr) auto; }
    .ct-fila.ct-fila-cel .ct-tel { grid-column: auto; }
}
