/* css/components.css
   ─────────────────────────────────────────────
   Componentes reutilizables: botones, inputs,
   cards, badges, modales, formularios.
   ───────────────────────────────────────────── */

/* ── Botones ──────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: var(--radio);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--trans);
  border: none;
  font-family: inherit;
  line-height: 1;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primario {
  width: 100%;
  background: var(--primario);
  color: #fff;
  padding: 14px;
  font-size: .95rem;
}
.btn-primario:hover:not(:disabled) { background: var(--primario-dk); }

.btn-secundario {
  width: 100%;
  background: transparent;
  color: var(--texto-mid);
  border: 1.5px solid var(--borde) !important;
  padding: 12px;
}
.btn-secundario:hover:not(:disabled) { background: var(--fondo); }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  background: none;
  border: 1.5px solid var(--borde);
  border-radius: 8px;
  font-size: 1rem;
  color: var(--texto-mid);
}
.btn-icon:hover { background: var(--fondo); }

.btn-wsp {
  background: var(--primario);
  color: #fff;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .8rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: var(--trans);
}
.btn-wsp:hover { background: var(--primario-dk); }

/* ── Inputs ───────────────────────────────────── */
.input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--borde);
  border-radius: var(--radio);
  font-size: .95rem;
  color: var(--texto);
  background: #fff;
  transition: border-color .2s;
  outline: none;
  font-family: inherit;
}
.input:focus  { border-color: var(--primario); }
.input::placeholder { color: var(--texto-light); }

.input-label {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  color: var(--texto-mid);
  margin-bottom: 5px;
}

.form-group  { margin-bottom: 14px; }
.form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint   { font-size: .76rem; color: var(--texto-light); margin-top: 4px; }

/* ── Card ─────────────────────────────────────── */
.card {
  background: var(--fondo-card);
  border-radius: var(--radio);
  padding: 16px;
  box-shadow: var(--sombra);
}
.card + .card { margin-top: 10px; }

/* ── Badges de estado ─────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.4;
}
.badge-nuevo      { background: #fff3cd; color: #856404; }
.badge-confirmado { background: #d1ecf1; color: #0c5460; }
.badge-enviado    { background: #d4edda; color: #155724; }
.badge-cancelado  { background: #f8d7da; color: #721c24; }
.badge-activo     { background: #d4edda; color: #155724; }
.badge-inactivo   { background: #f8d7da; color: #721c24; }
.badge-free       { background: #f0f0f0; color: #555; }
.badge-basic      { background: #e8f4fd; color: #1a5276; }
.badge-pro        { background: #fef9e7; color: #7d6608; }

/* ── Modal / overlay ──────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.visible { display: flex; }

.modal-box {
  background: #fff;
  border-radius: var(--radio-lg) var(--radio-lg) 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 20px 16px 32px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.modal-title  { font-size: 1rem; font-weight: 800; }
.modal-close  { background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--texto-light); padding: 4px; }

/* ── Header sticky ────────────────────────────── */
.page-header {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1.5px solid var(--borde);
  z-index: 100;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ── Nav inferior ─────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1.5px solid var(--borde);
  display: flex;
  z-index: 100;
}
.bottom-nav-btn {
  flex: 1;
  padding: 12px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 700;
  color: var(--texto-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: color .15s;
  font-family: inherit;
}
.bottom-nav-btn.active { color: var(--primario); }
.bottom-nav-icon { font-size: 1.2rem; }

/* ── Pantalla de auth (login/registro) ────────── */
.auth-wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--fondo);
}
.auth-box  { width: 100%; max-width: 400px; }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-icon { font-size: 2.2rem; margin-bottom: 8px; }
.auth-title     { font-size: 1.4rem; font-weight: 800; color: var(--texto); }
.auth-subtitle  { color: var(--texto-light); font-size: .88rem; margin-top: 4px; }
.auth-footer    { text-align: center; margin-top: 18px; font-size: .88rem; color: var(--texto-mid); }
.auth-link      { color: var(--primario); font-weight: 700; text-decoration: none; }

/* ── Contenido de página ──────────────────────── */
.page-content {
  max-width: 600px;
  margin: 0 auto;
  padding: 16px 16px 80px;
}

/* ── Estado vacío ─────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--texto-light);
}
.empty-state-icon { font-size: 2.8rem; margin-bottom: 10px; }
.empty-state-title { font-weight: 700; font-size: .95rem; }
.empty-state-desc  { font-size: .85rem; margin-top: 4px; }

/* ── Imagen de producto placeholder ──────────── */
.prod-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--fondo);
}
.prod-img-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: var(--fondo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

/* ── Select de estado (pedidos) ───────────────── */
.sel-estado {
  border: 1.5px solid var(--borde);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  font-family: inherit;
}

/* ── Utilidades ───────────────────────────────── */
.text-light  { color: var(--texto-light); }
.text-mid    { color: var(--texto-mid); }
.text-sm     { font-size: .85rem; }
.text-xs     { font-size: .78rem; }
.fw-bold     { font-weight: 700; }
.fw-black    { font-weight: 800; }
.mt-8        { margin-top: 8px; }
.mt-12       { margin-top: 12px; }
.mt-16       { margin-top: 16px; }
.mb-8        { margin-bottom: 8px; }
.mb-12       { margin-bottom: 12px; }
.mb-16       { margin-bottom: 16px; }
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.flex-1      { flex: 1; }
