/* ============================================================================
 * SeptiGenesis — Marketplace (standalone).
 * Paleta sobria SeptiGenesis: teal #00a99d/#008077 + navy #143e6b/#0d2847
 * sobre fondos claros. Contraste AA (texto blanco sobre teal oscuro). Poppins.
 * Responsive 390 (mobile) → 1440 (desktop), sin overflow horizontal.
 * ==========================================================================*/

:root {
  --mk-teal: #00a99d;
  --mk-teal-dark: #008077;
  --mk-teal-onsoft: #006b63; /* teal text on light teal-soft bg — AA (>=4.5) */
  --mk-teal-soft: #e6f7f5;
  --mk-teal-border: #9fded7;
  --mk-navy: #143e6b;
  --mk-navy-deep: #0d2847;
  --mk-bg: #f6faf9;
  --mk-surface: #ffffff;
  --mk-text: #12252e;
  --mk-text-soft: #4a5c63;
  --mk-border: #dfe8e6;
  --mk-danger: #b00020;
  --mk-radius: 14px;
  --mk-radius-sm: 10px;
  --mk-shadow: 0 6px 24px rgba(13, 40, 71, 0.08);
  --mk-shadow-sm: 0 2px 8px rgba(13, 40, 71, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--mk-text);
  background: var(--mk-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.mk-skip {
  position: absolute;
  left: -999px;
}
.mk-skip:focus {
  left: 12px; top: 12px;
  z-index: 1000;
  background: var(--mk-navy-deep);
  color: #fff;
  padding: 8px 14px;
  border-radius: var(--mk-radius-sm);
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.mk-header {
  background: var(--mk-surface);
  border-bottom: 1px solid var(--mk-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.mk-header-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.mk-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--mk-navy-deep);
}
.mk-brand-logo { display: block; }
.mk-brand-name {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}
.mk-header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.mk-back {
  color: var(--mk-teal-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}
.mk-back:hover { text-decoration: underline; }
.mk-lang-wrap { display: inline-flex; }
.mk-lang {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 6px 10px;
  border-radius: var(--mk-radius-sm);
  border: 1px solid var(--mk-teal-border);
  background: var(--mk-teal-soft);
  color: var(--mk-navy-deep);
  cursor: pointer;
}

/* ── Main / Hero ──────────────────────────────────────────────────────────── */
.mk-main {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 20px 64px;
}
.mk-hero {
  padding: 48px 0 28px;
  text-align: center;
}
.mk-eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--mk-teal-onsoft);
  background: var(--mk-teal-soft);
  border: 1px solid var(--mk-teal-border);
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.mk-title {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--mk-navy-deep);
  letter-spacing: -0.02em;
}
.mk-subtitle {
  margin: 0 auto;
  max-width: 620px;
  color: var(--mk-text-soft);
  font-size: 1.02rem;
}

/* ── Filtros ──────────────────────────────────────────────────────────────── */
.mk-filters {
  margin-top: 8px;
}
.mk-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.mk-chip {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--mk-teal-border);
  background: var(--mk-surface);
  color: var(--mk-navy);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.mk-chip:hover {
  border-color: var(--mk-teal-dark);
}
.mk-chip.is-active {
  background: var(--mk-teal-dark);
  border-color: var(--mk-teal-dark);
  color: #ffffff;
}
.mk-chip:focus-visible {
  outline: 2px solid var(--mk-navy);
  outline-offset: 2px;
}
.mk-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}
.mk-input {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 10px 14px;
  border-radius: var(--mk-radius-sm);
  border: 1px solid var(--mk-border);
  background: var(--mk-surface);
  color: var(--mk-text);
  min-width: 0;
}
.mk-filter-row .mk-input { flex: 1 1 180px; }
.mk-input:focus-visible {
  outline: 2px solid var(--mk-teal);
  outline-offset: 1px;
  border-color: var(--mk-teal);
}
.mk-textarea { resize: vertical; width: 100%; }

/* ── Botones ──────────────────────────────────────────────────────────────── */
.mk-btn {
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--mk-radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
.mk-btn-primary {
  background: var(--mk-teal-dark);
  color: #ffffff;
}
.mk-btn-primary:hover { background: #006b63; }
.mk-btn-primary:focus-visible {
  outline: 2px solid var(--mk-navy);
  outline-offset: 2px;
}
.mk-btn-block { width: 100%; }

/* ── CTA "Hazte aliado" (hero) ───────────────────────────────────────────── */
.mk-hero-cta { margin-top: 20px; display: flex; justify-content: center; }
.mk-btn-ally {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  font-size: 1rem;
  padding: 13px 26px;
  border-radius: 999px;
  text-align: left;
  line-height: 1.3;
  box-shadow: var(--mk-shadow-sm);
}
.mk-btn-ally:hover { box-shadow: var(--mk-shadow); }
/* Fila de dos campos en el formulario de aliado (colapsa a 1 en móvil) */
.mk-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 520px) {
  .mk-field-row { grid-template-columns: 1fr; }
  .mk-btn-ally { font-size: 0.92rem; padding: 12px 18px; }
}

/* ── Feed / tarjetas ──────────────────────────────────────────────────────── */
.mk-feed-wrap { margin-top: 28px; }
.mk-status {
  color: var(--mk-text-soft);
  font-size: 0.95rem;
  min-height: 24px;
  margin-bottom: 12px;
}
.mk-feed {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.mk-card {
  background: var(--mk-surface);
  border: 1px solid var(--mk-border);
  border-radius: var(--mk-radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--mk-shadow-sm);
  transition: box-shadow 0.18s, transform 0.18s;
}
.mk-card:hover {
  box-shadow: var(--mk-shadow);
  transform: translateY(-2px);
}
.mk-card.is-featured {
  border-color: var(--mk-teal);
  box-shadow: 0 0 0 1px var(--mk-teal-border), var(--mk-shadow);
}
.mk-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.mk-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--mk-teal-soft);
  color: var(--mk-teal-onsoft);
  border: 1px solid var(--mk-teal-border);
}
.mk-featured-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #8a5209;
  background: #fdf1dc;
  border: 1px solid #f0d8a8;
  padding: 3px 10px;
  border-radius: 999px;
}

/* Sello Verificado: verde AA (#0b6b3f sobre #dff3e6 ≈ 5.3:1). */
.mk-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #0b6b3f;
  background: #dff3e6;
  border: 1px solid #a9dcc0;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: help;
}
/* Sin verificar: gris sutil (#5b6a70 sobre #eef2f1 ≈ 5.6:1). */
.mk-unverified {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 600;
  color: #5b6a70;
  background: #eef2f1;
  border: 1px solid var(--mk-border);
  padding: 3px 10px;
  border-radius: 999px;
}
.mk-card-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--mk-navy-deep);
  overflow-wrap: anywhere;
}
.mk-card-desc {
  margin: 0;
  color: var(--mk-text-soft);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}
.mk-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.82rem;
  color: var(--mk-text-soft);
}
.mk-card-meta span { display: inline-flex; align-items: center; gap: 4px; }
.mk-card-sectors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mk-sector-tag {
  font-size: 0.72rem;
  background: #eef4f3;
  border: 1px solid var(--mk-border);
  color: var(--mk-text-soft);
  padding: 2px 10px;
  border-radius: 999px;
}
.mk-card-cta {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.mk-card-cta .mk-btn-primary { flex: 1 1 auto; }
/* Botón "Reportar": discreto, sin borde, teal-dark AA sobre superficie blanca. */
.mk-btn-report {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mk-text-soft);
  background: transparent;
  border: none;
  padding: 8px 6px;
  cursor: pointer;
  text-decoration: underline;
  flex: 0 0 auto;
}
.mk-btn-report:hover { color: var(--mk-danger); }
.mk-btn-report:focus-visible {
  outline: 2px solid var(--mk-navy);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── Aviso de seguridad + CTA aliado ──────────────────────────────────────── */
.mk-safety {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #fdf6e6;
  border: 1px solid #f0d8a8;
  border-radius: var(--mk-radius);
  padding: 12px 16px;
}
.mk-safety-icon { font-size: 1.1rem; line-height: 1; }
.mk-safety-text {
  margin: 0;
  flex: 1 1 220px;
  min-width: 0;
  font-size: 0.88rem;
  color: #7a4e05; /* sobre #fdf6e6 ≈ AA */
  font-weight: 500;
}
.mk-become {
  flex: 0 0 auto;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mk-teal-onsoft);
  text-decoration: none;
  white-space: nowrap;
}
.mk-become:hover { text-decoration: underline; }
.mk-become:focus-visible {
  outline: 2px solid var(--mk-navy);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ── Toast ────────────────────────────────────────────────────────────────── */
.mk-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  z-index: 1100;
  max-width: min(92vw, 420px);
  background: var(--mk-navy-deep);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--mk-radius-sm);
  box-shadow: 0 8px 28px rgba(13, 40, 71, 0.4);
  font-size: 0.9rem;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.mk-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Estados vacíos / error ───────────────────────────────────────────────── */
.mk-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--mk-text-soft);
}

/* ── Modal ────────────────────────────────────────────────────────────────── */
.mk-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.mk-modal[hidden] { display: none; }
.mk-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 40, 71, 0.55);
}
.mk-modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--mk-surface);
  border-radius: var(--mk-radius);
  padding: 26px 24px;
  box-shadow: 0 20px 60px rgba(13, 40, 71, 0.35);
}
.mk-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px; height: 34px;
  border: none;
  border-radius: 8px;
  background: #eef4f3;
  color: var(--mk-navy-deep);
  font-size: 1rem;
  cursor: pointer;
}
.mk-modal-close:hover { background: #e0eae8; }
.mk-modal-title {
  margin: 0 0 4px;
  font-size: 1.35rem;
  color: var(--mk-navy-deep);
}
.mk-modal-sub {
  margin: 0 0 18px;
  color: var(--mk-teal-dark);
  font-weight: 600;
  font-size: 0.95rem;
}
.mk-form { display: flex; flex-direction: column; gap: 14px; }
.mk-field { display: flex; flex-direction: column; gap: 5px; }
.mk-field > span { font-size: 0.85rem; font-weight: 600; color: var(--mk-text); }
.mk-form-hint { margin: 0; font-size: 0.8rem; color: var(--mk-text-soft); }
.mk-form-error {
  color: var(--mk-danger);
  font-size: 0.85rem;
  background: #fdeaec;
  border: 1px solid #f3c2c8;
  border-radius: var(--mk-radius-sm);
  padding: 8px 12px;
}

/* ── Éxito de contacto ────────────────────────────────────────────────────── */
.mk-success { text-align: center; }
.mk-success-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--mk-teal-dark);
  margin: 4px 0 8px;
}
.mk-success-text { color: var(--mk-text-soft); font-size: 0.92rem; margin: 0 0 14px; }
.mk-success-contact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}
.mk-success-contact a,
.mk-success-contact span {
  display: block;
  background: var(--mk-teal-soft);
  border: 1px solid var(--mk-teal-border);
  border-radius: var(--mk-radius-sm);
  padding: 10px 14px;
  color: var(--mk-navy-deep);
  text-decoration: none;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.mk-success-contact a:hover { background: #d5f0ec; }

/* ── Botón geolocalización ────────────────────────────────────────────────── */
.mk-btn-geo {
  background: var(--mk-surface);
  color: var(--mk-teal-onsoft); /* teal AA sobre blanco */
  border: 1px solid var(--mk-teal-border);
  white-space: nowrap;
}
.mk-btn-geo:hover { background: var(--mk-teal-soft); }
.mk-btn-geo.is-on {
  background: var(--mk-teal-soft);
  border-color: var(--mk-teal-dark);
}
.mk-btn-geo:focus-visible {
  outline: 2px solid var(--mk-navy);
  outline-offset: 2px;
}

/* Empresa (subtítulo bajo el nombre) + distancia geo en la tarjeta */
.mk-card-company {
  margin: -4px 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mk-teal-onsoft);
  overflow-wrap: anywhere;
}
.mk-distance { font-weight: 600; color: var(--mk-teal-onsoft); }

/* Intro del modal de negocio (comisión + contacto oculto) */
.mk-deal-intro {
  margin: 0 0 16px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #7a4e05; /* AA sobre fondo claro */
  background: #fdf6e6;
  border: 1px solid #f0d8a8;
  border-radius: var(--mk-radius-sm);
  padding: 10px 14px;
}
.mk-deal-actions { display: flex; flex-direction: column; gap: 8px; text-align: center; }
.mk-deal-pay { text-align: center; }
.mk-deal-mydeals {
  display: block;
  width: 100%;
  text-align: center;
}

/* ── Mis negocios ─────────────────────────────────────────────────────────── */
.mk-mydeals { margin-top: 40px; }
.mk-mydeals[hidden] { display: none; }
.mk-mydeals-title {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--mk-navy-deep);
}
.mk-mydeals-sub {
  margin: 0 0 16px;
  color: var(--mk-text-soft);
  font-size: 0.9rem;
  max-width: 640px;
}
.mk-mydeals-list { display: flex; flex-direction: column; gap: 14px; }
.mk-deal-row {
  background: var(--mk-surface);
  border: 1px solid var(--mk-border);
  border-radius: var(--mk-radius);
  padding: 16px 18px;
  box-shadow: var(--mk-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mk-deal-row-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
}
.mk-deal-row-name { font-weight: 700; color: var(--mk-navy-deep); }
.mk-deal-row-service { color: var(--mk-text-soft); font-size: 0.9rem; overflow-wrap: anywhere; }
.mk-deal-view { align-self: flex-start; }
.mk-deal-row-status { display: flex; flex-direction: column; gap: 8px; }
.mk-deal-status-title {
  margin: 0;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--mk-navy-deep);
}
.mk-deal-status-line { margin: 0; font-size: 0.9rem; color: var(--mk-text-soft); }
.mk-deal-status-line.mk-paid { color: #0b6b3f; font-weight: 600; } /* verde AA */
.mk-deal-email-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-deal-email-row .mk-input { flex: 1 1 200px; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.mk-footer {
  border-top: 1px solid var(--mk-border);
  background: var(--mk-surface);
  text-align: center;
  padding: 22px 20px;
  color: var(--mk-text-soft);
  font-size: 0.85rem;
}
.mk-footer p { margin: 0; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .mk-header-right { gap: 8px; }
  .mk-back { font-size: 0.82rem; }
  .mk-hero { padding: 32px 0 22px; }
  .mk-filter-row .mk-input { flex: 1 1 100%; }
  .mk-filter-row .mk-btn { flex: 1 1 100%; }
  .mk-feed { grid-template-columns: 1fr; }
}
