/* ============================================================
   ADMIN PANEL - Sol Naciente
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --azul-900: #12345b;
  --azul-800: #1c4d8d;
  --azul-700: #2563eb;
  --azul-100: #eaf2fb;
  --amarillo: #ffd700;
  --rojo: #d62828;
  --rojo-100: #fde8e8;
  --verde: #168a48;
  --verde-100: #ddf8e9;
  --ambar: #b7791f;
  --ambar-100: #fff7d6;
  --fondo: #f6f8fb;
  --panel: #ffffff;
  --borde: #dfe7f0;
  --texto: #182230;
  --muted: #667085;
  --sombra: 0 14px 36px rgba(15, 23, 42, 0.10);
  --sombra-suave: 0 8px 22px rgba(15, 23, 42, 0.07);
}

body {
  font-family: 'Roboto', Arial, sans-serif;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(255, 215, 0, 0.12), transparent 30%),
    linear-gradient(180deg, #fbfcff 0%, var(--fondo) 100%);
  color: var(--texto);
  min-height: 100vh;
}

/* ===== LOGIN ===== */
.pantalla-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(18, 52, 91, 0.94), rgba(28, 77, 141, 0.90)),
    url('../recursos/fondomenu.png') center/cover;
  padding: 20px;
}

.login-box {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  padding: 34px 32px;
  width: 100%;
  max-width: 410px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.22);
  text-align: center;
  backdrop-filter: blur(8px);
}

.login-logo {
  width: 78px;
  margin-bottom: 12px;
  filter: drop-shadow(0 8px 16px rgba(28, 77, 141, 0.18));
}

.login-box h2 {
  margin: 0 0 4px;
  color: var(--azul-900);
  font-family: 'Lobster', cursive;
  font-size: 1.85rem;
}

.login-subtitulo {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 0.95rem;
}

/* ===== FORMULARIOS ===== */
.campo {
  text-align: left;
  margin-bottom: 16px;
}

.campo label {
  display: block;
  font-weight: 700;
  font-size: 0.86rem;
  margin-bottom: 7px;
  color: #344054;
}

.campo input,
.campo textarea,
.campo select,
.filtros select,
.filtros input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--borde);
  border-radius: 10px;
  font-size: 0.95rem;
  transition: border 0.2s, box-shadow 0.2s, background 0.2s;
  font-family: inherit;
  background: #fff;
  color: var(--texto);
}

.campo textarea {
  resize: vertical;
  min-height: 92px;
}

.campo input:focus,
.campo textarea:focus,
.campo select:focus,
.filtros select:focus,
.filtros input:focus {
  outline: none;
  border-color: var(--azul-700);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.campo-clave {
  position: relative;
}

.campo-clave input {
  padding-right: 44px;
}

.btn-ver-clave {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f3f6fa;
  border: none;
  cursor: pointer;
  color: var(--azul-800);
}

/* ===== BOTONES ===== */
.btn-primario,
.btn-secundario,
.btn-peligro {
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 0.92rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primario {
  background: linear-gradient(135deg, var(--azul-800), var(--azul-700));
  color: #fff;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

.btn-primario:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28);
}

.btn-primario:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn-secundario {
  background: #fff;
  color: var(--azul-800);
  border-color: rgba(28, 77, 141, 0.24);
}

.btn-secundario:hover {
  background: var(--azul-100);
}

.btn-peligro {
  background: #fff;
  color: var(--rojo);
  border-color: rgba(214, 40, 40, 0.24);
}

.btn-peligro:hover {
  background: var(--rojo-100);
}

.btn-sm { padding: 7px 12px; font-size: 0.82rem; }
.btn-full { width: 100%; }

/* ===== HEADER ADMIN ===== */
.admin-header {
  background: rgba(255, 255, 255, 0.92);
  color: var(--texto);
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--borde), 0 10px 24px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(10px);
}

.admin-header-izq {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.admin-titulo {
  font-family: 'Lobster', cursive;
  color: var(--azul-900);
  font-size: 1.35rem;
}

.admin-header-der {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.nombre-admin {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 8px 10px;
  background: #f3f6fa;
  border-radius: 999px;
}

/* ===== MAIN ===== */
.admin-main {
  max-width: 1220px;
  margin: 26px auto 42px;
  padding: 0 18px;
}

.tabs,
.barra-acciones,
.filtros,
.tabla-contenedor {
  animation: entradaPanel 0.35s ease both;
}

@keyframes entradaPanel {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== TABS ===== */
.tabs {
  display: inline-flex;
  gap: 6px;
  margin-bottom: 20px;
  padding: 5px;
  background: #eaf0f7;
  border: 1px solid var(--borde);
  border-radius: 12px;
}

.tab {
  background: transparent;
  border: none;
  border-radius: 9px;
  padding: 10px 18px;
  cursor: pointer;
  font-size: 0.93rem;
  font-weight: 800;
  color: #475467;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.tab:hover {
  color: var(--azul-800);
}

.tab.activo {
  background: #fff;
  color: var(--azul-900);
  box-shadow: var(--sombra-suave);
}

.tab-contenido { display: none; }
.tab-contenido.activo { display: block; }

/* ===== BARRA ACCIONES ===== */
.barra-acciones {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.barra-acciones h2 {
  margin: 0;
  color: var(--azul-900);
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: 0;
}

/* ===== FILTROS ===== */
.filtros {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  background: var(--panel);
  border: 1px solid var(--borde);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--sombra-suave);
}

.filtros select,
.filtros input {
  min-width: 210px;
  flex: 1;
  background: #fbfcff;
}

/* ===== TABLA ===== */
.tabla-contenedor {
  background: var(--panel);
  border: 1px solid var(--borde);
  border-radius: 16px;
  box-shadow: var(--sombra);
  overflow-x: auto;
}

.tabla {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 720px;
}

.tabla thead th {
  background: #f7f9fc;
  color: #475467;
  padding: 13px 14px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--borde);
}

.tabla tbody tr {
  border-bottom: 1px solid var(--borde);
  transition: background 0.15s;
}

.tabla tbody tr:hover {
  background: #fbfdff;
}

.tabla tbody td {
  padding: 12px 14px;
  font-size: 0.91rem;
  vertical-align: middle;
  border-bottom: 1px solid #eef2f6;
}

.tabla .thumb,
.tabla .sin-imagen {
  width: 58px;
  height: 50px;
  border-radius: 10px;
}

.tabla .thumb {
  object-fit: cover;
  border: 1px solid var(--borde);
}

.tabla .sin-imagen {
  background: #f3f6fa;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #98a2b3;
  font-size: 1.25rem;
}

.badge-activo,
.badge-inactivo {
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
}

.badge-activo {
  background: var(--verde-100);
  color: var(--verde);
}

.badge-inactivo {
  background: var(--rojo-100);
  color: var(--rojo);
}

.acciones-tabla {
  display: flex;
  gap: 7px;
  flex-wrap: nowrap;
}

.btn-icono {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-icono:hover {
  transform: translateY(-2px);
  box-shadow: var(--sombra-suave);
}

.btn-editar { background: var(--azul-100); color: var(--azul-800); }
.btn-eliminar { background: var(--rojo-100); color: var(--rojo); }
.btn-toggle { background: var(--ambar-100); color: var(--ambar); }

/* ===== MODAL ===== */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.58);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(6px);
}

.modal.abierto {
  display: flex;
}

.modal-contenido {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.8);
  animation: modalIn 0.24s ease both;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-grande { max-width: 980px; }
.modal-chico { max-width: 430px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--borde);
  background: #fbfcff;
  position: sticky;
  top: 0;
  z-index: 1;
}

.modal-header h3 {
  margin: 0;
  color: var(--azul-900);
  font-size: 1.15rem;
  font-weight: 900;
}

.btn-cerrar-modal {
  background: #eef2f6;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 1.4rem;
  cursor: pointer;
  color: #667085;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
}

.btn-cerrar-modal:hover {
  background: var(--rojo-100);
  color: var(--rojo);
}

form {
  padding: 20px 24px 24px;
}

.producto-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  align-items: start;
}

.producto-editor {
  min-width: 0;
}

.dos-columnas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.campo-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  padding: 12px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--borde);
}

.campo-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--azul-800);
}

.campo-check label {
  font-size: 0.94rem;
  cursor: pointer;
  color: #344054;
}

.variantes-precio {
  margin: 4px 0 18px;
  padding: 16px;
  border: 1px solid #dce4f0;
  border-radius: 14px;
  background: #f9fbff;
}

.variantes-precio-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.variantes-precio-header h4 {
  margin: 0 0 5px;
  color: #172033;
  font-size: 0.95rem;
}

.variantes-precio-header p {
  margin: 0;
  color: #6b7280;
  font-size: 0.8rem;
}

.btn-variante-agregar {
  border: none;
  background: transparent;
  color: #1C4D8D;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.variante-precio-fila {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(110px, 0.45fr) 42px;
  gap: 10px;
  margin-top: 10px;
}

.variante-precio-fila input {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #d8e0ec;
  border-radius: 10px;
  background: #fff;
  color: #172033;
  font: inherit;
}

.variante-precio-fila input:focus {
  outline: none;
  border-color: #1C4D8D;
  box-shadow: 0 0 0 3px rgba(28, 77, 141, 0.1);
}

.btn-eliminar-variante {
  border: 1px solid #f1c9c9;
  border-radius: 10px;
  background: #fff;
  color: #dc2626;
  cursor: pointer;
}

@media (max-width: 600px) {
  .variante-precio-fila {
    grid-template-columns: 1fr 110px 40px;
  }
}

.modal-pie {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

/* ===== ZONA IMAGEN ===== */
.zona-imagen {
  border: 1.5px dashed #b8c5d6;
  background: #fbfcff;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.zona-imagen:hover,
.zona-imagen:focus,
.zona-imagen.drag-over {
  background: #f2f7ff;
  border-color: var(--azul-800);
  box-shadow: 0 0 0 4px rgba(28, 77, 141, 0.08);
}

.imagen-preview {
  width: 150px;
  height: 116px;
  background: #eef2f6;
  border-radius: 12px;
  margin: 0 auto 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #98a2b3;
}

.imagen-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.imagen-preview .icono-imagen {
  font-size: 2rem;
  color: #98a2b3;
}

.imagen-preview p {
  font-size: 0.82rem;
  color: #98a2b3;
  margin: 4px 0 0;
}

.imagen-controles {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.producto-preview-live {
  position: sticky;
  top: 82px;
}

.producto-preview-live h4 {
  margin: 0 0 10px;
  color: var(--azul-900);
  font-size: 0.9rem;
  font-weight: 900;
}

.producto-preview-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--borde);
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.12);
}

.producto-preview-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #e8edf8, #d0d8f0);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--azul-800);
  font-size: 3rem;
  overflow: hidden;
}

.producto-preview-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.producto-preview-body {
  padding: 16px;
}

.producto-preview-body h3 {
  margin: 10px 0 6px;
  color: #111827;
  font-size: 1.05rem;
  line-height: 1.3;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.producto-preview-body p {
  margin: 0;
  overflow-wrap: anywhere;
}

#preview-live-desc {
  color: #667085;
  font-size: 0.86rem;
  line-height: 1.45;
  margin-bottom: 12px;
}

#preview-live-precio {
  color: var(--azul-800);
  font-size: 1.45rem;
  font-weight: 900;
  margin-bottom: 6px;
}

#preview-live-categoria {
  color: #98a2b3;
  font-size: 0.8rem;
  margin-bottom: 14px;
}

/* ===== TAB ORDENAR MENÚ ===== */
.ordenar-ayuda {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  background: var(--azul-100);
  border: 1px solid rgba(28, 77, 141, 0.16);
  border-radius: 10px;
  padding: 10px 14px;
}

.ordenar-ayuda i { color: var(--azul-800); }

.ordenar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

.ordenar-categorias {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.cat-ordenar-card {
  background: var(--panel);
  border: 1px solid var(--borde);
  border-radius: 14px;
  box-shadow: var(--sombra-suave);
  overflow: hidden;
  transition: box-shadow 0.2s ease, opacity 0.2s ease;
}

.cat-ordenar-card.arrastrando {
  opacity: 0.45;
}

.cat-ordenar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #f7f9fc;
  border-bottom: 1px solid var(--borde);
  flex-wrap: wrap;
  cursor: grab;
}

.drag-handle {
  color: #98a2b3;
  cursor: grab;
  font-size: 0.95rem;
}

.cat-ordenar-emoji { font-size: 1.2rem; }

.cat-ordenar-nombre {
  color: var(--azul-900);
  font-size: 0.98rem;
  margin-right: auto;
}

.cat-ordenar-count {
  font-size: 0.78rem;
  color: var(--muted);
  background: #eef2f6;
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.cat-ordenar-sort-btns {
  display: flex;
  gap: 5px;
}

.cat-ordenar-sort-btns button,
.cat-ordenar-toggle {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--borde);
  background: #fff;
  color: var(--azul-800);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: background 0.2s, transform 0.2s;
}

.cat-ordenar-sort-btns button:hover,
.cat-ordenar-toggle:hover {
  background: var(--azul-100);
  transform: translateY(-1px);
}

.lista-productos-ordenar {
  list-style: none;
  margin: 0;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.prod-ordenar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: #fbfcff;
  border: 1px solid var(--borde);
  border-radius: 10px;
  cursor: grab;
  transition: opacity 0.2s ease, box-shadow 0.2s ease;
}

.prod-ordenar-item.arrastrando {
  opacity: 0.4;
}

.prod-ordenar-item:hover {
  box-shadow: var(--sombra-suave);
}

.prod-ordenar-thumb {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--borde);
}

.prod-ordenar-thumb-vacio {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef2f6;
  color: #98a2b3;
  font-size: 0.9rem;
}

.prod-ordenar-nombre {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--texto);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prod-ordenar-precio {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--rojo);
  white-space: nowrap;
}

.prod-ordenar-badge {
  font-size: 0.68rem;
  padding: 3px 8px;
}

.ordenar-vacio {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 14px;
  list-style: none;
}

/* ---- Vista previa en vivo del menú ---- */
.ordenar-preview-live {
  position: sticky;
  top: 82px;
  background: var(--panel);
  border: 1px solid var(--borde);
  border-radius: 16px;
  box-shadow: var(--sombra);
  overflow: hidden;
}

.ordenar-preview-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px;
  border-bottom: 1px solid var(--borde);
  background: #f7f9fc;
}

.ordenar-preview-header h4 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 900;
  color: var(--azul-900);
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.ordenar-preview-header select {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid var(--borde);
  font-size: 0.82rem;
  font-family: inherit;
}

.ordenar-preview-pantalla {
  max-height: 640px;
  overflow-y: auto;
  padding: 16px;
  background:
    radial-gradient(circle at top left, rgba(255, 215, 0, 0.06), transparent 30%),
    #fafbfd;
}

.ordenar-preview-vacio {
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
  padding: 30px 10px;
}

/* Réplica acotada del look del menú público, sólo dentro de la vista previa */
.ordenar-preview-pantalla .menu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.ordenar-preview-pantalla .card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  border: 1px solid rgba(28, 77, 141, 0.10);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

.ordenar-preview-pantalla .card-imagen {
  position: relative;
  width: 96px;
  min-height: 96px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #e8edf8, #d0d8f0);
  overflow: hidden;
}

.ordenar-preview-pantalla .card-imagen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ordenar-preview-pantalla .card-sin-imagen {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
}

.ordenar-preview-pantalla .card-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: linear-gradient(135deg, #ffd700, #ffc700);
  color: #003399;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.ordenar-preview-pantalla .card-body {
  padding: 10px 12px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ordenar-preview-pantalla .card-body h3 {
  margin: 0 0 4px;
  font-size: 0.92rem;
  font-weight: 800;
  color: #111;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ordenar-preview-pantalla .card-desc {
  margin: 0 0 8px;
  color: #777;
  font-size: 0.76rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ordenar-preview-pantalla .card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  gap: 8px;
}

.ordenar-preview-pantalla .price {
  font-weight: 800;
  font-size: 0.95rem;
  color: #003399;
}

.ordenar-preview-pantalla .btn-ver {
  background: linear-gradient(135deg, #1c4d8d, #153a65);
  color: #ffd700;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .ordenar-layout {
    grid-template-columns: 1fr;
  }

  .ordenar-preview-live {
    position: static;
  }
}

/* ===== HELPERS ===== */
.ayuda {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  background: var(--azul-100);
  color: var(--azul-800);
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 900;
  cursor: help;
  margin-left: 4px;
  vertical-align: middle;
}

.cargando {
  text-align: center;
  padding: 34px;
  color: var(--muted);
}

.alerta-error {
  background: var(--rojo-100);
  color: var(--rojo);
  border: 1px solid rgba(214, 40, 40, 0.20);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  margin-bottom: 12px;
  text-align: left;
}

/* ===== SPINNER ===== */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(28, 77, 141, 0.20);
  border-top-color: var(--azul-800);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

.btn-primario .spinner {
  border-color: rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(40px);
  background: #182230;
  color: #fff;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 800;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--sombra);
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.exito { background: var(--verde); }
.toast.error { background: var(--rojo); }

/* ===== RESPONSIVE ===== */
@media (max-width: 760px) {
  .admin-header {
    padding: 12px 14px;
  }

  .admin-header-der {
    width: 100%;
    justify-content: flex-start;
  }

  .admin-main {
    margin: 18px auto 34px;
    padding: 0 12px;
  }

  .tabs {
    display: flex;
    width: 100%;
  }

  .tab {
    flex: 1;
    justify-content: center;
    padding: 10px 12px;
  }

  .dos-columnas {
    grid-template-columns: 1fr;
  }

  .producto-form-layout {
    grid-template-columns: 1fr;
  }

  .producto-preview-live {
    position: static;
  }

  .barra-acciones {
    align-items: stretch;
  }

  .barra-acciones h2,
  .barra-acciones button {
    width: 100%;
  }

  .filtros {
    padding: 12px;
  }

  .modal-pie {
    justify-content: stretch;
  }

  .modal-pie button,
  .modal-pie a {
    flex: 1;
  }

  .nombre-admin {
    display: none;
  }
}

@media (max-width: 480px) {
  .login-box {
    padding: 28px 18px;
  }

  .admin-titulo {
    font-size: 1.12rem;
  }

  .tabla {
    min-width: 620px;
  }

  .tabla tbody td {
    padding: 10px 10px;
  }

  .toast {
    width: calc(100% - 24px);
    text-align: center;
    white-space: normal;
  }
}
