/* Catálogo Pro (beta) — estilos del modal aislado */
.catpro-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55);
  z-index: 9500; display: flex; align-items: center; justify-content: center; padding: 24px;
}
.catpro-modal {
  background: #fff; border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  width: 100%; max-width: 1180px; height: 92vh; max-height: 92vh; display: flex; flex-direction: column; overflow: hidden;
  font: 14px/1.4 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #1f2937;
}
.catpro-head {
  display: flex; align-items: center; gap: 14px; padding: 14px 20px;
  border-bottom: 1px solid #e5e7eb; background: linear-gradient(135deg, #fafbfc, #fff);
}
.catpro-head .badge {
  background: #fef3c7; color: #92400e; font-size: 10px; font-weight: 800;
  padding: 3px 8px; border-radius: 8px; letter-spacing: .06em;
}
.catpro-head .name {
  font-size: 17px; font-weight: 800; flex: 1; outline: none; border: none; background: transparent;
}
.catpro-head .close {
  border: 1px solid #e5e7eb; background: #fff; width: 32px; height: 32px;
  border-radius: 50%; cursor: pointer; font-size: 18px; color: #6b7280;
}
.catpro-head .close:hover { background: #f3f4f6; }

.catpro-tabs {
  display: flex; gap: 4px; padding: 8px 16px 0; border-bottom: 1px solid #e5e7eb; background: #fff;
}
.catpro-tab {
  padding: 9px 16px; font-size: 13px; font-weight: 600; color: #6b7280;
  background: transparent; border: none; border-bottom: 2px solid transparent; cursor: pointer;
}
.catpro-tab.active { color: #B91C1C; border-bottom-color: #B91C1C; }
.catpro-tab:hover:not(.active) { color: #1f2937; }

.catpro-body { flex: 1; overflow: auto; padding: 20px; background: #f9fafb; }

.catpro-foot {
  display: flex; align-items: center; gap: 10px; padding: 12px 20px;
  border-top: 1px solid #e5e7eb; background: #fff;
}
.catpro-foot .spacer { flex: 1; }
.catpro-btn {
  padding: 9px 14px; font-size: 13px; font-weight: 600; border-radius: 8px;
  border: 1px solid #e5e7eb; background: #fff; cursor: pointer; color: #1f2937;
}
.catpro-btn:hover { background: #f3f4f6; }
.catpro-btn.primary { background: #B91C1C; color: #fff; border-color: #B91C1C; }
.catpro-btn.primary:hover { background: #991B1B; }
.catpro-btn:disabled { opacity: .5; cursor: not-allowed; }
.catpro-status { font-size: 12px; color: #6b7280; }

/* Artículos */
.catpro-articulos { display: grid; gap: 10px; }
.catpro-articulos-toolbar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px;
  position: sticky; top: 0; z-index: 2;
}
.catpro-articulos-toolbar button:disabled { opacity: .45; cursor: not-allowed; }
.catpro-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px;
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
}
.catpro-card.is-hidden { opacity: .5; }
.catpro-card .img {
  width: 64px; height: 64px; background: #f3f4f6; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  position: relative;
}
.catpro-card .img img { width: 100%; height: 100%; object-fit: cover; }
.catpro-card .img.empty { color: #9ca3af; font-size: 11px; }
.catpro-card .img .img-overlay {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: flex-end;
  gap: 2px; padding: 3px; opacity: 0; transition: opacity .12s; background: linear-gradient(to top, rgba(0,0,0,.5), transparent 50%);
}
.catpro-card .img:hover .img-overlay { opacity: 1; }
.catpro-card .img .img-btn {
  width: 22px; height: 22px; border: none; border-radius: 5px; background: rgba(255,255,255,.92); color: #1f2937;
  font-size: 12px; line-height: 1; padding: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.catpro-card .img .img-btn:hover { background: #fff; transform: scale(1.05); }
.catpro-card .info .top { display: flex; align-items: center; gap: 10px; }
.catpro-card .info .code { font: 600 12px/1 ui-monospace, SFMono-Regular, monospace; color: #B91C1C; }
.catpro-card .info .marca {
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 4px;
  background: #fef3c7; color: #92400e;
}
.catpro-card .info .desc { margin-top: 4px; font-weight: 600; font-size: 13px; color: #1f2937; }
.catpro-card .info .desc-edit {
  width: 100%; border: 1px solid #e5e7eb; padding: 6px 8px; border-radius: 6px;
  font: inherit; margin-top: 4px;
}
.catpro-card .info .specs { font-size: 11px; color: #6b7280; margin-top: 4px; }
.catpro-card .info .notas {
  width: 100%; border: 1px dashed #e5e7eb; padding: 6px 8px; border-radius: 6px;
  font: italic 12px/1.4 inherit; color: #6b7280; margin-top: 6px; resize: vertical;
}
.catpro-card .right { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.catpro-card .right .price-row { display: flex; gap: 6px; align-items: center; }
.catpro-card .right .price-input {
  width: 88px; padding: 6px 8px; border: 1px solid #e5e7eb; border-radius: 6px;
  text-align: right; font-weight: 700;
}
.catpro-card .right .base { font-size: 11px; color: #9ca3af; }
.catpro-card .right .ctrls { display: flex; gap: 6px; margin-top: 4px; }
.catpro-card .right .ctrls button {
  width: 26px; height: 26px; padding: 0; border: 1px solid #e5e7eb; background: #fff;
  border-radius: 6px; cursor: pointer; font-size: 14px;
}
.catpro-card .right .ctrls button:hover { background: #f3f4f6; }

/* Diseño */
.catpro-design-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; max-width: 920px; }
.catpro-section { background: #fff; border-radius: 10px; border: 1px solid #e5e7eb; padding: 18px; }
.catpro-section h3 { margin: 0 0 14px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: #6b7280; }
.catpro-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.catpro-field label { font-size: 12px; font-weight: 600; color: #4b5563; }
.catpro-field input[type=text], .catpro-field input[type=date], .catpro-field textarea, .catpro-field input[type=url] {
  border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px 10px; font: inherit; color: #1f2937;
}
.catpro-field textarea { min-height: 100px; resize: vertical; }
.catpro-field .row { display: flex; gap: 10px; align-items: center; }
.catpro-field input[type=color] { width: 48px; height: 36px; border: 1px solid #e5e7eb; border-radius: 8px; padding: 2px; cursor: pointer; }
.catpro-field input[type=color] + .hex { font: 12px/1 ui-monospace, monospace; color: #6b7280; }
.catpro-toggle { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.catpro-help { font-size: 11.5px; color: #9ca3af; }

/* Toggle live preview (Fase 7) */
.catpro-live-toggle {
  display: flex; align-items: center; gap: 6px; font-size: 12px; color: #475569; cursor: pointer;
  padding: 6px 10px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff;
}
.catpro-live-toggle:hover { border-color: #cbd5e1; }
.catpro-live-toggle input { margin: 0; }

/* Picker de contactos (Fase 6) */
.catpro-overlay-nested { z-index: 10002; background: rgba(15, 23, 42, .55); }
.catpro-contact-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 18px; cursor: pointer; border-bottom: 1px solid #f1f5f9;
}
.catpro-contact-row:hover { background: #f9fafb; }
.catpro-contact-row.is-dup { opacity: .55; cursor: default; }
.catpro-contact-row.is-dup:hover { background: transparent; }
.catpro-contact-row input[type="checkbox"] { margin: 0; }
.catpro-contact-info { flex: 1; min-width: 0; }
.catpro-contact-name { font-weight: 600; font-size: 13px; color: #1f2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catpro-contact-email { font-size: 11.5px; color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Landing: lista de catálogos guardados (Fase 4) */
.catpro-modal.catpro-landing .catpro-body { padding: 24px; }
.catpro-landing-bar { display: flex; gap: 12px; margin-bottom: 18px; align-items: center; }
.catpro-landing-search {
  flex: 1; border: 1px solid #e5e7eb; border-radius: 8px; padding: 10px 14px; font: inherit;
  background: #fff; color: #1f2937;
}
.catpro-landing-search:focus { outline: none; border-color: #f97316; box-shadow: 0 0 0 3px rgba(249,115,22,.15); }
.catpro-landing-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.catpro-empty { padding: 40px; text-align: center; color: #9ca3af; font-size: 13px; }
.catpro-landing-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid #e5e7eb; border-radius: 10px;
  background: #fff; cursor: pointer; text-align: left; font: inherit; color: inherit; transition: border-color .12s, background .12s;
}
.catpro-landing-card:hover { border-color: #f97316; background: #fff7ed; }
.catpro-landing-card-main { flex: 1; min-width: 0; }
.catpro-landing-card-name { font-weight: 700; font-size: 14px; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catpro-landing-card-sub { font-size: 11.5px; color: #6b7280; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catpro-landing-card-meta { font-size: 11px; color: #9ca3af; margin-top: 4px; }
.catpro-landing-card-arrow { color: #d1d5db; font-size: 16px; font-weight: 600; }
.catpro-landing-card:hover .catpro-landing-card-arrow { color: #f97316; }

/* Selector de modelo (Fase 1) */
.catpro-modelos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.catpro-modelo {
  display: flex; gap: 12px; padding: 14px; background: #fff; border: 2px solid #e5e7eb; border-radius: 10px;
  text-align: left; font: inherit; color: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s;
}
.catpro-modelo:hover { border-color: #cbd5e1; background: #f9fafb; }
.catpro-modelo.active { border-color: #f97316; background: #fff7ed; box-shadow: 0 0 0 3px rgba(249,115,22,.15); }
.catpro-modelo-icon { font-size: 28px; line-height: 1; flex-shrink: 0; }
.catpro-modelo-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.catpro-modelo-nombre { font-weight: 700; font-size: 14px; color: #1f2937; }
.catpro-modelo-desc { font-size: 11.5px; color: #6b7280; line-height: 1.4; }
.catpro-modelo:disabled { opacity: .55; cursor: not-allowed; }

/* Branding preview */
.catpro-brand-preview {
  margin-top: 16px; border-radius: 10px; overflow: hidden; border: 1px solid #e5e7eb;
  display: flex; flex-direction: column;
}
.catpro-brand-preview .top { padding: 16px; color: #fff; }
.catpro-brand-preview .bot { padding: 10px 14px; color: #fff; font-size: 12px; }
.catpro-brand-preview .top .ti { font-size: 11px; opacity: .85; letter-spacing: .08em; font-weight: 700; }
.catpro-brand-preview .top .nm { font-size: 18px; font-weight: 800; margin-top: 4px; }

/* Vista previa */
.catpro-preview {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px;
  height: 100%; display: flex; flex-direction: column;
}
.catpro-preview .toolbar { display: flex; gap: 8px; margin-bottom: 10px; }
.catpro-preview iframe { flex: 1; width: 100%; border: 1px solid #e5e7eb; border-radius: 8px; min-height: 60vh; background: #f3f4f6; }
.catpro-preview .empty { color: #9ca3af; text-align: center; padding: 40px; font-size: 13px; }

/* Enviar */
.catpro-send { max-width: 720px; background: #fff; border-radius: 10px; border: 1px solid #e5e7eb; padding: 24px; }
.catpro-send h2 { margin: 0 0 16px; font-size: 18px; }
.catpro-envios { margin-top: 22px; }
.catpro-envios table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.catpro-envios th, .catpro-envios td { padding: 8px 10px; border-bottom: 1px solid #f1f5f9; text-align: left; }
.catpro-envios th { color: #6b7280; font-weight: 700; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
.catpro-envios .ok { color: #047857; }
.catpro-envios .ko { color: #b91c1c; }
