@charset "UTF-8";
/* ============================================================
   PubliShot Pro — components.css  [Dark Edition]
   Botones, campos, tarjetas, badges, componentes reutilizables
   ============================================================ */

/* ── Botones — base ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition),
              transform .15s ease, opacity var(--transition);
  border: none;
  white-space: nowrap;
  user-select: none;
  letter-spacing: 0.1px;
}
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:focus-visible {
  outline: 2px solid var(--brand-mid);
  outline-offset: 2px;
}
.btn:disabled { opacity: .35; cursor: not-allowed; pointer-events: none; }

/* ── Variantes ──────────────────────────────────────────────── */
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: white;
  box-shadow: 0 4px 16px var(--brand-glow);
}
.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(124,95,245,0.55);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--brand-light);
  color: var(--brand-mid);
  border: 1px solid rgba(124,95,245,0.25);
}
.btn-secondary:hover { background: rgba(124,95,245,0.2); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface2); border-color: var(--border-dark); color: var(--text); }

.btn-danger {
  background: rgba(255,77,79,0.1);
  color: var(--danger);
  border: 1px solid rgba(255,77,79,0.25);
}
.btn-danger:hover { background: rgba(255,77,79,0.2); }

/* Gradiente publicar */
.btn-publish {
  background: linear-gradient(135deg, var(--brand), #7B2FBE);
  color: white;
  box-shadow: 0 4px 18px var(--brand-glow);
}
.btn-publish:hover { transform: translateY(-1px); box-shadow: 0 6px 26px rgba(124,95,245,0.55); }

/* ── Tamaños ────────────────────────────────────────────────── */
.btn-sm   { padding: 7px 12px; font-size: 12px; }
.btn-lg   { padding: 13px 24px; font-size: 15px; font-weight: 700; }
.btn-full { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--r-sm); }

/* ── Estado de carga ────────────────────────────────────────── */
.btn.loading {
  pointer-events: none;
  opacity: 0.75;
  position: relative;
}
.btn.loading > * { opacity: 0; }
.btn.loading::after {
  content: '';
  position: absolute;
  width: 15px; height: 15px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.btn-secondary.loading::after, .btn-ghost.loading::after {
  border-color: rgba(124,95,245,.2);
  border-top-color: var(--brand);
}

/* ── Campos de formulario ───────────────────────────────────── */
.field { margin-bottom: 24px !important; }
.field-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 6px;
}
.field-input {
  width: 100%;
  padding: 11px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
}
.field-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124,95,245,0.15);
  background: var(--surface3);
}
.field-input::placeholder { color: var(--text-3); }
textarea.field-input { resize: vertical; min-height: 80px; }

.field-input.error {
  border-color: var(--danger);
  background: rgba(255,77,79,0.05);
  box-shadow: 0 0 0 3px rgba(255,77,79,0.1);
  animation: shake .3s ease;
}
@keyframes shake {
  0%,100%{ transform: translateX(0); }
  25%    { transform: translateX(-6px); }
  75%    { transform: translateX(6px); }
}

.field-error {
  font-size: 11px;
  color: var(--danger);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.field-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.field-row .field-input { flex: 1; }
.field-hint {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ── Toggle switch ──────────────────────────────────────────── */
.toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.toggle-row:last-child { border-bottom: none; }
.toggle-info { flex: 1; min-width: 0; }
.toggle-info-label { font-size: 14px; font-weight: 500; color: var(--text); }
.toggle-info-sub   { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.toggle-row > .toggle { flex-shrink: 0; margin-top: 2px; }

.toggle {
  position: relative;
  width: 44px; height: 24px;
  flex-shrink: 0;
}
.toggle input { display: none; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--border-dark);
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: white;
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.toggle input:checked + .toggle-slider {
  background: var(--brand);
  border-color: transparent;
  box-shadow: 0 0 10px var(--brand-glow);
}
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Tarjetas ────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.card-pad { padding: 16px; }
.card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-header svg { width: 16px; height: 16px; color: var(--brand-mid); }

.platform-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 10px;
  transition: border-color var(--transition), background var(--transition);
}
.platform-card.connected {
  border-color: rgba(0,214,143,0.35);
  background: rgba(0,214,143,0.04);
}
.platform-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.platform-icon svg, .platform-icon img { width: 24px; height: 24px; }
.platform-info { flex: 1; min-width: 0; }
.platform-name { font-size: 14px; font-weight: 600; color: var(--text); }
.platform-sub  { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.platform-card.connected .platform-sub { color: var(--success); }

/* ── Badges ─────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.badge-ok      { background: rgba(0,214,143,0.15);  color: var(--success); }
.badge-warn    { background: rgba(245,158,11,0.15);  color: var(--warning); }
.badge-error   { background: rgba(255,77,79,0.15);   color: var(--danger); }
.badge-neutral { background: var(--surface2); color: var(--text-3); border: 1px solid var(--border); }
.badge-brand   { background: var(--brand-light); color: var(--brand-mid); }

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  flex-shrink: 0;
}
.status-dot.ok   { background: var(--success); box-shadow: 0 0 7px rgba(0,214,143,0.6); }
.status-dot.err  { background: var(--danger); }
.status-dot.warn { background: var(--warning); }

/* ── Plantillas ─────────────────────────────────────────────── */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.template-card {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  aspect-ratio: 1/1;
  background: var(--surface2);
}
.template-card:hover { transform: scale(1.04); }
.template-card.selected {
  border-color: var(--brand);
  box-shadow: 0 0 18px var(--brand-glow);
  animation: selectPop .2s ease;
}
@keyframes selectPop {
  from { transform: scale(0.96); }
  to   { transform: scale(1); }
}
.template-card.selected::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(124,95,245,0.15);
  pointer-events: none;
}
.template-check {
  position: absolute;
  top: 6px; right: 6px;
  width: 22px; height: 22px;
  background: var(--brand);
  border-radius: 50%;
  display: none;
  align-items: center; justify-content: center;
  z-index: 2;
  box-shadow: 0 0 10px var(--brand-glow);
}
.template-check svg { width: 13px; height: 13px; color: white; }
.template-card.selected .template-check { display: flex; }
.template-preview { width: 100%; height: 100%; object-fit: cover; }
.template-name {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 8px 8px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
  font-size: 11px;
  font-weight: 800;
  color: white;
  letter-spacing: .04em;
  text-shadow: 0 1px 6px rgba(0,0,0,0.8);
}
.template-card canvas { width: 100%; height: 100%; display: block; }

/* Fondo instantáneo visible antes de que el JS renderice los thumbnails */
.template-card[data-template="rosa"]        { background: linear-gradient(135deg, #fff1f5, #f5c6d3 55%, #c97090); }
.template-card[data-template="dorado"]      { background: linear-gradient(135deg, #111008, #30270d 55%, #d4af37); }
.template-card[data-template="minimalista"] { background: linear-gradient(135deg, #f8f8f8, #dddddd 58%, #111111); }
.template-card[data-template="morado"]      { background: linear-gradient(135deg, #1a0a2e, #43146f 55%, #cc44ff); }
.template-card[data-template="turquesa"]    { background: linear-gradient(135deg, #3d2a1a, #b87850 55%, #f2d9b8); }
.template-card[data-template="oscuro"]      { background: linear-gradient(135deg, #050505, #1a1a1a 58%, #ff4136); }

/* ── Upload zone ─────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed rgba(255,255,255,0.11);
  border-radius: var(--r-lg);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition),
              color var(--transition), transform var(--transition), box-shadow var(--transition);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  margin-bottom: 24px !important;
}
.upload-zone:hover {
  border-color: var(--brand);
  background: var(--brand-light);
  color: var(--brand-mid);
}
.upload-zone.drag-over {
  border-color: var(--brand);
  border-style: solid;
  background: var(--brand-light);
  color: var(--brand-mid);
  transform: scale(1.02);
  box-shadow: 0 0 24px var(--brand-glow);
}
.upload-zone svg { width: 36px; height: 36px; opacity: .5; }
.upload-zone p { font-size: 13px; }
.upload-zone strong { color: var(--brand-mid); }
.upload-zone.has-image { border-style: solid; border-color: var(--brand); }

/* ── Canvas ──────────────────────────────────────────────────── */
.canvas-wrapper {
  margin: 0 auto 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.canvas-container {
  background: #000;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(124,95,245,0.18), var(--shadow-lg);
  position: relative;
  aspect-ratio: 9 / 16;
  max-width: 100%;
  margin: 0 auto;
  touch-action: auto;
}
.canvas-container:active { cursor: grabbing; }
.canvas-container canvas { width: 100%; height: 100%; display: block; }
.canvas-container::before { display: none; }

#main-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: move;
}

.canvas-hint {
  position: absolute;
  bottom: 6px; left: 50%;
  transform: translateX(-50%);
  background: rgba(8,8,12,0.65);
  color: rgba(255,255,255,0.7);
  font-size: 10px;
  letter-spacing: .3px;
  padding: 3px 10px;
  border-radius: 20px;
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.07);
}

.canvas-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 10px auto 14px;
  width: min(76vw, 380px, calc((100vh - 250px) * 0.5625));
}

/* ── Filtros de plantillas ───────────────────────────────────── */
.tmpl-picker-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 2px 0 10px;
}
.tmpl-picker-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.1;
}
.tmpl-picker-sub {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  margin-top: 3px;
}
.tmpl-picker-link {
  flex-shrink: 0;
  border: 0;
  background: transparent;
  color: var(--brand-mid);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 0 5px 12px;
  cursor: pointer;
}

.tmpl-filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}
.tmpl-filter-bar::-webkit-scrollbar { display: none; }
.tmpl-filter-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text-3);
  transition: all .18s ease;
  font-family: inherit;
  white-space: nowrap;
}
.tmpl-filter-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 0 12px var(--brand-glow);
}
.tmpl-filter-btn:active { transform: scale(0.95); }

.tmpl-show-more {
  width: 100%;
  background: none;
  border: 1.5px dashed rgba(255,255,255,0.12);
  border-radius: var(--r-md);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  padding: 10px;
  cursor: pointer;
  margin-bottom: 16px;
  transition: border-color .18s, color .18s, background .18s;
  letter-spacing: .02em;
}
.tmpl-show-more:hover { border-color: var(--brand); color: var(--brand-mid); background: var(--brand-light); }
.tmpl-show-more.expanded { display: none; }
#s-new-2 .tmpl-show-more { display: none !important; }

/* ── Strip de plantillas (paso 2) ───────────────────────────── */
.tmpl2-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 18px;
  margin-bottom: 18px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 2px;
  -webkit-overflow-scrolling: touch;
}
.tmpl2-strip::-webkit-scrollbar { display: none; }

.tmpl2-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  cursor: pointer;
  padding: 6px;
  border-radius: 14px;
  border: 2px solid rgba(255,255,255,0.06);
  background: var(--surface2);
  transition: border-color .2s, box-shadow .2s, transform .15s;
  scroll-snap-align: start;
}
.tmpl2-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.5);
  border-color: rgba(255,255,255,0.15);
}
.tmpl2-card.selected {
  border-color: var(--brand);
  box-shadow: 0 0 14px var(--brand-glow);
}
.tmpl2-card canvas {
  width: 82px;
  height: 54px;
  display: block;
  border-radius: 10px;
  overflow: hidden;
}
.tmpl2-card[data-template="rosa"] canvas {
  background: linear-gradient(135deg, #fff1f5, #f5c6d3 55%, #c97090);
}
.tmpl2-card[data-template="dorado"] canvas {
  background: linear-gradient(135deg, #111008, #30270d 55%, #d4af37);
}
.tmpl2-card[data-template="minimalista"] canvas {
  background: linear-gradient(135deg, #ffffff, #eeeeee 58%, #111111);
}
.tmpl2-card[data-template="morado"] canvas {
  background: linear-gradient(135deg, #1a0a2e, #43146f 55%, #cc44ff);
}
.tmpl2-card[data-template="turquesa"] canvas {
  background: linear-gradient(135deg, #3d2a1a, #b87850 55%, #f2d9b8);
}
.tmpl2-card[data-template="oscuro"] canvas {
  background: linear-gradient(135deg, #050505, #1a1a1a 58%, #ff4136);
}
.tmpl2-name {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-3);
  text-align: center;
  white-space: nowrap;
  letter-spacing: .2px;
}
.tmpl2-card.selected .tmpl2-name { color: var(--brand-mid); }
.tmpl2-check {
  display: none;
  position: absolute;
  top: 4px; right: 4px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--brand);
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px var(--brand-glow);
}
.tmpl2-check svg { width: 9px; height: 9px; stroke: white; }
.tmpl2-card.selected .tmpl2-check { display: flex; }

.tmpl-fav-btn {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 4;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  background: rgba(8,8,12,0.68);
  color: rgba(255,255,255,0.82);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: transform .16s, color .16s, border-color .16s, background .16s;
}
.tmpl-fav-btn svg {
  width: 13px;
  height: 13px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linejoin: round;
}
.tmpl-fav-btn.is-favorite {
  color: #ffd76a;
  border-color: rgba(255,215,106,0.55);
  background: rgba(70,50,10,0.82);
}
.tmpl-fav-btn.is-favorite svg { fill: currentColor; }
.tmpl-fav-btn:active { transform: scale(0.9); }
.tmpl-empty-state {
  display: none;
  width: 100%;
  border: 1px dashed rgba(255,255,255,0.14);
  border-radius: 14px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
  padding: 14px;
  text-align: center;
  background: rgba(255,255,255,0.03);
}

/* ── Responsive paso 2 ──────────────────────────────────────── */
@media (max-width: 759px) {
  #s-new-2 .tmpl2-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 16px;
    margin-bottom: 14px;
    width: 100%;
    box-sizing: border-box;
  }
  #s-new-2 .tmpl2-card {
    min-width: 118px;
    width: 118px;
    overflow: hidden;
    padding: 6px;
    gap: 5px;
    border-radius: 14px;
    border-width: 2px;
    flex-shrink: 0;
  }
  #s-new-2 .tmpl2-card canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    max-width: 100%;
    min-width: 0;
    border-radius: 10px;
  }
  #s-new-2 .tmpl2-name {
    font-size: 10px;
    font-weight: 700;
    line-height: 1.2;
    white-space: normal;
    text-align: center;
    min-height: 24px;
    padding: 2px 4px 1px;
    color: var(--text-2);
    background: transparent;
  }
  #s-new-2 .tmpl2-card.selected .tmpl2-name {
    color: var(--brand-mid);
    background: transparent;
  }
  #s-new-2 > .btn.btn-primary { margin-top: 2px; }

  #s-profile .biz-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  #s-profile .biz-field { min-width: 0; }
  #s-profile .biz-field-header { gap: 12px; }
  #s-profile .biz-field-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #s-profile { padding-bottom: calc(var(--nav-h) + 28px); }
  #s-profile .profile-section { overflow: visible; }
}

/* ── Publicación ─────────────────────────────────────────────── */
.publish-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.publish-row:last-child { border-bottom: none; }

/* Refinamiento selector de plantillas: version fiel al mockup */
#s-new-2 .canvas-wrapper {
  width: 100%;
}

#s-new-2 .canvas-container {
  aspect-ratio: 9 / 16;
  width: min(100%, 340px);
  max-height: none;
}

#s-new-2 .tmpl-picker-head {
  width: 100%;
  max-width: 100%;
}

#s-new-2 .tmpl-picker-link {
  border: 1px solid rgba(124,95,245,0.45);
  border-radius: 999px;
  padding: 7px 12px;
  line-height: 1;
  background: rgba(124,95,245,0.08);
}

#s-new-2 .tmpl2-strip {
  align-items: stretch;
}

#s-new-2 .tmpl2-card {
  min-height: 132px;
}

#s-new-2 .tmpl2-card canvas {
  background-color: rgba(255,255,255,0.04);
}

#s-new-2 .tmpl-fav-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
}

#s-new-2 .tmpl-fav-icon {
  display: block;
  transform: translateY(-1px);
}

#s-new-2 .tmpl-fav-btn svg,
#s-new-2 .tmpl-fav-btn polygon {
  display: none !important;
}

@media (max-width: 759px) {
  #s-new-2 {
    padding-bottom: calc(var(--nav-h) + 40px) !important;
  }

  #s-new-2 .step-title {
    margin-top: 2px;
  }

  #s-new-2 .step-sub {
    font-size: 11px;
    margin-bottom: 10px;
  }

  #s-new-2 .canvas-wrapper {
    margin-bottom: 8px;
  }

  #s-new-2 .canvas-container {
    width: min(76vw, 330px);
    max-width: 330px;
    border-radius: 18px;
  }

  #s-new-2 .canvas-actions {
    width: min(76vw, 330px);
    max-width: 330px;
    margin: 8px auto 12px;
  }

  #s-new-2 .tmpl-picker-head {
    margin-top: 4px;
    margin-bottom: 8px;
  }

  #s-new-2 .tmpl-filter-bar {
    margin-bottom: 8px;
  }

  #s-new-2 .tmpl2-strip {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 10px;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 2px 2px 14px;
    scroll-snap-type: x mandatory;
  }

  #s-new-2 .tmpl2-card {
    flex: 0 0 136px !important;
    width: 136px !important;
    min-width: 136px !important;
    height: 118px;
    min-height: 118px;
    border-radius: 16px;
    padding: 7px;
    align-items: stretch;
    background: rgba(255,255,255,0.055);
  }

  #s-new-2 .tmpl2-card canvas {
    width: 100% !important;
    height: 70px !important;
    aspect-ratio: auto;
    border-radius: 12px;
  }

  #s-new-2 .tmpl2-name {
    min-height: 20px;
    padding: 4px 2px 0;
    text-align: left;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #s-new-2 > .btn.btn-primary {
    position: static !important;
    width: 100%;
    margin: 6px 0 0;
    min-height: 46px;
  }
}

@media (min-width: 760px) {
  #s-new-2.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: min(1380px, calc(100vw - 72px));
    margin: 0 auto;
    padding: 8px 36px calc(var(--nav-h) + 92px) !important;
    gap: 5px;
  }

  #s-new-2 .canvas-container {
    width: clamp(180px, min(16vw, 24vh), 230px);
    min-width: 180px;
    max-width: 230px;
    border-radius: 18px;
  }

  #s-new-2 .canvas-actions {
    width: clamp(180px, min(16vw, 24vh), 230px);
    min-width: 180px;
    max-width: 230px;
    margin: 6px auto 2px;
    gap: 8px;
  }

  #s-new-2 .canvas-actions .btn {
    min-height: 32px;
    padding: 6px 9px;
    font-size: 12px;
  }

  #s-new-2 .step-bar,
  #s-new-2 .step-header,
  #s-new-2 .step-title,
  #s-new-2 .step-sub,
  #s-new-2 .tmpl-picker-head {
    width: 100%;
    max-width: none;
  }

  #s-new-2 .step-title {
    font-size: 16px;
    margin-bottom: 0;
  }

  #s-new-2 .step-sub {
    font-size: 10px;
    margin-bottom: 0;
  }

  #s-new-2 .canvas-wrapper {
    margin-bottom: 2px;
  }

  #s-new-2 .tmpl-filter-bar {
    width: 100%;
    max-width: none;
    margin-bottom: 4px;
  }

  #s-new-2 .tmpl2-strip {
    width: 100%;
    max-width: none;
    display: flex;
    flex-wrap: nowrap;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 12px;
    margin: 0 0 4px;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
  }

  #s-new-2 .tmpl2-card {
    flex: 0 0 176px;
    width: 176px;
    min-width: 176px;
    height: 116px;
    min-height: 116px;
    padding: 7px;
    border-radius: 16px;
    align-items: stretch;
  }

  #s-new-2 .tmpl2-card canvas {
    width: 100%;
    height: 70px;
    border-radius: 12px;
  }

  #s-new-2 .tmpl2-name {
    font-size: 11px;
    text-align: left;
    padding: 2px 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #s-new-2 > .btn.btn-primary {
    width: 100%;
    max-width: none;
    margin-top: 2px;
    min-height: 40px;
  }
}

@media (min-width: 99999px) {
  #s-new-2.active {
    display: grid;
    grid-template-columns: minmax(300px, 420px) minmax(440px, 1fr);
    grid-template-areas:
      "progress progress"
      "header header"
      "title title"
      "canvas picker"
      "canvas filters"
      "canvas templates"
      "canvas next";
    align-items: start;
    justify-content: center;
    column-gap: 44px;
    row-gap: 8px;
    max-width: 1220px;
    min-height: calc(100dvh - var(--header-h) - var(--nav-h));
    margin: 0 auto;
    padding: 22px 40px calc(var(--nav-h) + 28px) !important;
  }

  #s-new-2 .step-bar {
    grid-area: progress;
    max-width: 1220px;
  }

  #s-new-2 .step-header {
    grid-area: header;
    max-width: 1220px;
  }

  #s-new-2 .step-title,
  #s-new-2 .step-sub {
    grid-area: title;
    max-width: 1220px;
  }

  #s-new-2 .step-title {
    font-size: 18px;
  }

  #s-new-2 .canvas-wrapper {
    grid-area: canvas;
    align-self: start;
    justify-self: center;
    margin: 0;
  }

  #s-new-2 .canvas-container {
    width: clamp(260px, min(24vw, 38vh), 320px);
    min-width: 260px;
    max-width: 320px;
    border-radius: 20px;
  }

  #s-new-2 .canvas-actions {
    width: clamp(260px, min(24vw, 38vh), 320px);
    min-width: 260px;
    max-width: 320px;
    margin: 10px auto 0;
  }

  #s-new-2 .tmpl-picker-head {
    grid-area: picker;
    align-self: end;
    max-width: none;
    margin: 2px 0 2px;
  }

  #s-new-2 .tmpl-filter-bar {
    grid-area: filters;
    max-width: none;
    margin: 0 0 4px;
  }

  #s-new-2 .tmpl2-strip {
    grid-area: templates;
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 12px;
    width: 100%;
    max-width: none;
    max-height: min(330px, 38vh);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px 8px 6px 2px;
    margin: 0;
    scroll-snap-type: none;
    scrollbar-width: thin;
  }

  #s-new-2 .tmpl2-card {
    width: 100%;
    min-width: 0;
    height: 118px;
    min-height: 118px;
    padding: 8px;
  }

  #s-new-2 .tmpl2-card canvas {
    height: 70px;
  }

  #s-new-2 > .btn.btn-primary {
    grid-area: next;
    width: 100%;
    max-width: none;
    min-height: 46px;
    margin-top: 6px;
  }
}

.template-browser {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  background: rgba(5,5,9,0.78);
  backdrop-filter: blur(10px);
  padding: 18px;
}
.template-browser.open ~ #update-banner,
body:has(.template-browser.open) #update-banner {
  display: none !important;
}
.template-browser.open { display: grid; place-items: center; }
.template-browser-panel {
  width: min(960px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #111119;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  box-shadow: 0 22px 70px rgba(0,0,0,0.55);
  padding: 16px;
}
.template-browser-search,
.template-browser-filters,
.template-browser-grid {
  width: 100%;
  min-width: 0;
}
.template-browser-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.template-browser-title {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}
.template-browser-sub {
  color: var(--text-3);
  font-size: 12px;
  margin-top: 3px;
}
.template-browser-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.template-browser-search {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.055);
  color: var(--text);
  font: inherit;
  padding: 0 14px;
  outline: none;
}
.template-browser-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0 6px;
  flex-shrink: 0;
}
.template-browser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
  gap: 14px;
  overflow-y: auto;
  padding: 2px 6px 10px 0;
  min-height: 0;
}
.template-browser-card {
  position: relative;
  min-width: 0;
  text-align: left;
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  background: rgba(255,255,255,0.055);
  color: var(--text);
  padding: 10px;
  cursor: pointer;
  font: inherit;
  height: 168px;
  overflow: hidden;
}
.template-browser-card.selected {
  border-color: var(--brand);
  box-shadow: 0 0 0 1px var(--brand), 0 0 18px var(--brand-glow);
}
.template-browser-thumb {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
  height: 116px;
}
.template-browser-thumb canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.template-browser-tier {
  position: absolute;
  right: 6px;
  top: 6px;
  border-radius: 999px;
  background: rgba(10,10,14,0.76);
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  padding: 3px 6px;
}
.template-browser-star {
  position: absolute;
  left: 6px;
  top: 6px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(10,10,14,0.72);
  color: rgba(255,255,255,0.82);
  font-size: 14px;
}
.template-browser-star.is-favorite { color: #ffd76a; }
.template-browser-name {
  display: block;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 800;
  margin-top: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.template-browser-empty {
  display: none;
  color: var(--text-3);
  border: 1px dashed rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 759px) {
  .template-browser {
    padding: 0;
    align-items: stretch;
  }
  .template-browser.open { display: block; }
  .template-browser-panel {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    border: 0;
    padding: 18px 14px 26px;
    overflow: hidden;
  }
  .template-browser-head { flex-shrink: 0; }
  .template-browser-title { font-size: 20px; }
  .template-browser-search { min-height: 50px; }
  .template-browser-filters {
    gap: 7px;
    padding: 4px 0 8px;
  }
  .template-browser-filters .tmpl-filter-btn {
    padding: 7px 16px;
  }
  .template-browser-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 4px 32px 0;
    align-content: start;
  }
  .template-browser-card {
    height: 156px;
    min-height: 156px;
    padding: 8px;
  }
  .template-browser-thumb {
    height: 104px;
    border-radius: 11px;
  }
  .template-browser-name {
    margin-top: 6px;
    font-size: 12px;
  }
}
.publish-net-name { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); }
.publish-status   { font-size: 12px; color: var(--text-3); }
.publish-status.ok    { color: var(--success); }
.publish-status.error { color: var(--danger); }

/* ── Step bar ────────────────────────────────────────────────── */
.step-bar {
  height: 3px;
  background: rgba(255,255,255,0.07);
  border-radius: 2px;
  margin-bottom: 24px;
  overflow: hidden;
}
.step-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--brand-mid));
  border-radius: 2px;
  transition: width .4s ease;
  box-shadow: 0 0 10px var(--brand-glow);
}

/* ── Utilidades de espaciado ────────────────────────────────── */
.sep  { height: 1px; background: var(--border); margin: 16px 0; }
.mb4  { margin-bottom: 4px; }   .mt4  { margin-top: 4px; }
.mb8  { margin-bottom: 8px; }   .mt8  { margin-top: 8px; }
.mb12 { margin-bottom: 12px; }  .mt12 { margin-top: 12px; }
.mb16 { margin-bottom: 16px; }  .mt16 { margin-top: 16px; }
.mb20 { margin-bottom: 20px; }

/* ── Utilidades de layout ───────────────────────────────────── */
.flex            { display: flex; }
.flex-1          { flex: 1; }
.gap8            { gap: 8px; }
.gap12           { gap: 12px; }
.items-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.text-center     { text-align: center; }
.w100            { width: 100%; }

/* ── Utilidades de texto ────────────────────────────────────── */
.text-brand { color: var(--brand-mid); }
.text-muted { color: var(--text-3); }
.text-sm    { font-size: 12px; }
.text-xs    { font-size: 11px; }
.font-bold  { font-weight: 700; }

/* ── Mostrar/ocultar contraseña ─────────────────────────────── */
.pwd-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pwd-wrap input {
  flex: 1;
  padding-right: 44px;
}
.pwd-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-3);
  display: flex;
  align-items: center;
  transition: color var(--transition);
}
.pwd-toggle:hover { color: var(--text-2); }
.pwd-toggle svg { width: 18px; height: 18px; }

/* ── Grid info del negocio ──────────────────────────────────── */
.biz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.biz-field {
  background: var(--surface2);
  border-radius: var(--r-md);
  padding: 12px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.biz-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.biz-field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
}
.biz-field input { font-size: 13px; }
.biz-field .field-input { background: var(--surface3); }

/* ── Tarjeta vista previa (paso 3) ──────────────────────────── */
.final-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface2);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  padding: 14px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-md);
}
.final-card-preview {
  width: 80px;
  height: 80px;
  min-width: 80px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  background: var(--surface3);
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
}
.final-card-info { flex: 1; min-width: 0; }
.final-card-product {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.final-card-price {
  font-size: 13px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 6px;
}
.final-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(124,95,245,0.12);
  color: var(--brand-mid);
  border: 1px solid rgba(124,95,245,0.2);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: 600;
}

/* ── Botón publicar con loading ─────────────────────────────── */
.btn-pub { position: relative; }
.btn-pub.loading { pointer-events: none; opacity: .75; }
.btn-pub .btn-spinner {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-pub.loading .btn-spinner { display: inline-block; }
.btn-pub.loading .btn-label   { display: none; }

/* ── Acordeón paso 3 ────────────────────────────────────────── */
.pub-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  border-bottom: 0px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
}
.pub-card-header:hover { background: var(--surface2); }
.pub-card-header svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--brand-mid); }
.pub-card-header-title { flex: 1; }
.pub-card-chevron {
  width: 15px; height: 15px;
  color: var(--text-3);
  transition: transform var(--transition);
  flex-shrink: 0;
}
.pub-card-chevron.open { transform: rotate(180deg); }
.pub-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, border-top-width 0.1s;
  border-top: 0px solid rgba(255,255,255,0.12);
}
.pub-card-body.open {
  max-height: 1200px;
  border-top-width: 1px;
}

.pub-card-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--brand-light);
  color: var(--brand-mid);
  flex-shrink: 0;
}
.pub-card-badge.connected {
  background: rgba(0,214,143,0.12);
  color: var(--success);
}

/* ── Botones fijos pie del paso 3 ───────────────────────────── */
.publish-dual-fixed {
  position: fixed;
  bottom: var(--nav-h);
  left: 0; right: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 16px 10px;
  z-index: 50;
  pointer-events: none;
  background: linear-gradient(to top, var(--bg) 60%, transparent);
}
.publish-dual-fixed > * { pointer-events: all; }

#s-new-3 { padding-bottom: 150px !important; }

@media (min-width: 1024px) {
  .publish-dual-fixed {
    position: sticky;
    bottom: 12px;
    margin-top: 12px;
    background: none;
    padding: 0;
  }
  #s-new-3 { padding-bottom: 16px !important; }
}

/* ── Botones de compartir ────────────────────────────────────── */
.share-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
@media (max-width: 479px) {
  .share-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}
.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 4px;
  border-radius: var(--r-md);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-2);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  user-select: none;
}
.share-btn svg { width: 24px; height: 24px; flex-shrink: 0; }
.share-btn:active { transform: scale(0.93); }
.share-btn:hover  { box-shadow: var(--shadow-md); border-color: var(--border-dark); }

.share-btn-wsp   { border-color: rgba(37,211,102,0.2); background: rgba(37,211,102,0.06); color: #4ade80; }
.share-btn-wsp:hover { border-color: #25D366; box-shadow: 0 3px 14px rgba(37,211,102,.28); }

.share-btn-ig    { border-color: rgba(233,30,140,0.2); background: rgba(233,30,140,0.06); color: #f472b6; }
.share-btn-ig:hover { border-color: #E91E8C; box-shadow: 0 3px 14px rgba(233,30,140,.28); }

.share-btn-fb    { border-color: rgba(24,119,242,0.2); background: rgba(24,119,242,0.06); color: #60a5fa; }
.share-btn-fb:hover { border-color: #1877F2; box-shadow: 0 3px 14px rgba(24,119,242,.28); }

.share-btn-tt    { border-color: rgba(255,255,255,0.08); background: rgba(255,255,255,0.03); color: var(--text-2); }
.share-btn-tt:hover { border-color: rgba(255,255,255,0.2); box-shadow: 0 3px 14px rgba(0,0,0,.35); }

/* Botón compartir (teal) */
.btn-share {
  background: linear-gradient(135deg, #00D68F, #00B4D8);
  color: white;
  box-shadow: 0 4px 16px rgba(0,214,143,.28);
}
.btn-share:hover { transform: translateY(-1px); box-shadow: 0 6px 22px rgba(0,214,143,.42); }

/* Layout doble */
.publish-dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

/* MVP: editor de personalizacion estable en movil y escritorio */
body[data-screen="s-new-2"] #app::before,
body[data-screen="s-new-2"] #app::after {
  display: none;
}

@media (min-width: 1024px) {
  body[data-screen="s-new-2"] #sidebar {
    display: none;
  }

  body[data-screen="s-new-2"] #btn-menu {
    display: flex;
  }

  body[data-screen="s-new-2"] #main {
    width: 100vw;
  }
}

#s-new-2.active {
  --editor-max: min(1320px, calc(100vw - 28px));
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 auto !important;
  padding: 12px max(14px, env(safe-area-inset-left)) calc(var(--nav-h) + 34px) max(14px, env(safe-area-inset-right)) !important;
  overflow-x: hidden !important;
}

#s-new-2 .step-bar,
#s-new-2 .step-header,
#s-new-2 .step-title,
#s-new-2 .step-sub,
#s-new-2 .canvas-wrapper,
#s-new-2 .tmpl-picker-head,
#s-new-2 .tmpl-filter-bar,
#s-new-2 .tmpl2-strip,
#s-new-2 > .btn.btn-primary {
  width: 100% !important;
  max-width: var(--editor-max) !important;
}

#s-new-2 .step-bar {
  margin: 0 auto 8px !important;
}

#s-new-2 .step-header {
  margin: 0 auto 4px !important;
}

#s-new-2 .step-title {
  margin: 0 auto !important;
  font-size: 18px !important;
  line-height: 1.15 !important;
}

#s-new-2 .step-sub {
  margin: 0 auto 2px !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
}

#s-new-2 .canvas-wrapper {
  margin: 0 auto !important;
  align-items: center !important;
}

#s-new-2 .canvas-container {
  width: clamp(252px, min(22vw, 46dvh), 360px) !important;
  min-width: 0 !important;
  max-width: calc(100vw - 32px) !important;
  border-radius: 20px !important;
}

#s-new-2 .canvas-actions {
  width: min(100%, clamp(252px, min(22vw, 46dvh), 360px)) !important;
  max-width: calc(100vw - 32px) !important;
  margin: 8px auto 6px !important;
  gap: 8px !important;
}

#s-new-2 .canvas-actions .btn {
  min-width: 0 !important;
  min-height: 36px !important;
  padding: 7px 10px !important;
}

#s-new-2 .adjust-control-panel {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 7px 12px !important;
  width: min(100%, 620px) !important;
  max-width: calc(100vw - 32px) !important;
  margin: 6px auto 6px !important;
  padding: 9px 10px !important;
}

#s-new-2 .adjust-control-panel > div:first-child {
  grid-column: 1 / -1;
}

#s-new-2 .adjust-control-panel > div {
  min-width: 0;
}

#s-new-2 .adjust-control-panel span {
  min-width: 0;
}

#s-new-2 .quick-text-edit {
  width: min(100%, 620px) !important;
  max-width: calc(100vw - 32px) !important;
  margin: 0 auto 4px !important;
}

#s-new-2 .tmpl-picker-head {
  align-items: center !important;
  margin: 8px auto 0 !important;
}

#s-new-2 .tmpl-picker-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 34px !important;
  border: 1px solid rgba(124,95,245,0.55) !important;
  border-radius: 999px !important;
  padding: 7px 14px !important;
  background: rgba(124,95,245,0.08) !important;
  white-space: nowrap !important;
}

#s-new-2 .tmpl-filter-bar {
  margin: 0 auto !important;
  padding: 2px 0 4px !important;
}

#s-new-2 .tmpl2-strip {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 14px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding: 4px 2px 12px !important;
  margin: 0 auto !important;
  scroll-snap-type: x proximity !important;
  scrollbar-width: none !important;
}

#s-new-2 .tmpl2-card {
  flex: 0 0 178px !important;
  width: 178px !important;
  min-width: 178px !important;
  height: 118px !important;
  min-height: 118px !important;
  padding: 8px !important;
  border-radius: 16px !important;
  align-items: stretch !important;
  overflow: hidden !important;
}

#s-new-2 .tmpl2-card canvas {
  width: 100% !important;
  height: 70px !important;
  border-radius: 12px !important;
}

#s-new-2 .tmpl2-name {
  text-align: left !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  padding: 3px 2px 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

#s-new-2 > .btn.btn-primary {
  margin: 0 auto !important;
  min-height: 46px !important;
  border-radius: 10px !important;
}

@media (max-width: 759px) {
  #s-new-2.active {
    --editor-max: calc(100vw - 28px);
    gap: 8px !important;
    padding-top: 8px !important;
    padding-bottom: calc(var(--nav-h) + 28px) !important;
  }

  #s-new-2 .step-bar,
  #s-new-2 .step-header {
    display: none !important;
  }

  #s-new-2 .step-title {
    font-size: 17px !important;
  }

  #s-new-2 .step-sub {
    font-size: 11px !important;
  }

  #s-new-2 .canvas-container {
    width: clamp(232px, 68vw, 292px) !important;
  }

  #s-new-2 .canvas-actions {
    width: clamp(232px, 68vw, 292px) !important;
  }

  #s-new-2 .canvas-actions .btn {
    font-size: 12px !important;
    padding-inline: 8px !important;
  }

  #s-new-2 .adjust-control-panel {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
    font-size: 11px !important;
  }

  #s-new-2 .quick-text-edit {
    gap: 8px !important;
  }

  #s-new-2 .tmpl-picker-head {
    margin-top: 4px !important;
  }

  #s-new-2 .tmpl2-strip {
    gap: 12px !important;
    padding-bottom: 10px !important;
  }

  #s-new-2 .tmpl2-card {
    flex-basis: 154px !important;
    width: 154px !important;
    min-width: 154px !important;
    height: 124px !important;
    min-height: 124px !important;
  }

  #s-new-2 .tmpl2-card canvas {
    height: 76px !important;
  }
}

@media (min-width: 1200px) {
  #s-new-2.active {
    --editor-max: min(1440px, calc(100vw - 48px));
  }

  #s-new-2 .canvas-container {
    width: clamp(292px, min(19vw, 50dvh), 390px) !important;
  }

  #s-new-2 .canvas-actions {
    width: min(100%, clamp(292px, min(19vw, 50dvh), 390px)) !important;
  }

  #s-new-2 .tmpl2-card {
    flex-basis: 196px !important;
    width: 196px !important;
    min-width: 196px !important;
    height: 126px !important;
  }

  #s-new-2 .tmpl2-card canvas {
    height: 76px !important;
  }
}

/* Selector completo de plantillas: evita desbordes en iPhone y tarjetas cortadas */
.template-browser-panel {
  width: min(980px, calc(100vw - 32px)) !important;
}

.template-browser-card {
  height: auto !important;
  min-height: 0 !important;
}

.template-browser-thumb {
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
}

@media (max-width: 759px) {
  .template-browser-panel {
    width: 100dvw !important;
    height: 100dvh !important;
    max-height: none !important;
  }

  .template-browser-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    overflow-x: hidden !important;
    gap: 10px !important;
    padding-right: 2px !important;
  }

  .template-browser-card {
    padding: 8px !important;
  }

  .template-browser-name {
    min-height: 18px !important;
  }
}

/* MVP final: primera vista de Personaliza debe mostrar canvas + plantillas */
#s-new-2 .adjust-control-panel,
#s-new-2 .quick-text-edit {
  display: none !important;
}

#s-new-2 .canvas-container {
  width: clamp(216px, min(14vw, 38dvh), 280px) !important;
}

#s-new-2 .canvas-actions {
  width: min(100%, clamp(216px, min(14vw, 38dvh), 280px)) !important;
}

#s-new-2 .canvas-wrapper {
  margin-bottom: 0 !important;
}

#s-new-2 .tmpl-picker-head {
  margin-top: 2px !important;
}

@media (max-width: 759px) {
  #s-new-2.active {
    padding-bottom: calc(var(--nav-h) + 110px) !important;
  }

  #s-new-2 .canvas-container {
    width: clamp(208px, 58vw, 232px) !important;
  }

  #s-new-2 .canvas-actions {
    width: clamp(208px, 58vw, 232px) !important;
  }

  #s-new-2 .step-title {
    margin-top: 6px !important;
  }

  #s-new-2 .step-sub {
    margin-bottom: 8px !important;
  }

  #s-new-2 .tmpl2-card {
    flex-basis: 146px !important;
    width: 146px !important;
    min-width: 146px !important;
    height: 116px !important;
    min-height: 116px !important;
  }

  #s-new-2 .tmpl2-card canvas {
    height: 68px !important;
  }

  #s-new-2 > .btn-primary.btn-full.btn-lg {
    position: fixed !important;
    left: 16px;
    right: 16px;
    bottom: calc(var(--nav-h) + 20px);
    width: auto !important;
    max-width: 560px;
    margin: 0 auto !important;
    z-index: 35;
    box-shadow: 0 14px 34px rgba(91, 53, 213, 0.42);
  }
}

@media (min-width: 1200px) {
  #s-new-2 .canvas-container {
    width: clamp(238px, min(15vw, 42dvh), 320px) !important;
  }

  #s-new-2 .canvas-actions {
    width: min(100%, clamp(238px, min(15vw, 42dvh), 320px)) !important;
  }
}

/* MVP final: compartir simple, sin estados de publicacion automatica */
#s-new-3.active {
  max-width: 1120px !important;
  margin: 0 auto !important;
  padding-bottom: calc(var(--nav-h) + 24px) !important;
}

#s-new-3 .step-title {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

.share-stage {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(230px, 360px) minmax(280px, 1fr);
  gap: 22px;
  align-items: center;
}

.share-preview-shell {
  width: min(100%, 340px);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 22px;
  overflow: hidden;
  background: var(--surface2);
  box-shadow: 0 18px 45px rgba(0,0,0,0.42);
}

#s-new-3 .final-card-preview {
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  border-radius: 0 !important;
  object-fit: cover !important;
  box-shadow: none !important;
}

.share-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,0.035);
  box-shadow: var(--shadow-md);
}

.share-product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.share-mini-action {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
}

.share-copy {
  min-height: 132px;
  resize: vertical;
  line-height: 1.45;
}

.share-action-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 10px;
}

.share-primary {
  background: linear-gradient(135deg,#8B5CF6,#5B35D5) !important;
}

.share-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.share-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface2);
  color: var(--text-2);
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 759px) {
  #s-new-3.active {
    padding-top: 10px !important;
    padding-bottom: calc(var(--nav-h) + 96px) !important;
  }

  .share-stage {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .share-preview-shell {
    width: min(42vw, 168px);
    border-radius: 16px;
  }

  .share-panel {
    padding: 13px;
    border-radius: 12px;
    gap: 9px;
  }

  #s-new-3 .step-title {
    font-size: 20px !important;
    margin: 4px auto 0 !important;
  }

  .share-copy {
    min-height: 92px;
  }

  .share-action-row {
    grid-template-columns: 1fr;
  }

  .share-primary {
    position: sticky;
    bottom: calc(var(--nav-h) + 14px);
    z-index: 30;
    box-shadow: 0 14px 34px rgba(91, 53, 213, 0.42);
  }

  .share-chip {
    flex: 1 1 calc(50% - 8px);
  }
}

.photo-ai-tools {
  display: none;
  align-items: stretch;
  gap: 8px;
  margin-top: 10px;
}

.photo-ai-btn {
  min-height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(124,95,245,0.42);
  background: rgba(124,95,245,0.13);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  cursor: pointer;
}

.photo-ai-btn small {
  font-size: 9px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: var(--text-2);
}

.photo-ai-btn.ghost {
  background: rgba(255,255,255,0.04);
  border-color: var(--border);
  color: var(--text-2);
}

.photo-ai-btn:disabled {
  opacity: .62;
  cursor: default;
}

.admin-editor-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(124,95,245,0.26);
  border-radius: 12px;
  background: rgba(124,95,245,0.08);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.35;
}
