/* =============================================================================
   Minu Crumbs · Estilos compartidos (tienda, tarjeta y panel)
   Paleta tomada del menú: cuadros rosa, papel crema, café chocolate.
   ========================================================================== */

:root {
  --rosa-50: #fff6f7;
  --rosa-100: #fde7eb;
  --rosa-200: #f9cfd7;
  --rosa-300: #f4b3c0;
  --rosa-400: #ec8fa3;
  --rosa-500: #e27490;
  --rosa-600: #cf5679;
  --rosa-700: #a93d5d;
  --crema: #fff8f1;
  --papel: #fffcf8;
  --cafe-900: #4a2c22;
  --cafe-700: #6b4235;
  --cafe-500: #8f6a5b;
  --cafe-300: #c9ad9f;
  --galleta: #e9c08f;
  --verde: #2f9e6a;
  --verde-claro: #e3f5ea;
  --ambar: #b7791f;
  --ambar-claro: #fdf1d8;
  --wa: #1fa855;

  --radio: 18px;
  --radio-lg: 28px;
  --sombra: 0 2px 0 rgba(74, 44, 34, 0.06), 0 10px 30px -12px rgba(169, 61, 93, 0.25);
  --fuente-titulo: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  --fuente-mano: 'Caveat', 'Segoe Print', cursive;
  --fuente: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 16px;
  line-height: 1.5;
  color: var(--cafe-900);
  background-color: #fbe1e6;
  /* Mantel de cuadros (gingham) como el borde del menú */
  background-image:
    linear-gradient(90deg, rgba(236, 143, 163, 0.32) 50%, transparent 50%),
    linear-gradient(rgba(236, 143, 163, 0.32) 50%, transparent 50%);
  background-size: 34px 34px;
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--rosa-700);
}

:focus-visible {
  outline: 3px solid var(--rosa-500);
  outline-offset: 2px;
}

.oculto {
  display: none !important;
}

.solo-lector {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Hoja de papel crema con borde punteado -------------------------------- */

.hoja {
  position: relative;
  max-width: 1100px;
  margin: 16px auto 120px;
  background: var(--crema);
  border-radius: var(--radio-lg);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.55), var(--sombra);
  padding: 20px 16px 40px;
}

.hoja::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 2px dashed var(--rosa-300);
  border-radius: calc(var(--radio-lg) - 8px);
  pointer-events: none;
}

@media (min-width: 720px) {
  .hoja {
    margin: 28px auto 120px;
    padding: 28px 40px 48px;
  }
}

/* ---- Encabezado ------------------------------------------------------------ */

.cabecera {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding-top: 6px;
}

.cabecera__logo {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 5px #fff, 0 0 0 7px var(--rosa-200);
}

.cabecera__eslogan {
  font-family: var(--fuente-titulo);
  font-weight: 600;
  color: var(--cafe-700);
  margin: 6px 0 0;
}

.cabecera__nyc {
  font-family: var(--fuente-mano);
  font-size: 1.35rem;
  color: var(--cafe-700);
  transform: rotate(-6deg);
  margin: 0;
}

@media (min-width: 720px) {
  .cabecera__nyc {
    position: absolute;
    right: 8px;
    top: 18px;
    transform: rotate(10deg);
    font-size: 1.5rem;
    line-height: 1.1;
  }
}

.nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 6px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--rosa-200);
  color: var(--cafe-900);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
}

.nav a[aria-current='page'] {
  background: var(--rosa-200);
  border-color: var(--rosa-300);
}

.nav a:hover {
  border-color: var(--rosa-400);
}

/* ---- Títulos tipo "MENÚ" ----------------------------------------------------- */

.titulo-cinta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 26px 0 8px;
}

.titulo-cinta h2,
.titulo-cinta h1 {
  margin: 0;
  font-family: var(--fuente-titulo);
  font-weight: 800;
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--cafe-900);
  background: var(--rosa-100);
  border: 2px solid var(--rosa-300);
  border-radius: 999px;
  padding: 10px 28px 6px;
}

.titulo-cinta::before,
.titulo-cinta::after {
  content: '♥';
  color: var(--rosa-500);
  font-size: 1.1rem;
}

.subtitulo-mano {
  font-family: var(--fuente-mano);
  font-size: 1.6rem;
  color: var(--rosa-600);
  text-align: center;
  margin: 0 0 18px;
}

/* ---- Botones ----------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 2px solid transparent;
  background: var(--rosa-600);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 3px 0 var(--rosa-700);
}

.btn:hover {
  background: var(--rosa-700);
}

.btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--rosa-700);
}

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

.btn--sec {
  background: #fff;
  color: var(--cafe-900);
  border-color: var(--rosa-300);
  box-shadow: 0 3px 0 var(--rosa-200);
}

.btn--sec:hover {
  background: var(--rosa-50);
}

.btn--wa {
  background: var(--wa);
  box-shadow: 0 3px 0 #17803f;
}

.btn--wa:hover {
  background: #17803f;
}

.btn--ancho {
  width: 100%;
}

.btn--peq {
  min-height: 36px;
  padding: 6px 14px;
  font-size: 0.9rem;
}

.btn-icono {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--rosa-200);
  background: #fff;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
}

.btn-icono:hover {
  background: var(--rosa-100);
}

/* ---- Formularios ---------------------------------------------------------- */

.campo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.campo > label,
.campo > .campo__etiqueta {
  font-weight: 800;
  font-size: 0.95rem;
}

.campo__ayuda {
  font-size: 0.85rem;
  color: var(--cafe-500);
  margin: 0;
}

.entrada {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 2px solid var(--rosa-200);
  background: #fff;
  font-size: 1rem;
}

.entrada:focus {
  outline: none;
  border-color: var(--rosa-500);
  box-shadow: 0 0 0 4px var(--rosa-100);
}

textarea.entrada {
  min-height: 80px;
  resize: vertical;
}

.entrada-tel {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--rosa-200);
  border-radius: 14px;
  background: #fff;
  overflow: hidden;
}

.entrada-tel:focus-within {
  border-color: var(--rosa-500);
  box-shadow: 0 0 0 4px var(--rosa-100);
}

.entrada-tel span {
  display: grid;
  place-items: center;
  padding: 0 12px;
  font-weight: 800;
  background: var(--rosa-50);
  border-right: 2px solid var(--rosa-200);
}

.entrada-tel input {
  border: 0;
  outline: none;
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 10px 14px;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  background: transparent;
}

.opciones {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.opcion {
  position: relative;
}

.opcion input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.opcion span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 8px 10px;
  border: 2px solid var(--rosa-200);
  border-radius: 14px;
  background: #fff;
  font-weight: 700;
  text-align: center;
  font-size: 0.95rem;
}

.opcion input:checked + span {
  border-color: var(--rosa-600);
  background: var(--rosa-100);
  box-shadow: inset 0 0 0 1px var(--rosa-600);
}

.opcion input:focus-visible + span {
  outline: 3px solid var(--rosa-500);
  outline-offset: 2px;
}

.error-form {
  background: #fde8e8;
  border: 2px solid #f3b4b4;
  color: #9b1c1c;
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 700;
  margin: 0 0 12px;
}

/* ---- Tarjetas genéricas, etiquetas -------------------------------------------- */

.tarjeta {
  background: var(--papel);
  border: 2px solid var(--rosa-200);
  border-radius: var(--radio);
  padding: 18px;
}

.etiqueta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  background: var(--rosa-100);
  color: var(--rosa-700);
  white-space: nowrap;
}

.etiqueta--pendiente { background: var(--ambar-claro); color: var(--ambar); }
.etiqueta--en_preparacion { background: #ede4fb; color: #6b46c1; }
.etiqueta--listo { background: var(--rosa-100); color: var(--rosa-700); }
.etiqueta--entregado { background: var(--verde-claro); color: var(--verde); }
.etiqueta--cancelado { background: #eee; color: #666; }
.etiqueta--pagado { background: var(--verde-claro); color: var(--verde); }

/* ---- Avisos flotantes ------------------------------------------------------------ */

#toasts {
  position: fixed;
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 420px);
  pointer-events: none;
}

.toast {
  background: var(--cafe-900);
  color: #fff;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 700;
  box-shadow: var(--sombra);
  animation: entra 0.25s ease;
  transition: opacity 0.4s, transform 0.4s;
}

.toast--ok { background: var(--verde); }
.toast--error { background: #b42318; }
.toast--sale { opacity: 0; transform: translateY(-8px); }

@keyframes entra {
  from { opacity: 0; transform: translateY(-8px); }
}

/* ---- Pie --------------------------------------------------------------------- */

.pie {
  text-align: center;
  margin-top: 36px;
  color: var(--cafe-500);
  font-size: 0.9rem;
}

.pie__legal {
  margin: 16px 0 0;
  font-size: 0.82rem;
}

.pie__comerciante {
  margin-top: 4px;
  color: var(--cafe-500);
}

.pie__legal a {
  color: var(--cafe-500);
}

.pie__legal a:hover {
  color: var(--rosa-700);
}

/* ---- Conexión: "En línea 🟢" / "Modo Offline 🟠" ---- */

.estado-red {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 12px;
  border: 2px solid #bfe6cf;
  border-radius: 999px;
  background: var(--verde-claro);
  color: #1f7a50;
  font: 800 0.8rem var(--fuente);
  white-space: nowrap;
  cursor: pointer;
}

.estado-red i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--verde);
  box-shadow: 0 0 0 3px rgba(47, 158, 106, 0.2);
}

.estado-red small {
  font-weight: 700;
  opacity: 0.85;
}

.estado-red--off {
  border-color: #f6c58f;
  background: #fff3e3;
  color: #9a5a12;
}

.estado-red--off i {
  background: #f08c1a;
  box-shadow: 0 0 0 3px rgba(240, 140, 26, 0.25);
  animation: estado-red-late 1.4s ease-in-out infinite;
}

@keyframes estado-red-late {
  50% { box-shadow: 0 0 0 6px rgba(240, 140, 26, 0); }
}

.estado-red--mini {
  min-height: 28px;
  padding: 2px 10px;
  font-size: 0.72rem;
}

/* En la tienda solo aparece sin conexión, como aviso fijo arriba */
.estado-red--aviso {
  position: sticky;
  top: 8px;
  z-index: 30;
  display: flex;
  justify-content: center;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: 8px auto 0;
  white-space: normal;
  cursor: default;
}

.estado-red--aviso.oculto {
  display: none;
}

.pie__instalar {
  margin-top: 14px;
}

/* Cambios guardados sin conexión (panel) */
.pendientes {
  display: grid;
  gap: 8px;
  max-height: 50vh;
  overflow: auto;
  margin: 10px 0;
}

.pendiente {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--rosa-50);
  border: 2px solid var(--rosa-200);
  text-align: left;
}

.pendiente small {
  display: block;
  color: var(--cafe-500);
}

.pendiente--error {
  background: #fff3e3;
  border-color: #f6c58f;
}

.pendiente__acc {
  display: flex;
  gap: 6px;
}

/* Casilla de autorización de datos (Habeas Data) */
.autoriza {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--rosa-50);
  border: 2px solid var(--rosa-200);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.45;
  cursor: pointer;
}

.autoriza input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  accent-color: var(--rosa-600);
  cursor: pointer;
}

.autoriza a {
  font-weight: 800;
}

.pie__mano {
  font-family: var(--fuente-mano);
  font-size: 1.7rem;
  color: var(--rosa-600);
  margin: 0;
}

.aviso-demo {
  max-width: 1100px;
  margin: 12px auto 0;
  padding: 10px 16px;
  background: #fff;
  border: 2px dashed var(--rosa-400);
  border-radius: 14px;
  font-size: 0.9rem;
  text-align: center;
}

@media (max-width: 1132px) {
  .aviso-demo {
    margin: 12px 16px 0;
  }
}

.cargando {
  text-align: center;
  color: var(--cafe-500);
  padding: 30px 0;
  font-weight: 700;
}

.galleta-gira {
  width: 56px;
  margin: 0 auto 8px;
  animation: gira 1.6s linear infinite;
}

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

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

/* ---- Mascota (cargas, vacíos y agradecimiento) ---- */

.mascota {
  display: block;
  width: 110px;
  height: 110px;
  margin: 0 auto 8px;
  object-fit: contain;
}

/*
 * Cargador: la galleta tierna dentro de su anillo rosa. Son dos capas: el anillo
 * gira (acelera y frena suave) y la galleta "respira" y se balancea, así la
 * carita nunca queda de cabeza.
 */
.carga {
  position: relative;
  display: block;
  width: 84px;
  height: 84px;
  margin: 0 auto 12px;
  animation: carga-entra 0.35s ease-out both;
}

.carga img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  will-change: transform;
}

.carga__anillo {
  animation: carga-anillo 1.5s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

.carga__galleta {
  animation: carga-galleta 1.5s ease-in-out infinite;
  filter: drop-shadow(0 3px 4px rgba(122, 74, 52, 0.18));
}

.carga--mini {
  display: inline-block;
  width: 24px;
  height: 24px;
  margin: 0;
  vertical-align: -6px;
}

.carga--mini .carga__galleta {
  filter: none;
}

@keyframes carga-anillo {
  to { transform: rotate(360deg); }
}

@keyframes carga-galleta {
  0%, 100% { transform: scale(0.9) rotate(-8deg); }
  50% { transform: scale(1) rotate(8deg); }
}

@keyframes carga-entra {
  from { opacity: 0; transform: scale(0.8); }
}

/* Con "reducir movimiento" el anillo gira muy lento en vez de quedarse quieto */
@media (prefers-reduced-motion: reduce) {
  .carga__anillo {
    animation: carga-anillo 6s linear infinite !important;
  }
}

.mascota--salta {
  animation: mascota-salta 0.9s ease-in-out infinite alternate;
}

@keyframes mascota-salta {
  from { transform: translateY(0) rotate(-4deg); }
  to { transform: translateY(-10px) rotate(4deg); }
}

/* ---- Pie con redes ---- */

.pie__mascota {
  width: 84px;
  height: 84px;
  margin-bottom: 0;
}

.pie__sigue {
  margin: 2px 0 10px;
  font-weight: 700;
  color: var(--cafe-700);
}

.redes {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.red {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  color: #fff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
}

.red small {
  font-weight: 600;
  opacity: 0.85;
}

.red--tiktok {
  background: #1f1f1f;
}

.red--instagram {
  background: linear-gradient(45deg, #f9a03f, #e1306c 55%, #833ab4);
}

.red:hover {
  filter: brightness(1.08);
}
