/* Estilos compartidos por la tienda y el panel */
:root {
  /* Colores de la marca Emonza: verde del logo + gris carbón */
  --brand: #33cc33;
  --charcoal: #323232;
  --bg: #f7f8f4;
  --surface: #ffffff;
  --surface-2: #eef1ea;
  --ink: #232623;
  --muted: #5c645c;
  --line: #dfe4da;
  --green: #1a7f27;
  --green-d: #323232;
  --green-soft: #e3f5e0;
  --honey: #e3a03a;
  --honey-soft: #fbefd6;
  --rose-soft: #f8e3e6;
  --danger: #b4371f;
  --danger-soft: #fbe7e2;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(29, 42, 33, 0.06), 0 8px 24px rgba(29, 42, 33, 0.08);
  --shadow-lg: 0 20px 60px rgba(29, 42, 33, 0.18);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

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

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--green);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p {
  margin: 0;
}

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

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--honey) 70%, transparent);
  outline-offset: 2px;
}

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

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--green);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:hover {
  background: #146a1f;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover {
  background: var(--surface-2);
}
.btn-light {
  background: var(--surface);
  color: var(--green-d);
}
.btn-light:hover {
  background: var(--green-soft);
}
.btn-wa {
  background: #1fa855;
}
.btn-wa:hover {
  background: #178a45;
}
.btn-danger {
  background: var(--danger);
}
.btn-danger:hover {
  background: #8f2b17;
}
.btn-sm {
  min-height: 36px;
  padding: 0 14px;
  font-size: 14px;
}
.btn-block {
  width: 100%;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  color: var(--ink);
}
.icon-btn:hover {
  background: var(--surface-2);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* Formularios */
.field {
  display: grid;
  gap: 6px;
}
.field > span {
  font-size: 14px;
  font-weight: 600;
}
.field small {
  color: var(--muted);
  font-size: 13px;
}
.input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea.input {
  min-height: 90px;
  resize: vertical;
}
.input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}
.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.choice {
  position: relative;
}
.choice input {
  position: absolute;
  opacity: 0;
}
.choice span {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 500;
  font-size: 15px;
}
.choice input:checked + span {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green-d);
  font-weight: 600;
}
.choice input:focus-visible + span {
  outline: 3px solid color-mix(in srgb, var(--honey) 70%, transparent);
}
.form-error {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
  font-weight: 500;
}

/* Etiquetas */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-d);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tag-honey {
  background: var(--honey-soft);
  color: #8a5a10;
}
.tag-muted {
  background: var(--surface-2);
  color: var(--muted);
}

/* Estados de pedido */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-transform: capitalize;
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.status-nuevo { background: #fdeccc; color: #8a5300; }
.status-confirmado { background: #e1ecfb; color: #1f4f8f; }
.status-preparando { background: #efe5fa; color: #61318f; }
.status-enviado { background: #dff1f1; color: #1d6464; }
.status-entregado { background: var(--green-soft); color: var(--green-d); }
.status-cancelado { background: #ece9e4; color: #6b665e; }
.status-fantasma { background: #e9e6f0; color: #4d4566; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(20, 28, 22, 0.5);
  backdrop-filter: blur(3px);
  animation: fade 0.18s ease;
}
.modal[hidden] {
  display: none;
}
.modal-card {
  position: relative;
  width: min(100%, 900px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  animation: pop 0.2s ease;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
}

/* Aviso flotante */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 80;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: pop 0.2s ease;
}

.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}

@keyframes fade {
  from { opacity: 0; }
}
@keyframes pop {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
}
.toast {
  animation-name: toast-in;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
}

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