/* ============================================================
   Macro Market — support tickets (account thread + admin triage)
   ============================================================ */
:root {
  --mm-deep-navy: #1E2A3A;
  --mm-midnight:  #2F588C;
  --mm-teal:      #2E7C89;
  --mm-sand:      #E7D8C4;
  --mm-gold:      #C9A565;
  --mm-line:      rgba(30,42,58,0.12);
  --mm-line-strong: rgba(30,42,58,0.22);
}

/* Status pills (shared front + admin) */
.mm-tk-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.mm-tk-pill--wait { background: #FBF3DF; color: #8a6d1f; }
.mm-tk-pill--ok   { background: #E1F0EE; color: #1f5a63; }
.mm-tk-pill--bad  { background: #FBE7E5; color: #9b2c22; }

/* ---------- Account (My Account → Mis tickets) ---------- */
.mm-tk { font-family: 'Inter', system-ui, sans-serif; color: var(--mm-deep-navy); }

.mm-tk-new {
  border: 1px solid var(--mm-line);
  border-radius: 12px;
  background: #fff;
  margin-bottom: 8px;
}
.mm-tk-new__toggle {
  cursor: pointer;
  list-style: none;
  padding: 16px 20px;
  font-family: 'Unbounded', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--mm-deep-navy);
}
.mm-tk-new__toggle::-webkit-details-marker { display: none; }
.mm-tk-new__toggle::before { content: "+ "; color: var(--mm-teal); }
.mm-tk-new[open] .mm-tk-new__toggle::before { content: "– "; }
.mm-tk-new[open] .mm-tk-new__toggle { border-bottom: 1px solid var(--mm-line); }

.mm-tk-form { padding: 20px; }
.mm-tk-field { margin: 0 0 16px; }
.mm-tk-field label {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(30,42,58,0.7);
  margin-bottom: 8px;
}
.mm-tk-form input[type="text"],
.mm-tk-form select,
.mm-tk-form textarea {
  width: 100%;
  border: 1px solid var(--mm-line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--mm-deep-navy);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  padding: 12px 14px;
}
.mm-tk-form textarea { resize: vertical; }
.mm-tk-form input:focus,
.mm-tk-form select:focus,
.mm-tk-form textarea:focus {
  outline: none;
  border-color: var(--mm-midnight);
  box-shadow: 0 0 0 3px rgba(47,88,140,0.18);
}
.mm-tk-btn {
  display: inline-block;
  background: var(--mm-deep-navy);
  color: #fff;
  border: 1px solid var(--mm-deep-navy);
  border-radius: 10px;
  font-family: 'Unbounded', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 13px 24px;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.mm-tk-btn:hover { background: var(--mm-midnight); border-color: var(--mm-midnight); transform: translateY(-1px); }
.mm-tk-btn--ghost { background: transparent; color: rgba(30,42,58,0.7); border-color: var(--mm-line-strong); }
.mm-tk-btn--ghost:hover { background: #FBE7E5; color: #9b2c22; border-color: #e3b4ae; transform: none; }

.mm-tk-subhead {
  margin: 28px 0 12px;
  font-family: 'Unbounded', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--mm-deep-navy);
}
.mm-tk-table a { color: var(--mm-midnight); text-decoration: none; font-weight: 600; }
.mm-tk-table a:hover { text-decoration: underline; }
.mm-tk-view { white-space: nowrap; }

/* Thread (customer) */
.mm-tk-back {
  display: inline-block;
  margin-bottom: 18px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: var(--mm-midnight);
  text-decoration: none;
}
.mm-tk-thead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mm-tk-thead__subject {
  margin: 0;
  font-family: 'Unbounded', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(20px, 3vw, 28px);
  color: var(--mm-deep-navy);
}
.mm-tk-meta { margin: 6px 0 22px; font-size: 13px; color: rgba(30,42,58,0.6); }
.mm-tk-meta a { color: var(--mm-midnight); }

.mm-tk-messages { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.mm-tk-msg {
  border: 1px solid var(--mm-line);
  border-radius: 12px;
  padding: 14px 18px;
  max-width: 88%;
}
.mm-tk-msg--me { align-self: flex-end; background: #F1F4FA; border-color: rgba(47,88,140,0.18); }
.mm-tk-msg--staff { align-self: flex-start; background: #fff; }
.mm-tk-msg__head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.mm-tk-msg__who {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mm-teal);
  font-weight: 600;
}
.mm-tk-msg--me .mm-tk-msg__who { color: var(--mm-midnight); }
.mm-tk-msg__time { font-size: 11px; color: rgba(30,42,58,0.5); }
.mm-tk-msg__body { font-size: 15px; line-height: 1.55; }
.mm-tk-msg__body p { margin: 0 0 8px; }
.mm-tk-msg__body p:last-child { margin-bottom: 0; }

.mm-tk-closed {
  background: #FBE7E5; color: #9b2c22; border-radius: 8px; padding: 10px 14px;
  font-size: 14px; margin-bottom: 16px;
}
.mm-tk-reply { padding: 0; border: 0; background: transparent; }
.mm-tk-reply__actions { display: flex; gap: 12px; flex-wrap: wrap; }

@media (max-width: 600px) {
  .mm-tk-msg { max-width: 100%; }
  .mm-tk-reply__actions .mm-tk-btn { flex: 1 1 auto; text-align: center; }
}

/* Inside the My Account content card the "Abrir un ticket" panel would be a
   box-in-box — strip its own frame so it reads as a section of the card. */
.woocommerce-MyAccount-content .mm-tk-new {
  border: 0;
  background: transparent;
  box-shadow: none;
  margin-bottom: 4px;
}
.woocommerce-MyAccount-content .mm-tk-new__toggle { padding: 0 0 14px; }
.woocommerce-MyAccount-content .mm-tk-new[open] .mm-tk-new__toggle {
  border-bottom: 1px solid var(--mm-line);
  margin-bottom: 18px;
}
.woocommerce-MyAccount-content .mm-tk-form { padding: 0; }
.woocommerce-MyAccount-content .mm-tk-table { margin-top: 6px; }

/* ---------- Public contact form (Contacto / Soporte page) ---------- */
.mm-tk-public { padding: 0; border: 0; background: transparent; }
.mm-tk-loggedin {
  margin: 0 0 18px;
  padding: 12px 16px;
  background: #F1F4FA;
  border: 1px solid rgba(47,88,140,0.18);
  border-radius: 10px;
  font-size: 14px;
  color: var(--mm-deep-navy);
}
.mm-tk-loggedin a { color: var(--mm-midnight); font-weight: 600; }
.mm-tk-error {
  margin: 0 0 18px;
  padding: 12px 16px;
  background: #FBE7E5;
  color: #9b2c22;
  border-radius: 10px;
  font-size: 14px;
}
.mm-tk-sent {
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--mm-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(30,42,58,0.04), 0 18px 40px -28px rgba(30,42,58,0.28);
}
.mm-tk-sent__head {
  margin: 0 0 10px;
  font-family: 'Unbounded', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  font-size: 20px;
  color: var(--mm-deep-navy);
}
.mm-tk-sent p { margin: 0 0 18px; color: rgba(30,42,58,0.7); }

/* ---------- Admin ---------- */
.mm-tk-admin-meta { font-size: 13px; color: #50575e; margin: 8px 0 18px; }
.mm-tk-admin-thread { max-width: 820px; display: flex; flex-direction: column; gap: 14px; margin: 0 0 24px; }
.mm-tk-admin .mm-tk-msg { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.mm-tk-admin .mm-tk-msg--staff { background: #f0f6fc; border-color: #c5d9ed; align-self: flex-start; }
.mm-tk-admin .mm-tk-msg--me { background: #fff; align-self: flex-start; }
.mm-tk-admin-reply { max-width: 820px; background: #fff; border: 1px solid #dcdcde; border-radius: 8px; padding: 16px; margin: 0 0 16px; }
.mm-tk-admin-controls { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.mm-tk-admin-statusonly { max-width: 820px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mm-tk-admin-table .mm-tk-pill { font-family: ui-monospace, monospace; }
