/* ============================================================
   1. LAYOUT GENERAL DE LA SECCIÓN CLIENTES
=========================================================== */

#clientesSection {
  background: #f3f4f8;
  min-height: calc(100vh - 60px);
}

/* ============================================================
   2. CABECERA: TÍTULO + BOTONES (BUSCAR / NUEVO / MENÚ)
=========================================================== */

.clientes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
}

.clientes-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.clientes-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

/* Botones redondos en la cabecera de clientes */
.clientes-header .icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.18);
  cursor: pointer;
}

.clientes-header .icon-btn img {
  width: 20px;
  height: 20px;
  filter: invert(1);
  opacity: 0.9;
}

.clientes-header .icon-btn:active {
  transform: scale(0.95);
}

/* Menú desplegable de opciones */
.clientes-menu {
  position: absolute;
  top: 46px;
  right: 0;
  background: #ffffff;
  border-radius: 14px;
  min-width: 210px;
  padding: 6px 0;
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.25);
  z-index: 600;
}

.clientes-menu.hidden {
  display: none;
}

.clientes-menu button {
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: none;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
  color: #111827;
}

.clientes-menu button:hover {
  background: #e0f2fe;
}

.clientes-menu hr {
  border: none;
  border-top: 1px solid #e5e7eb;
  margin: 4px 0;
}

/* ============================================================
   3. BUSCADOR SUPERIOR
   (Reutiliza .search-box de otros estilos)
=========================================================== */

#c-searchBox {
  background: #e0f2fe;
}

/* ============================================================
   4. LISTA DE CLIENTES (CARDS)
=========================================================== */

.clientes-list {
  padding: 10px 10px 80px;
}

/* Tarjeta de cliente */
.cliente-card {
  background: #ffffff;
  border-radius: 18px;
  padding: 11px 56px 11px 12px;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  position: relative;
}

.cliente-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 700;
  background: #fee2e2;
  color: #b91c1c;
  cursor: pointer;
}
.cliente-delete:active { transform: scale(0.96); }

.cliente-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.cliente-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cliente-nombre {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
}

.cliente-contacto {
  font-size: 12px;
  color: #6b7280;
}

.cliente-extra {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

/* Etiqueta tipo “Frecuente” / “Mayorista” */
.cliente-tag {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

/* Total de compras (texto pequeño) */
.cliente-resumen {
  font-size: 11px;
  color: #9ca3af;
}

/* Estado cuando no hay clientes */
#clientesEmpty {
  text-align: center;
  padding: 18px 8px;
  color: #9ca3af;
}

/* ============================================================
   5. MODAL CLIENTES – CONTENEDOR Y CABECERA
=========================================================== */

#clientesModal .modal-content.clientes-modal {
  max-width: 480px;
  width: 92%;
  border-radius: 22px;
  background: #ffffff;
  padding: 16px 16px 18px;
  box-shadow: 0 25px 55px rgba(15, 23, 42, 0.35);
  position: relative;
}

#clientesModal .clientes-head {
  margin-bottom: 10px;
}

#clientesModal .clientes-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
}

#clientesModal .clientes-head small {
  font-size: 13px;
  color: #9ca3af;
}

/* ============================================================
   6. CAMPOS FLOTANTES DEL MODAL CLIENTES
   (Mismo estilo suave que el modal de ventas)
=========================================================== */

#clientesModal .field {
  position: relative;
  margin-bottom: 18px;
  width: 100%;
}

/* INPUT + TEXTAREA (estilo base SOLO en el modal de clientes) */
#clientesModal .field input,
#clientesModal .field textarea {
  width: 100%;
  padding: 18px 14px 10px;
  font-size: 15px;
  border-radius: 14px;
  border: 1.6px solid #d1d5db;
  background: #f9fafb;
  transition: border-color 0.2s, background-color 0.2s;
  outline: none;
  box-sizing: border-box;
}

/* Foco */
#clientesModal .field input:focus,
#clientesModal .field textarea:focus {
  border-color: #0ea5e9;
  background: #ffffff;
}

/* LABEL flotante */
#clientesModal .field label {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: #6b7280;
  pointer-events: none;
  background: transparent;
  padding: 0 4px;
  transition: all 0.18s ease;
}

/* Cuando hay texto o foco → sube */
#clientesModal .field input:not(:placeholder-shown) + label,
#clientesModal .field textarea:not(:placeholder-shown) + label,
#clientesModal .field input:focus + label,
#clientesModal .field textarea:focus + label {
  top: -7px;
  left: 12px;
  background: #ffffff;
  font-size: 12px;
  color: #0ea5e9;
  transform: none;
  padding: 0 6px;
}

/* Textarea */
#clientesModal .field textarea {
  min-height: 80px;
  resize: vertical;
}

/* Placeholder transparente solo aquí */
#clientesModal .field input::placeholder,
#clientesModal .field textarea::placeholder {
  color: transparent;
}

/* ============================================================
   7. BOTÓN GUARDAR CLIENTE
=========================================================== */

#clientesModal .btn-save {
  width: 100%;
  padding: 14px;
  border-radius: 18px;
  border: none;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #ffffff;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.35);
}

#clientesModal .btn-save:active {
  transform: scale(0.98);
}
