/* MeliiPrint · identidad visual (ver paleta-meliiprint.md) */

@font-face { font-family: 'Pacifico'; src: url('../fuentes/pacifico-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('../fuentes/outfit-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('../fuentes/outfit-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('../fuentes/outfit-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('../fuentes/outfit-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  /* Marca */
  --magenta: #C2186B;
  --magenta-osc: #A0125A;
  --tinta: #2A1F3D;
  --cian: #00A3D9;
  --amarillo: #FFC20E;
  --crema: #FFF6EE;
  --blanco: #FFFFFF;
  /* Pastel (solo decoración y estados) */
  --rosa: #FFB3CF;
  --rubor: #FF8FB1;
  --menta: #A8E6CF;
  --verde: #5FC9A0;
  --lavanda: #CDB4F6;
  --amarillo-p: #FFE08A;
  --durazno: #FFC8A2;
  --celeste: #A6D8F5;
  --celeste-c: #D6EEFC;
  --azul: #7DBFE8;
  /* Interfaz */
  --texto-2: #6E6380;
  --linea: #EADFE6;
  --error: #C62828;
  --radio: 20px;
  --radio-s: 12px;
  --sombra: 0 3px 0 var(--tinta);
  --sombra-suave: 0 8px 24px rgba(42, 31, 61, .08);
  --fuente: 'Outfit', 'Segoe UI', system-ui, sans-serif;
  --fuente-logo: 'Pacifico', 'Brush Script MT', cursive;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 16px;
  line-height: 1.45;
  color: var(--tinta);
  background-color: var(--crema);
  background-image: radial-gradient(rgba(194, 24, 107, .10) 2px, transparent 2.5px);
  background-size: 26px 26px;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--magenta); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; }
.titulo-logo { font-family: var(--fuente-logo); font-weight: 400; color: var(--magenta); }
h1.titulo-logo { font-size: clamp(30px, 6vw, 44px); }
h2.titulo-logo { font-size: clamp(24px, 4.5vw, 32px); }
.sub { color: var(--texto-2); }
.chico { font-size: 13px; }
.oculto { display: none !important; }
.centro { text-align: center; }
.fila { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.fila.entre { justify-content: space-between; }
.pila { display: grid; gap: 12px; }
.mt { margin-top: 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--tinta); }
.logo img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--tinta); background: #fff; }
.logo-texto { display: grid; justify-items: center; line-height: 1; }
.logo-texto b { font-family: var(--fuente-logo); font-weight: 400; color: var(--magenta); font-size: 28px; line-height: 1.1; }
.logo-texto small { font-weight: 600; font-size: 9px; letter-spacing: .5em; margin-right: -.5em; display: flex; align-items: center; gap: 6px; }
.logo-texto small::before, .logo-texto small::after { content: ''; width: 12px; height: 2px; border-radius: 2px; background: var(--cian); }
.logo-texto small::after { background: var(--amarillo); }

/* ---------- Botones ---------- */
.btn {
  --fondo: var(--blanco); --color: var(--tinta);
  appearance: none; border: 2px solid var(--tinta); background: var(--fondo); color: var(--color);
  font: 600 15px/1 var(--fuente); padding: 12px 18px; border-radius: 999px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: var(--sombra); transition: transform .08s, box-shadow .08s, background .15s;
  text-decoration: none; white-space: nowrap; min-height: 44px;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--tinta); }
.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--tinta); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: var(--sombra); }
.btn:focus-visible, .campo:focus-visible, .chip:focus-visible { outline: 3px solid var(--cian); outline-offset: 2px; }
.btn.primario { --fondo: var(--magenta); --color: #fff; }
.btn.primario:hover { --fondo: var(--magenta-osc); }
.btn.amarillo { --fondo: var(--amarillo); }
.btn.menta { --fondo: var(--menta); }
.btn.lavanda { --fondo: var(--lavanda); }
.btn.peligro { --fondo: #fff; --color: var(--error); border-color: var(--error); box-shadow: 0 3px 0 var(--error); }
.btn.plano { border-color: transparent; box-shadow: none; background: transparent; padding: 10px 12px; }
.btn.plano:hover { background: rgba(194, 24, 107, .08); transform: none; }
.btn.grande { font-size: 17px; padding: 16px 24px; min-height: 54px; }
.btn.ancho { width: 100%; }
.btn.chico { font-size: 13px; padding: 7px 12px; min-height: 34px; box-shadow: 0 2px 0 var(--tinta); }
.btn-icono { width: 40px; height: 40px; padding: 0; min-height: 0; }

/* ---------- Tarjetas ---------- */
.tarjeta { background: var(--blanco); border: 2px solid var(--tinta); border-radius: var(--radio); padding: 18px; box-shadow: 0 4px 0 var(--tinta); }
.tarjeta.suave { border-color: var(--linea); box-shadow: var(--sombra-suave); }

/* ---------- Formularios ---------- */
label.etq { display: block; font-weight: 600; font-size: 14px; }
label.etq > .campo, label.etq > select, label.etq > textarea { display: block; margin-top: 6px; }
label.etq > .sub.chico { display: block; }
label.etq .sub { font-weight: 400; }
.campo {
  font: 400 16px var(--fuente); color: var(--tinta); width: 100%;
  border: 2px solid var(--linea); border-radius: var(--radio-s); padding: 11px 13px; background: #fff;
  transition: border-color .15s;
}
.campo:focus { border-color: var(--magenta); outline: none; }
textarea.campo { min-height: 84px; resize: vertical; }
select.campo { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--tinta) 50%), linear-gradient(135deg, var(--tinta) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 12px) 52%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 34px; }
.campo.invalido { border-color: var(--error); }
.rejilla-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rejilla-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .rejilla-2, .rejilla-3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--magenta); }

/* Opciones grandes (radio como tarjeta) */
.opciones { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.opcion { position: relative; }
.opcion input { position: absolute; opacity: 0; }
.opcion span { display: grid; gap: 2px; border: 2px solid var(--linea); border-radius: var(--radio-s); padding: 12px 14px; cursor: pointer; background: #fff; }
.opcion span b { font-size: 15px; }
.opcion span small { color: var(--texto-2); }
.opcion input:checked + span { border-color: var(--magenta); background: #FFF0F6; box-shadow: 0 3px 0 var(--magenta); }
.opcion input:focus-visible + span { outline: 3px solid var(--cian); }

/* Contador − 1 + */
.contador { display: inline-flex; align-items: center; border: 2px solid var(--tinta); border-radius: 999px; background: #fff; overflow: hidden; }
.contador button { appearance: none; border: 0; background: transparent; width: 40px; height: 40px; font: 700 20px var(--fuente); cursor: pointer; color: var(--tinta); }
.contador button:hover { background: var(--crema); }
.contador button:disabled { opacity: .3; cursor: not-allowed; }
.contador output, .contador input { min-width: 36px; width: 44px; text-align: center; font: 700 16px var(--fuente); border: 0; background: transparent; color: var(--tinta); }

/* ---------- Chips, insignias ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.chip { appearance: none; border: 2px solid var(--tinta); background: #fff; border-radius: 999px; padding: 7px 14px; font: 600 14px var(--fuente); color: var(--tinta); cursor: pointer; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.chip.activo { background: var(--tinta); color: #fff; }
.chip .n { background: var(--crema); color: var(--tinta); border-radius: 999px; padding: 0 7px; font-size: 12px; }
.insignia { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 600; border: 1.5px solid var(--tinta); background: #fff; white-space: nowrap; }
.e-pendiente { background: var(--amarillo-p); }
.e-confirmado { background: var(--celeste); }
.e-imprimiendo { background: var(--lavanda); }
.e-listo { background: var(--menta); }
.e-entregado { background: var(--verde); }
.e-cancelado { background: #EEE8EE; color: var(--texto-2); border-color: var(--texto-2); }
.insignia.pagado { background: var(--menta); }
.insignia.no-pagado { background: #fff; border-style: dashed; }
.insignia.alerta { background: #FFE3E3; border-color: var(--error); color: var(--error); }

.punto-color { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--tinta); vertical-align: -2px; flex: none; }

/* ---------- Avisos ---------- */
#avisos { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(92vw, 420px); pointer-events: none; }
.aviso { background: var(--tinta); color: #fff; border-radius: 16px; padding: 12px 16px; font-weight: 500; box-shadow: 0 6px 20px rgba(0,0,0,.2); animation: entra .25s ease-out; pointer-events: auto; display: flex; gap: 10px; align-items: center; }
.aviso.error { background: var(--error); }
.aviso.ok { background: var(--magenta); }
@keyframes entra { from { opacity: 0; transform: translateY(10px); } }
.nota { border-radius: var(--radio-s); padding: 12px 14px; background: var(--crema); border: 2px dashed var(--linea); }
.nota.alerta { background: #FFF1F1; border-color: #F3B7B7; }
.nota.info { background: #EEF8FE; border-color: var(--celeste); }

/* ---------- Diálogo ---------- */
dialog.dialogo { border: 2px solid var(--tinta); border-radius: 24px; padding: 0; width: min(94vw, 520px); box-shadow: 0 6px 0 var(--tinta); color: var(--tinta); }
dialog.dialogo::backdrop { background: rgba(42, 31, 61, .45); }
.dialogo-cab { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 6px; }
.dialogo-cab h3 { margin: 0; font-size: 20px; }
.dialogo-cuerpo { padding: 8px 18px 18px; display: grid; gap: 14px; max-height: 70vh; overflow: auto; }
.dialogo-pie { padding: 0 18px 18px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- Vacío / cargando ---------- */
.vacio { text-align: center; padding: 40px 16px; display: grid; justify-items: center; gap: 10px; }
.vacio svg { width: 110px; height: 110px; }
.cargando { display: grid; place-items: center; padding: 60px 0; }
.cargando::after { content: ''; width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--rosa); border-top-color: var(--magenta); animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* Línea de tiempo del pedido */
.pasos { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; position: relative; margin: 8px 0 4px; }
.paso { display: grid; justify-items: center; gap: 6px; text-align: center; font-size: 12px; font-weight: 600; color: var(--texto-2); position: relative; }
.paso .bola { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--linea); background: #fff; display: grid; place-items: center; font-size: 16px; z-index: 1; }
.paso::before { content: ''; position: absolute; top: 16px; left: -50%; width: 100%; height: 3px; background: var(--linea); }
.paso:first-child::before { display: none; }
.paso.hecho { color: var(--tinta); }
.paso.hecho .bola { border-color: var(--tinta); background: var(--menta); }
.paso.hecho::before { background: var(--verde); }
.paso.actual .bola { background: var(--amarillo); border-color: var(--tinta); box-shadow: 0 0 0 5px rgba(255, 194, 14, .3); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
