/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: .95rem; padding: 12px 22px; border-radius: var(--radius-md);
  border: 1px solid transparent; cursor: pointer; transition: all .15s ease; text-align: center;
  line-height: 1.1;
}
.btn-primary { background: var(--primary-500); color: #fff; }
.btn-primary:hover { background: var(--primary-600); }
.btn-primary:disabled { background: var(--neutral-300); cursor: not-allowed; }
.btn-secondary { background: var(--ink-800); color: #fff; }
.btn-secondary:hover { background: var(--ink-900); }
.btn-outline { background: transparent; border-color: var(--ink-300); color: var(--ink-800); }
.btn-outline:hover { border-color: var(--ink-800); background: var(--neutral-100); }
.btn-ghost { background: transparent; color: var(--ink-700); }
.btn-ghost:hover { background: var(--neutral-100); }
.btn-danger { background: var(--promo-500); color: #fff; }
.btn-danger:hover { background: var(--promo-600); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: .85rem; }
.btn-lg { padding: 15px 28px; font-size: 1.05rem; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: .75rem; font-weight: 700;
  padding: 4px 10px; border-radius: var(--radius-full); white-space: nowrap;
}
.badge-discount { background: var(--promo-500); color: #fff; }
.badge-installments { background: var(--secondary-100); color: var(--secondary-600); }
.badge-freeshipping { background: var(--primary-50); color: var(--primary-700); }
.badge-stock-low { background: #fff4e5; color: #b45309; }
.badge-out { background: var(--neutral-200); color: var(--ink-600); }
.badge-neutral { background: var(--neutral-100); color: var(--ink-700); }
.badge-status { background: var(--neutral-100); color: var(--ink-700); font-weight: 600; }
.badge-status.is-paid, .badge-status.is-delivered { background: var(--success-100); color: var(--success-500); }
.badge-status.is-pending { background: #fff4e5; color: #b45309; }
.badge-status.is-cancelled { background: #fdecec; color: var(--promo-600); }

/* Cards */
.card {
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-card);
  border: 1px solid var(--neutral-200);
}
.card-pad { padding: 24px; }

/* Formularios */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: .875rem; color: var(--ink-800); margin-bottom: 6px; }
.field .hint { font-size: .8rem; color: var(--ink-500); margin-top: 4px; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--neutral-300); border-radius: var(--radius-md);
  background: #fff; color: var(--ink-900); font-size: .95rem; transition: border-color .15s ease;
}
.input:focus { border-color: var(--primary-500); outline: none; box-shadow: 0 0 0 3px var(--primary-100); }
.input-error { border-color: var(--promo-500); }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .form-row { grid-template-columns: 1fr; } }

/* Alertas / flash messages */
.alert { padding: 14px 18px; border-radius: var(--radius-md); font-size: .9rem; margin-bottom: 14px; border: 1px solid transparent; }
.alert-success { background: var(--success-100); color: #1c5e28; border-color: #bfe6c5; }
.alert-error { background: #fdecec; color: #8f1616; border-color: #f5c2c2; }
.alert-info { background: var(--secondary-100); color: var(--secondary-600); border-color: #d8d2f5; }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--neutral-200); margin-bottom: 20px; }
.tab-btn {
  padding: 12px 18px; font-weight: 600; color: var(--ink-500); background: none; border: none;
  border-bottom: 3px solid transparent; cursor: pointer; font-size: .95rem;
}
.tab-btn.is-active { color: var(--ink-900); border-color: var(--primary-500); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* Paginación */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 32px 0; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md); font-weight: 600; font-size: .9rem; color: var(--ink-700);
  border: 1px solid var(--neutral-200);
}
.pagination a:hover { border-color: var(--primary-500); color: var(--primary-600); }
.pagination .is-current { background: var(--primary-500); color: #fff; border-color: var(--primary-500); }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; flex-wrap: nowrap; gap: 8px; font-size: .82rem; color: var(--ink-500); margin-top: 24px; margin-bottom: 18px; overflow: hidden; }
.breadcrumb a { flex-shrink: 0; white-space: nowrap; }
.breadcrumb a:hover { color: var(--primary-600); }
.breadcrumb .sep { flex-shrink: 0; color: var(--neutral-400); }
.breadcrumb > span:last-child {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
  color: var(--ink-700); font-weight: 600;
}

/* Skeleton loading (autocomplete) */
.skeleton { background: linear-gradient(90deg, var(--neutral-100) 25%, var(--neutral-200) 37%, var(--neutral-100) 63%); background-size: 400% 100%; animation: skeleton-loading 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes skeleton-loading { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* Empty state */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 46vh; text-align: center; padding: 40px 20px; color: var(--ink-500);
}
.empty-state .icon-circle {
  width: 96px; height: 96px; border-radius: 999px; background: var(--neutral-100);
  display: flex; align-items: center; justify-content: center; margin-bottom: 22px;
}
.empty-state svg { opacity: .55; }
.empty-state h2 { color: var(--ink-900); margin-bottom: 8px; }
.empty-state p { max-width: 36ch; margin: 0 auto; }

/* Toast (aviso flotante temporal) */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px);
  background: var(--ink-900); color: #fff; font-size: .88rem; font-weight: 600; padding: 12px 20px;
  border-radius: var(--radius-md); box-shadow: var(--shadow-popover); z-index: 400; opacity: 0;
  pointer-events: none; transition: opacity .2s ease, transform .2s ease; max-width: 90vw; text-align: center;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Modal genérico (pop-up de upsell, etc.) */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(38,44,48,.55); opacity: 0; pointer-events: none;
  transition: opacity .2s ease; z-index: 400;
}
.modal-backdrop.is-open { opacity: 1; pointer-events: auto; }
.modal-box {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%,-46%); background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popover); max-width: 460px; width: 92vw; padding: 30px 28px 28px; z-index: 401;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.modal-box.is-open { opacity: 1; pointer-events: auto; transform: translate(-50%,-50%); }
.modal-close { position: absolute; top: 14px; right: 14px; background: var(--neutral-100); border: none; width: 30px; height: 30px; border-radius: 999px; cursor: pointer; font-size: .9rem; }
.modal-close:hover { background: var(--neutral-200); }
