/* nexsell-marketplaces.css — tarjetas de Ripley / París / Walmart / Falabella /
   Shopify en Configuración → Canales de venta. Reutiliza .chan-card/.chan-logo
   (logos con object-fit:contain y fondo de marca, definidos en index.html). */
#mktConnectMount { display: contents; }
.mkt-card { min-width: 0; }
.mkt-card.is-open { grid-column: 1 / -1; }
.mkt-card.is-connected { border-color: var(--border-color); }
.mkt-card .chan-head { align-items: flex-start; }
.mkt-head-txt { min-width: 0; flex: 1 1 auto; padding-top: 3px; }
.mkt-head-txt .chan-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mkt-status {
  flex: none; display: inline-flex; align-items: center; gap: 6px; margin-top: 4px;
  font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--border-soft); background: var(--bg-tertiary); color: var(--text-muted);
}
.mkt-status svg { width: 12px; height: 12px; }
.mkt-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .9; }
.mkt-status.is-on { color: var(--accent-primary); background: var(--accent-soft); border-color: var(--accent-border); }
.mkt-status.is-err { color: var(--accent-danger); background: var(--danger-soft); border-color: var(--danger-border); }
.mkt-status.is-paused, .mkt-status.is-lock { color: var(--accent-warning); background: var(--warning-soft); border-color: var(--warning-border); }

.mkt-note { margin: 0; font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }
.mkt-fine { margin: 0; font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.mkt-skel { height: 34px; border-radius: 10px; background: linear-gradient(90deg, var(--bg-tertiary), var(--bg-elevated), var(--bg-tertiary)); background-size: 200% 100%; animation: mktSkel 1.2s linear infinite; }
@keyframes mktSkel { to { background-position: -200% 0; } }

.mkt-meta { display: flex; flex-direction: column; gap: 7px; }
.mkt-row { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--text-secondary); line-height: 1.4; }
.mkt-row svg { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--text-muted); }
.mkt-row b { color: var(--text-primary); }
.mkt-row code { font-size: 11.5px; padding: 1px 5px; border-radius: 5px; background: var(--bg-tertiary); color: var(--text-primary); }
.mkt-row.is-err, .mkt-row.is-err svg { color: var(--accent-danger); }
.mkt-row.is-warn svg { color: var(--accent-warning); }

.mkt-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid var(--border-soft); }

/* Interruptor (sin checkbox visible) */
.mkt-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-primary); user-select: none; }
.mkt-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.mkt-switch-ui { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--bg-hover); border: 1px solid var(--border-strong); transition: background var(--transition-fast), border-color var(--transition-fast); flex: none; }
.mkt-switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform var(--transition-fast); }
.mkt-switch input:checked + .mkt-switch-ui { background: var(--accent-primary); border-color: var(--accent-primary); }
.mkt-switch input:checked + .mkt-switch-ui::after { transform: translateX(16px); }
.mkt-switch input:focus-visible + .mkt-switch-ui { box-shadow: var(--focus-ring); }
.mkt-switch input:disabled + .mkt-switch-ui { opacity: .5; }

.mkt-pct { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-secondary); }
.mkt-pct .form-control { width: 64px; min-height: 32px; height: 32px; padding: 4px 8px; text-align: right; font-size: 13px; }
.mkt-pct em { font-style: normal; color: var(--text-muted); }

.mkt-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.mkt-actions .btn { min-height: 36px; padding: 7px 14px; font-size: 13px; }
.mkt-ghost { background: transparent !important; }
.mkt-danger { color: var(--accent-danger) !important; border-color: var(--danger-border) !important; }
.chan-foot .btn svg, .mkt-actions .btn svg { width: 15px; height: 15px; }

.mkt-msg { font-size: 12.5px; padding: 8px 11px; border-radius: 10px; border: 1px solid; line-height: 1.4; }
.mkt-msg.is-ok { color: var(--accent-primary); background: var(--accent-soft); border-color: var(--accent-border); }
.mkt-msg.is-err { color: var(--accent-danger); background: var(--danger-soft); border-color: var(--danger-border); }

/* Formulario de llaves */
.mkt-form { display: flex; flex-direction: column; gap: 14px; }
.mkt-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.mkt-field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); min-width: 0; }
.mkt-field em { font-style: normal; font-weight: 500; color: var(--text-muted); }
.mkt-field .form-control { width: 100%; box-sizing: border-box; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.mkt-help { display: flex; gap: 8px; margin: 0; font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; padding: 10px 12px; border-radius: 10px; background: var(--bg-tertiary); }
.mkt-help svg { width: 15px; height: 15px; flex: none; margin-top: 1px; color: var(--accent-primary); }
.mkt-help a { color: var(--accent-primary); font-weight: 600; }

/* Selector segmentado (Shopify: cómo conectar) */
.mkt-seg { display: inline-flex; align-self: flex-start; max-width: 100%; padding: 3px; gap: 3px; border-radius: 999px; background: var(--bg-tertiary); border: 1px solid var(--border-soft); }
.mkt-seg-btn { appearance: none; border: 0; background: transparent; color: var(--text-secondary); font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 14px; border-radius: 999px; cursor: pointer; white-space: nowrap; transition: background var(--transition-fast), color var(--transition-fast); }
.mkt-seg-btn:hover { color: var(--text-primary); }
.mkt-seg-btn.is-active { background: var(--bg-elevated); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.mkt-seg-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.mkt-banner { grid-column: 1 / -1; font-size: 12.5px; color: var(--text-secondary); padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--border-strong); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

@media (max-width: 600px) {
  .mkt-seg { display: flex; align-self: stretch; }
  .mkt-seg-btn { flex: 1 1 0; padding: 8px 8px; font-size: 12px; white-space: normal; }
  .mkt-actions .btn { flex: 1 1 auto; justify-content: center; min-height: 42px; }
  .mkt-controls { gap: 10px; }
  .mkt-fields { grid-template-columns: 1fr; }
}

/* Cabecera: estado debajo del nombre (no le quita ancho al nombre) */
.mkt-head-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.mkt-head-sub .mkt-status { margin-top: 0; }
.mkt-head-sub .chan-sub { margin-top: 0; }
/* Botones de una tarjeta conectada: 2 columnas + "Desconectar" como enlace */
.mkt-actions.is-compact { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mkt-actions.is-compact .btn { justify-content: center; padding: 7px 8px; font-size: 12.5px; white-space: nowrap; }
.mkt-link { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; gap: 6px; appearance: none; background: none; border: 0; padding: 4px 2px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.mkt-link svg { width: 14px; height: 14px; }
.mkt-link.mkt-danger { color: var(--accent-danger) !important; border: 0 !important; }
.mkt-link:hover { text-decoration: underline; }
@media (max-width: 600px) { .mkt-actions.is-compact .btn { min-height: 42px; } }
