/* ==========================================================
   MAU STORE — Base compartida (tienda + admin)
   ========================================================== */
:root {
  --mau-fucsia: #D44274;
  --mau-fucsia-osc: #B8335F;
  --mau-dorado: #D4AF37;
  --mau-rosa: #FCE7F0;
  --mau-blanco: #FFFFFF;
  --mau-humo: #F8F9FA;
  --mau-texto: #1F2937;
  --mau-gris: #6B7280;
  --mau-borde: #E5E7EB;
  --mau-error: #DC2626;
  --mau-ok: #16A34A;
  --mau-aviso: #F59E0B;
  --radio: 12px;
  --radio-sm: 8px;
  --sombra: 0 2px 8px rgba(0, 0, 0, .08);
  --sombra-lg: 0 10px 30px rgba(0, 0, 0, .18);
  --fuente: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

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

body {
  margin: 0;
  font-family: var(--fuente);
  font-size: 15px;
  line-height: 1.45;
  color: var(--mau-texto);
  background: var(--mau-humo);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--mau-fucsia); }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; }

.hidden { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--mau-fucsia); outline-offset: 2px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 44px; padding: 0 1.1rem;
  border: 1px solid transparent; border-radius: 999px;
  font: 600 15px/1 var(--fuente);
  cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primario { background: var(--mau-fucsia); color: #fff; }
.btn-primario:not(:disabled):hover { background: var(--mau-fucsia-osc); }
.btn-dorado { background: var(--mau-dorado); color: #fff; }
.btn-borde { background: #fff; color: var(--mau-texto); border-color: var(--mau-borde); }
.btn-borde:not(:disabled):hover { border-color: var(--mau-fucsia); color: var(--mau-fucsia); }
.btn-fantasma { background: transparent; color: var(--mau-texto); }
.btn-peligro { background: #fff; color: var(--mau-error); border-color: #FCA5A5; }
.btn-whatsapp { background: #25D366; color: #fff; }
.btn-bloque { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 .8rem; font-size: 14px; }
.btn-icono {
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  background: transparent; border: none; color: inherit;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.btn-icono svg, .btn svg { width: 20px; height: 20px; flex: none; }

/* ---------- Formularios ---------- */
label { font-weight: 600; font-size: 14px; display: block; margin-bottom: .3rem; }
.campo { margin-bottom: 1rem; }
.campo small { color: var(--mau-gris); font-size: 13px; display: block; margin-top: .25rem; }
.campo .error-campo { color: var(--mau-error); font-size: 13px; margin-top: .25rem; display: block; }

input[type="text"], input[type="search"], input[type="tel"], input[type="password"],
input[type="number"], input[type="date"], select, textarea {
  width: 100%; min-height: 44px; padding: .6rem .8rem;
  border: 1px solid var(--mau-borde); border-radius: var(--radio-sm);
  font: 16px var(--fuente); /* 16px evita zoom en iOS */
  color: var(--mau-texto); background: #fff;
  -webkit-appearance: none; appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8rem center; padding-right: 2.2rem;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--mau-fucsia); box-shadow: 0 0 0 3px var(--mau-rosa); }
input.invalido, select.invalido, textarea.invalido { border-color: var(--mau-error); }

.check { display: flex; gap: .6rem; align-items: flex-start; font-weight: 400; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--mau-fucsia); flex: none; }

/* Interruptor */
.switch { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .pista { width: 44px; height: 26px; border-radius: 999px; background: #D1D5DB; position: relative; transition: background .2s; flex: none; }
.switch .pista::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--sombra); transition: transform .2s; }
.switch input:checked + .pista { background: var(--mau-fucsia); }
.switch input:checked + .pista::after { transform: translateX(18px); }
.switch input:focus-visible + .pista { outline: 2px solid var(--mau-fucsia); outline-offset: 2px; }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  min-height: 36px; padding: 0 .9rem; border-radius: 999px;
  border: 1px solid var(--mau-borde); background: #fff; color: var(--mau-texto);
  font: 500 14px var(--fuente); white-space: nowrap; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.chip.activo { background: var(--mau-fucsia); border-color: var(--mau-fucsia); color: #fff; }
.chip:disabled, .chip.deshabilitado { opacity: .4; text-decoration: line-through; cursor: not-allowed; }
.chip .contador { background: rgba(0,0,0,.08); border-radius: 999px; padding: 0 .45rem; font-size: 12px; }
.chip.activo .contador { background: rgba(255,255,255,.25); }

/* ---------- Insignias ---------- */
.insignia {
  display: inline-block; padding: .15rem .55rem; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
}
.insignia-dorado { background: var(--mau-dorado); color: #fff; }
.insignia-gris { background: #E5E7EB; color: #374151; }
.insignia-ok { background: #DCFCE7; color: #166534; }
.insignia-rosa { background: var(--mau-rosa); color: var(--mau-fucsia-osc); }

/* ---------- Toast ---------- */
#toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(84px + var(--safe-bottom)); z-index: 1000;
  display: flex; flex-direction: column; gap: .5rem; align-items: center;
  width: calc(100% - 2rem); max-width: 420px; pointer-events: none;
}
.toast {
  background: var(--mau-texto); color: #fff; padding: .75rem 1rem; border-radius: var(--radio);
  box-shadow: var(--sombra-lg); font-size: 14px; pointer-events: auto;
  animation: toastIn .2s ease-out;
}
.toast.error { background: var(--mau-error); }
.toast.ok { background: var(--mau-ok); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Diálogo de confirmación ---------- */
dialog.dlg {
  border: none; border-radius: var(--radio); padding: 1.25rem; width: min(92vw, 380px);
  box-shadow: var(--sombra-lg); color: var(--mau-texto);
}
dialog.dlg::backdrop { background: rgba(17, 24, 39, .45); }
dialog.dlg p { margin: 0 0 1.1rem; }
dialog.dlg .acciones { display: flex; gap: .5rem; justify-content: flex-end; }

/* ---------- Skeleton ---------- */
.skeleton {
  background: linear-gradient(90deg, #EEE 25%, #F5F5F5 37%, #EEE 63%);
  background-size: 400% 100%; animation: shimmer 1.2s ease infinite; border-radius: var(--radio-sm);
}
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Varios ---------- */
.muted { color: var(--mau-gris); }
.text-center { text-align: center; }
.precio { font-weight: 700; color: var(--mau-fucsia); }
.estado-vacio { text-align: center; color: var(--mau-gris); padding: 3rem 1rem; }
.estado-vacio svg { width: 48px; height: 48px; margin: 0 auto .75rem; color: #D1D5DB; }
.banda-demo {
  background: var(--mau-dorado); color: #fff; text-align: center; font-size: 12px; font-weight: 600;
  padding: .25rem .5rem;
}
