/* ============================================================
   Tornasol Noir -- editor de presentaciones (cliente + admin).
   Reestructurado (no solo reskin) segun el export de Google
   Stitch: seleccion de modo, seleccion de productos, editor de
   presentacion (slides + canvas + controles), descarga. Ingles
   por defecto (distinto de mockupsetup, que es solo espanol),
   con toggle a espanol. Sin build step, sin CDN.
   ============================================================ */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Material Symbols Outlined';
  font-style: normal;
  font-weight: 100 700;
  font-display: block;
  src: url('fonts/material-symbols-outlined.woff2') format('woff2');
}
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  font-size: 20px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
}

:root {
  --bg: #17111d;
  --surface: #201926;
  --surface-2: #2e2735;
  --surface-glass: rgba(36, 29, 42, 0.6);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ebdef1;
  --text-muted: rgba(230, 188, 191, 0.72);
  --accent: #ff2f72;
  --accent-hover: #ff588e;
  --accent-soft: rgba(230, 0, 77, 0.16);
  --accent-2: #7701d0;
  --tertiary: #00dce5;
  --success: #00dce5;
  --success-soft: rgba(0, 220, 229, 0.14);
  --danger: #ffb4ab;
  --danger-soft: rgba(147, 0, 10, 0.32);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
  --glow-accent: 0 0 24px rgba(230, 0, 77, 0.28);
  --gradient-primary: linear-gradient(135deg, #7701d0, #e6004d);
  --gradient-tornasol: linear-gradient(to right, #00dce5, #ffb2b8, #e6004d);
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

/* El atributo hidden lo aplica el navegador con `display: none`, pero
   CUALQUIER regla de autor que fije `display` le gana (misma trampa que
   rompio el modal del gotero, y despues dejo el boton "Guardar borrador"
   visible para clientes de Wix, que al tocarlo recibian un 403 "Solo para
   el equipo interno"). Clases afectadas hoy: .btn, .field, .icon-btn-plain,
   .pres-controls-section, .test-mode-controls, .modal-overlay. En vez de
   parchear cada una, esta regla global cubre tambien las que se agreguen
   despues -- por eso lleva !important, que aqui es correcto y no un atajo:
   la intencion de `hidden` siempre debe ganarle al display de una clase. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
}
body { position: relative; min-height: 100vh; overflow-x: hidden; }

body::before, body::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
  border-radius: 50%;
  filter: blur(110px);
}
body::before { top: -120px; right: -120px; width: 420px; height: 420px; background: rgba(230, 0, 77, 0.14); }
body::after { bottom: -140px; left: -80px; width: 380px; height: 380px; background: rgba(0, 220, 229, 0.08); }

.login-screen, .app-shell { position: relative; z-index: 1; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; font-size: 14px; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); margin: 0; }
a { text-decoration: none; }

.icon-btn-plain {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 6px;
  border-radius: 8px;
}
.icon-btn-plain:hover { color: var(--accent); background: rgba(255, 255, 255, 0.04); }

/* Base de .icon-btn -- editor no tenia ninguna, por eso caia al boton
   nativo del navegador (cuadrado blanco). Mismo estilo que ya usa
   mockupsetup para el mismo tipo de boton, un poco mas grande. */
.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.icon-btn .material-symbols-outlined { font-size: 18px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.btn-text-link {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 4px;
}
.btn-text-link:hover { color: var(--danger); }

/* ================= Login ================= */

.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-screen.hidden { display: none; }
.login-main { width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: center; gap: 24px; }

.login-card {
  width: 100%;
  background: var(--surface-glass);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 32px;
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, transparent 40%);
  pointer-events: none;
}
.login-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gradient-tornasol);
  opacity: 0.7;
}
.login-card .spectral-hit {
  position: absolute;
  top: -2px; left: -2px;
  width: 100px; height: 100px;
  background: radial-gradient(circle at top left, rgba(255,255,255,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.login-header { margin-bottom: 24px; }
.login-title { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; color: var(--accent); }
.login-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.field-icon .input-glow {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(46, 39, 53, 0.4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field-icon .input-glow:focus-within { border-color: var(--tertiary); box-shadow: 0 0 15px rgba(0, 220, 229, 0.2); }
.field-icon .input-glow .material-symbols-outlined { color: var(--text-muted); flex-shrink: 0; }
.field-icon input { flex: 1; min-width: 0; background: transparent; border: none; color: var(--text); padding: 0; }
.field-icon input:focus { outline: none; }

.field input, .field select {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}
.field input:focus, .field select:focus { outline: none; border-color: var(--tertiary); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 600;
  font-size: 13.5px;
  transition: transform 0.1s ease, background 0.15s ease, box-shadow 0.2s ease, border-color 0.15s ease;
}
.btn-block { width: 100%; }
.btn-gradient {
  background: var(--gradient-primary);
  color: #fffaf9;
  border-radius: 999px;
  padding: 13px 24px;
  box-shadow: var(--glow-accent);
}
.btn-gradient:hover { box-shadow: 0 0 32px rgba(230, 0, 77, 0.45); filter: brightness(1.06); }
.btn-gradient:active { transform: scale(0.97); }
.btn-gradient:disabled { opacity: 0.5; cursor: default; box-shadow: none; filter: none; }
/* Estado "todavia no listo" del boton de generar PDF: mismo pill que
   .btn-gradient pero sin relleno ni glow, para que iluminarse al completarse
   se lea como un cambio real. NO es un estado deshabilitado -- el boton sigue
   respondiendo al clic (abre el aviso de productos sin diseno), por eso no
   usa la opacidad reducida de .btn:disabled (GUIA_UI.md seccion 2).
   El padding compensa los 1.5px de borde para que el boton no cambie de alto
   al pasar de contorno a relleno. */
.btn-gradient-outline {
  background: transparent;
  color: var(--accent-hover);
  border: 1.5px solid var(--accent);
  border-radius: 999px;
  padding: 11.5px 24px;
}
.btn-gradient-outline:hover { background: var(--accent-soft); color: #fffaf9; }
.btn-gradient-outline:active { transform: scale(0.97); }
.btn-gradient-outline:disabled { opacity: 0.5; cursor: default; background: transparent; }

.btn-primary { background: var(--gradient-primary); color: #fffaf9; box-shadow: var(--glow-accent); }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1.5px solid var(--border-strong); }
.btn-secondary:hover { border-color: var(--tertiary); color: var(--tertiary); }
.btn:disabled { opacity: 0.5; cursor: default; }

.error-text { color: var(--danger); font-size: 12.5px; margin-top: 12px; min-height: 16px; text-align: center; }

/* ================= App shell ================= */

.app-shell { display: none; min-height: 100vh; flex-direction: column; }
.app-shell.visible { display: flex; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 32px;
  background: rgba(23, 17, 29, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.brand { font-size: 20px; font-weight: 700; color: var(--accent); letter-spacing: -0.01em; }

.lang-toggle { display: flex; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: 8px; }
.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.lang-btn.active { background: var(--accent); color: #fffaf9; }

.admin-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tertiary);
  background: var(--success-soft);
  padding: 5px 10px;
  border-radius: 999px;
}

.view { display: none; flex: 1; }
.view.active { display: flex; flex-direction: column; }
.main { max-width: 1100px; width: 100%; margin: 0 auto; padding: 32px; }

/* ---------- Pantalla 1: mode select ---------- */

.mode-select {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 24px;
  gap: 12px;
}
.mode-select h2 { font-size: 38px; font-weight: 700; letter-spacing: -0.02em; max-width: 640px; }
.mode-select > p { color: var(--text-muted); font-size: 15px; max-width: 480px; margin-bottom: 24px; }

.mode-cards { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }

.admin-drafts-section { margin-top: 32px; width: 100%; max-width: 640px; text-align: left; }
.admin-drafts-section h4 { font-size: 15px; font-weight: 600; color: var(--accent); margin-bottom: 2px; }

/* Cliente: tarjeta de su última presentación en el panel inicial */
.last-pres-section { margin-top: 32px; width: 100%; max-width: 640px; text-align: left; }
.last-pres-section h4 { font-size: 15px; font-weight: 600; color: var(--accent); margin-bottom: 2px; }
.last-pres-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 10px;
}
.last-pres-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.last-pres-info .material-symbols-outlined { color: var(--accent); font-size: 28px; }
.last-pres-meta { font-size: 12px; color: var(--text-muted); }
.last-pres-card .btn { flex-shrink: 0; }
.draft-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 10px;
}
.draft-row-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.draft-row-label { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.draft-row-date { font-size: 11px; color: var(--text-muted); }
.draft-row-actions { display: flex; align-items: stretch; gap: 8px; flex-shrink: 0; }
/* Estira al alto real del boton "Abrir" de al lado (que varia con el
   padding/line-height del .btn) en vez de adivinar un height fijo. */
.draft-row-actions .icon-btn {
  width: 36px;
  height: auto;
  /* Mismo fondo transparente que ya tenia -- solo se le agrega el
     contorno para que se lea como boton, pero mas discreto que "Abrir"
     (que trae fondo solido) para que ese siga siendo el que mas resalta. */
  border: 1.5px solid var(--border-strong);
}
.mode-card {
  width: 300px;
  background: var(--surface-glass);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  text-align: left;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mode-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 45%);
  pointer-events: none;
}
.mode-card-disabled { opacity: 0.85; }
.mode-badge {
  position: absolute;
  top: 18px; right: 18px;
  background: var(--gradient-primary);
  color: #fffaf9;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
}
.mode-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.mode-icon .material-symbols-outlined { font-size: 26px; color: var(--accent); }
.mode-icon-accent { background: radial-gradient(circle, rgba(119,1,208,0.4), rgba(0,220,229,0.15)); }
.mode-icon-accent .material-symbols-outlined { color: var(--tertiary); }
.mode-card h3 { font-size: 20px; font-weight: 600; }
.mode-card p { color: var(--text-muted); font-size: 13.5px; line-height: 1.5; margin-bottom: 16px; flex: 1; }

/* ---------- Pantalla 2: product select ---------- */

.products-hint {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  margin-bottom: 28px;
}
.products-hint > .material-symbols-outlined {
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.products-hint h3 { font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.products-hint p { color: var(--text-muted); font-size: 13.5px; line-height: 1.5; }
.products-hint strong { color: var(--tertiary); }

.products-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.products-toolbar h4 { font-size: 16px; font-weight: 600; white-space: nowrap; }
.catalog-search {
  flex: 1;
  max-width: 340px;
  margin-left: auto;
  padding: 9px 14px;
  color: var(--text);
  background: var(--surface-2);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
}
.catalog-search:focus { border-color: var(--tertiary); box-shadow: 0 0 15px rgba(0, 220, 229, 0.2); }
.catalog-search::placeholder { color: var(--text-muted); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; margin-bottom: 24px; }
.product-card {
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.product-card.is-selected { border-color: var(--tertiary); box-shadow: 0 0 0 1px var(--tertiary); }
.product-card.is-disabled { opacity: 0.55; }
.product-card:not(.is-disabled) { cursor: pointer; }
.product-card:not(.is-disabled):hover { transform: translateY(-2px); border-color: var(--border-strong); }

.product-card .thumb { position: relative; width: 100%; aspect-ratio: 1; background: var(--surface-2); overflow: hidden; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .thumb .placeholder { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--text-muted); }
.product-card .body { padding: 12px 14px; }
.product-card .name { font-family: var(--font-display); font-size: 13.5px; font-weight: 600; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-card .sku { font-size: 11.5px; color: var(--text-muted); }
.product-card .not-designable { font-size: 11px; color: var(--danger); margin-top: 6px; }

.badge {
  position: absolute;
  top: 10px; right: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 11px;
  border-radius: 20px;
  backdrop-filter: blur(8px);
}
.badge-ready { background: rgba(0, 220, 229, 0.85); color: #002021; }
.badge-pending { background: rgba(255, 255, 255, 0.15); color: #fff; }
.badge-selected { background: rgba(230, 0, 77, 0.9); color: #fffaf9; }

.products-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 8px; border-top: 1px solid var(--border); }
.products-summary { font-size: 13px; color: var(--text-muted); }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); grid-column: 1 / -1; }

/* ---------- Pantalla 3: presentation editor ---------- */

/* align-items:flex-start (no el stretch por default): asi cada columna
   solo ocupa su alto de contenido real, y la pagina completa hace scroll
   normal -- el canvas se queda "pegado" a la vista via position:sticky en
   .pres-canvas-col mientras el usuario recorre con scroll los controles de
   la derecha, que pueden ser mas largos. Mismo patron que ya usa
   mockupsetup en .editor-layout/.canvas-col (ver esa hoja de estilos). */
.presentation-layout { display: flex; flex: 1; align-items: flex-start; }

.slide-deck {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  padding: 16px;
  /* Pegada como el canvas (misma barra de controles larga a su lado) --
     mientras las slides quepan no se mueve; si hay tantas que no caben,
     hace scroll interno propio en vez de arrastrar toda la pagina. */
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
  overflow-y: auto;
}
.slide-deck-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.slide-deck-header h4 { font-size: 15px; font-weight: 600; color: var(--accent); }

.slide-item {
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.slide-item:hover { border-color: var(--border-strong); }
.slide-item.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.slide-item-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.slide-item-label { font-size: 11px; font-weight: 600; color: var(--text-muted); }
.slide-item.active .slide-item-label { color: var(--accent); }
.slide-drag { font-size: 15px; opacity: 0.4; }
.slide-item-thumb {
  aspect-ratio: 16/9;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slide-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.slide-thumb-placeholder { font-size: 10px; color: var(--text-muted); opacity: 0.5; text-transform: uppercase; letter-spacing: 0.05em; }

.pres-canvas-col {
  flex: 1;
  /* Pegado a la vista (debajo del topbar, que ya es sticky top:0) mientras
     se hace scroll de la pagina para recorrer el panel de controles. height
     fija (no max-height): asi el fondo oscuro siempre llena todo el alto
     disponible, sin importar el tamaño de la imagen del producto -- con
     max-height la caja se encogia al contenido y el fondo se "cortaba"
     antes de llegar abajo. */
  position: sticky;
  top: 70px;
  height: calc(100vh - 70px);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 24px;
}
.zoom-controls-float {
  position: absolute;
  top: 16px; left: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}
.zoom-controls-float .icon-btn {
  background: transparent; border: none; color: var(--text);
  width: 26px; height: 26px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.zoom-controls-float .icon-btn:hover { color: var(--accent); background: rgba(255,255,255,0.05); }
.zoom-sep { width: 1px; height: 16px; background: var(--border-strong); }
#presZoomLabel { font-size: 11px; color: var(--text-muted); min-width: 34px; text-align: center; }

.canvas-scroll { display: flex; align-items: center; justify-content: center; }
.canvas-wrap {
  background: repeating-conic-gradient(#241d2a 0% 25%, #17111d 0% 50%) 50% / 20px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  min-width: 320px;
  transform-origin: center;
  transition: transform 0.15s ease;
}
.canvas-wrap .empty-state { color: var(--text-muted); grid-column: unset; }

.simple-slide-canvas {
  width: 420px;
  aspect-ratio: 16/10;
  background: var(--surface-2);
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
  overflow: hidden;
}
.simple-slide-canvas img { width: 100%; height: 100%; object-fit: contain; }
.simple-slide-canvas .material-symbols-outlined { font-size: 30px; color: var(--accent); }

.pres-controls {
  width: 320px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  background: var(--surface-glass);
  backdrop-filter: blur(24px);
}
.pres-controls-scroll { padding: 20px; }
.pres-controls-section { margin-bottom: 28px; }
.pres-controls-section h4 {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--tertiary); margin-bottom: 16px;
}
.pres-controls-section h4 .material-symbols-outlined { font-size: 17px; }
.h4-icon-svg { width: 17px; height: 17px; fill: currentColor; flex-shrink: 0; }

.switch-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.switch-row label { font-size: 13px; color: var(--text); }
.pres-switch {
  appearance: none;
  width: 38px; height: 20px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease;
}
.pres-switch::after {
  content: "";
  position: absolute;
  top: 1px; left: 1px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}
.pres-switch:checked { background: var(--accent); border-color: var(--accent); }
.pres-switch:checked::after { transform: translateX(18px); }

.upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s ease;
  margin-bottom: 8px;
}
.upload-zone:hover { border-color: var(--accent); }
.upload-zone .material-symbols-outlined { font-size: 24px; color: var(--accent); }
.upload-zone span:not(.material-symbols-outlined) { font-size: 12.5px; color: var(--text-muted); }
.upload-help { font-size: 11px; color: var(--text-muted); opacity: 0.75; line-height: 1.5; margin-bottom: 18px; }

.slider-field { margin-bottom: 14px; }
.slider-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.slider-label span:last-child { color: var(--accent); font-weight: 600; }
.slider-field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  background: var(--surface-2);
  height: 4px;
  border-radius: 999px;
}

/* ---------- Colores de capas "Solo color" (ej. broche) ---------- */

.layer-color-row {
  padding: 12px;
  margin-bottom: 10px;
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.layer-color-row-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.layer-color-name { font-size: 13px; color: var(--text); }
.layer-color-hex-group { display: flex; align-items: center; gap: 6px; }
.layer-color-swatch {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: none;
  cursor: pointer;
}
.layer-color-hex {
  width: 76px;
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-family: monospace;
  text-transform: lowercase;
}
.layer-color-hex:focus { outline: none; border-color: var(--accent); }
.layer-color-palette { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.layer-color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  padding: 0;
  cursor: pointer;
}
.layer-color-dot:hover { border-color: var(--accent); }
.layer-color-eyedrop {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  padding: 0;
}
.layer-color-eyedrop:hover { border-color: var(--accent); color: var(--accent); }

.pres-controls-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-icon-svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- Modal del gotero (tomar color del diseño del cliente) ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  max-width: 90vw;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
/* Modal de confirmacion (aviso de productos sin diseno). Los botones van
   apilados con gap explicito -- .btn-block seguidos no traen margen entre si
   (GUIA_UI.md seccion 6). */
.modal-box-confirm {
  max-width: 440px;
  padding: 26px 24px 22px;
  text-align: center;
}
.modal-box-confirm h3 { font-size: 16px; margin: 0 0 8px; }
.modal-box-confirm p { font-size: 13px; color: var(--text-muted); margin: 0; line-height: 1.5; }
.confirm-icon {
  width: 40px;
  height: 40px;
  display: block;
  margin: 0 auto 12px;
  fill: var(--accent);
}
/* Variante para el modal de borrado: el mismo triangulo, en rojo y sobre un
   halo suave, para que el aviso se lea como destructivo desde el icono y no
   solo desde el texto. Con box-sizing: border-box global, el padding se come
   del ancho: 56 - 13*2 = 30px de glifo. */
.confirm-icon-danger {
  width: 56px;
  height: 56px;
  padding: 13px;
  fill: #ff6474;
  background: rgba(194, 18, 60, 0.16);
  border-radius: 999px;
}
.missing-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 10px 12px;
  max-height: 132px;
  overflow-y: auto;
  text-align: left;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-muted);
}
.missing-list:empty { display: none; }
.missing-list li { padding: 3px 0; }
.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.eyedropper-canvas {
  display: block;
  border-radius: var(--radius-sm);
  cursor: crosshair;
  background:
    repeating-conic-gradient(#241d2a 0% 25%, #17111d 0% 50%) 50% / 16px 16px;
  max-width: 100%;
}

/* ---------- Pantalla 4: download ---------- */

.view#view-download { align-items: center; justify-content: center; }
.download-card {
  max-width: 420px;
  width: 100%;
  margin: auto;
  background: var(--surface-glass);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 36px;
  text-align: center;
}
.download-ring {
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}
.download-ring .material-symbols-outlined { font-size: 42px; color: var(--tertiary); }
.download-card h2 { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.download-card p { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.download-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.download-actions .btn { flex: 1; min-width: 160px; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-strong);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  max-width: 360px;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #93000a; color: #ffdad6; border-color: transparent; }
.toast.success { background: #005357; color: #f0ffff; border-color: transparent; }

@media (max-width: 960px) {
  .presentation-layout { flex-direction: column; }
  .slide-deck, .pres-controls { width: 100%; border: none; border-bottom: 1px solid var(--border); }
}

/* ================= Pestanas de vista en el editor (Front / Back) ================= */
.pres-view-tabs {
  position: absolute;
  top: 104px; left: 16px;
  z-index: 20;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  max-width: calc(100% - 32px);
}
.pres-view-tab {
  padding: 7px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12.5px;
}
.pres-view-tab:hover { color: var(--text); border-color: var(--text-muted); }
.pres-view-tab.active { background: var(--surface-2); color: var(--text); border-color: var(--accent); }

.view-inherit-note {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 4px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}

/* ================= Pestanas de opcion (Option A / B, lado a lado en el PDF) ================= */
.pres-option-tabs {
  position: absolute;
  top: 60px; left: 16px;
  z-index: 20;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  max-width: calc(100% - 32px);
}
.pres-option-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1.5px solid var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
}
.pres-option-tab:hover { color: var(--text); border-color: var(--text-muted); }
.pres-option-tab.active { background: var(--accent-soft); color: var(--text); border-color: var(--accent); }
.pres-option-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  color: var(--text-muted);
}
.pres-option-remove:hover { color: var(--danger); background: var(--danger-soft); }
.pres-option-add {
  padding: 6px 14px;
  border-radius: 8px;
  border: 1.5px dashed var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
}
.pres-option-add:hover { color: var(--accent); border-color: var(--accent); }

/* ================= Pantalla del logo del cliente ================= */
.logo-step {
  max-width: 560px;
  margin: 0 auto;
  padding: 56px 24px;
  text-align: center;
}
.logo-step h2 { font-size: 26px; margin-bottom: 10px; }
.logo-step-sub { color: var(--text-muted); font-size: 13.5px; line-height: 1.55; margin: 0 0 28px; }

.logo-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 24px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
}
.logo-drop:hover { border-color: var(--accent); }
.logo-drop-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13.5px;
}
.logo-drop-empty .material-symbols-outlined { font-size: 32px; color: var(--accent); }
.logo-drop-help { font-size: 11.5px; opacity: 0.75; }
/* El logo suele ser claro: sobre el fondo oscuro del editor se veria casi
   invisible, asi que la vista previa va sobre blanco -- que ademas es como
   se vera impreso en la presentacion. */
.logo-drop-preview {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 14px;
}

.logo-step-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}
.logo-step-skip { font-size: 11.5px; color: var(--text-muted); margin: 14px 0 0; }

/* ================= Fast Mode — pantallas ================= */
.fast-step {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 16px 48px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.fast-step-header { margin-bottom: 24px; text-align: center; }
.fast-step-header h2 { font-size: 26px; margin-bottom: 8px; }
.fast-step-sub { color: var(--text-muted); font-size: 13.5px; line-height: 1.55; margin: 0 0 16px; }
.fast-logo-drop { margin-bottom: 14px; }

/* Aviso de formato de logo */
.fast-logo-status {
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.fast-logo-status .status-ico { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.fast-logo-status.status-ok    { background: rgba(0,210,100,0.12); color: #3ddc84; border: 1px solid rgba(0,210,100,0.25); }
/* Aviso amable (fondo sólido en el logo): NO es un error. Caja neutra y texto
   claro, con la "i" en amarillo — informa sin alarmar. */
.fast-logo-status.status-warn  { background: rgba(255,255,255,0.05); color: var(--text); border: 1px solid rgba(255,255,255,0.14); }
.fast-logo-status.status-warn .status-ico { color: #f0b429; }
.fast-logo-status.status-block { background: rgba(220,60,60,0.12);  color: #e06060; border: 1px solid rgba(220,60,60,0.25); }

/* Undo/Redo del Paso 2: caracteres ↶ ↷ (como los botones junto al zoom del
   lienzo), porque el subset de íconos no trae los glifos undo/redo. Con borde
   completo para que se distingan como botones. */
.fast-history-btn {
  font-size: 17px;
  line-height: 1;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.fast-history-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: var(--surface-2); }
.fast-history-btn:disabled { border-color: var(--border); }

/* Versiones adicionales */
.fast-logo-extras { margin-bottom: 24px; }
.fast-extras-header { margin-bottom: 14px; }
.fast-extras-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.fast-optional-tag {
  font-size: 11px;
  font-weight: 500;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.fast-versions-grid { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.fast-version-slot {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 10px;
  align-items: center;
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
}
.fast-version-thumb {
  width: 64px;
  height: 44px;
  border-radius: 5px;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  border: 1px dashed var(--border);
}
.fast-version-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.fast-version-thumb .material-symbols-outlined { font-size: 20px; color: var(--text-muted); }
.fast-version-thumb input { display: none; }
.fast-version-label select {
  width: 100%;
  background: var(--input-bg, rgba(255,255,255,0.06));
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 6px 10px;
  font-size: 13px;
}
.fast-version-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}
.fast-version-remove:hover { color: #e06060; }
.fast-add-version-btn { align-self: flex-start; }

.fast-step-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* ---- Modo Rápido como ventana/popup: card centrada sobre fondo atenuado ----
 * Da la sensación de "pocos pasos, rápido". Cada paso es una ventana con su
 * indicador de progreso (barra 1–5 + "Paso X de N"). */
#view-fast-logo, #view-fast-colors, #view-fast-season,
#view-fast-style, #view-fast-result, #view-fast-pdf {
  align-items: center;
  justify-content: center;
  justify-content: safe center;   /* evita recortar el tope en pasos altos */
  overflow-y: auto;
  padding: 28px 16px;
  background: radial-gradient(1100px 560px at 50% -8%, var(--accent-soft), transparent 60%);
}
#view-fast-download { align-items: center; justify-content: center; }

.fast-modal-step {
  width: 100%;
  max-width: 560px;
  background: var(--surface-glass);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
  padding: 26px 28px 30px;
  margin: 0 auto;
}

/* Indicador de pasos */
.fast-stepper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  margin-bottom: 20px;
}
.fast-stepper-bar { display: flex; gap: 6px; width: 100%; max-width: 320px; }
.fast-stepper-seg {
  flex: 1;
  height: 5px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background .25s;
}
.fast-stepper-seg.is-done { background: var(--accent); }
.fast-stepper-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

/* Paso 2: colores y fondo */
.fast-colors-section { margin-bottom: 28px; }
.fast-section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.fast-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.fast-detected-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.12);
  cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.fast-detected-swatch:hover { transform: scale(1.15); border-color: rgba(255,255,255,0.5); }
.fast-detected-swatch.selected { border-color: #fff; transform: scale(1.1); }
.fast-colors-hint { font-size: 12px; color: var(--text-muted); margin: 4px 0 0; }

.fast-brand-palette {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 12px;
}
.fast-palette-slot { display: flex; flex-direction: column; gap: 4px; }
.fast-palette-label { font-size: 12px; color: var(--text-muted); }
.fast-palette-row { display: flex; align-items: center; gap: 10px; }
.fast-palette-add-slot { display: flex; align-items: flex-end; }
.fast-extra-palette-inline { display: contents; }
.fast-palette-swatch-wrap { cursor: pointer; flex-shrink: 0; }
.fast-color-input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}
.fast-palette-swatch {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.15);
  transition: border-color .15s, transform .15s;
}
.fast-palette-swatch:hover { border-color: rgba(255,255,255,0.5); transform: scale(1.08); }

/* HEX input junto al swatch */
.fast-hex-input {
  background: var(--input-bg, rgba(255,255,255,0.06));
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-family: monospace;
  padding: 6px 10px;
  width: 96px;
  text-transform: uppercase;
}
.fast-hex-input:focus { outline: none; border-color: var(--accent); }
.fast-hex-input.invalid { border-color: #e06060; }
/* Botón "Agregar color" — mismo lenguaje punteado que el "+" del fondo, con texto */
.fast-palette-add-slot { align-self: flex-end; }
.fast-palette-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  border: 2px dashed rgba(255,255,255,0.22);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: border-color .15s, color .15s, transform .15s;
}
.fast-palette-add-btn:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.03); }
.fast-palette-add-btn .material-symbols-outlined { font-size: 20px; }

/* X de quitar sobre el swatch (idéntica a la del fondo), aparece al hover */
.fast-palette-swatch-box { position: relative; flex-shrink: 0; }
.fast-swatch-remove {
  position: absolute; top: 2px; right: 2px;
  background: rgba(0,0,0,0.55); border: none; cursor: pointer;
  color: #fff; border-radius: 50%;
  width: 16px; height: 16px;
  display: none; align-items: center; justify-content: center; padding: 0;
  z-index: 2;
}
.fast-swatch-remove .material-symbols-outlined { font-size: 11px; }
.fast-palette-swatch-box:hover .fast-swatch-remove { display: flex; }

/* Mini-panel "Elige el color" que se despliega al dar clic en Agregar color */
.fast-add-color-panel {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
}
.fast-add-color-panel .fast-section-label { margin-bottom: 10px; }
.fast-add-color-panel .fast-palette-row { flex-wrap: wrap; }
.fast-add-confirm-btn { height: 40px; }
.fast-add-cancel-btn {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 13px; padding: 6px 10px;
}
.fast-add-cancel-btn:hover { color: var(--text); }
.fast-add-color-err { color: #e06060 !important; font-style: normal; }

/* Header del Paso 2 con toolbar de historial (undo / redo) */
.fast-colors-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.fast-colors-header-text { flex: 1; min-width: 0; }
.fast-history-toolbar { display: flex; gap: 6px; flex-shrink: 0; }
.fast-history-btn:disabled { opacity: 0.35; cursor: default; }
.fast-history-btn:disabled:hover { background: none; color: var(--text-muted); }

/* Slot extra con botón de quitar */
.fast-extra-slot { display: flex; align-items: flex-end; gap: 8px; }
.fast-extra-remove {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 6px; border-radius: 4px;
  display: flex; align-items: center;
}
.fast-extra-remove:hover { color: #e06060; }

/* Opciones de fondo sugeridas */
/* Fondo del producto: mismos slots que la paleta de marca. El fondo activo
   lleva un anillo de acento en el swatch + un check arriba a la izquierda. */
.fast-bg-slot .fast-bg-check {
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(0,0,0,0.55);
  display: none; align-items: center; justify-content: center;
  z-index: 2; pointer-events: none;
}
.fast-bg-slot.is-selected .fast-bg-check { display: flex; }
.fast-bg-slot .fast-bg-check .material-symbols-outlined { font-size: 11px; color: #fff; }
.fast-bg-slot.is-selected .fast-palette-swatch {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

/* Aviso cuando no quedan colores en una sección */
.fast-empty-msg {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  margin: 4px 0 0;
}

/* ================= Fast Mode Paso 3: Estilo ================= */

.fast-style-section { margin-bottom: 28px; }

/* ---- Paso 3: pregunta de temporada (óvalos multi + tira temática) ---- */
.fast-season-block {
  margin-bottom: 28px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-glass);
}
.fast-season-q { margin-bottom: 12px; }
.fast-season-none { margin-bottom: 12px; }
.fast-season-none.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
  color: var(--text);
}
.fast-season-ovals { display: flex; flex-wrap: wrap; gap: 8px; }
.fast-season-oval {
  padding: 7px 16px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s, color .15s, box-shadow .15s;
}
.fast-season-oval:hover { border-color: var(--border-strong); }
.fast-season-oval.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
  color: var(--text);
}
.fast-season-themed { margin-top: 16px; }
.fast-season-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
/* Fondo claro fijo: los assets se exportan en negro sólido, así se ven en
   cualquier tema sin invertir (invertir los volvería invisibles en tema claro). */
.fast-season-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.fast-season-thumb img { width: 72%; height: 72%; object-fit: contain; }
.fast-season-empty { margin-top: 8px; font-size: 12px; color: var(--text-muted); opacity: 0.85; }

/* Rejilla de variaciones (preview multi-select) */
.fast-style-multi-hint {
  font-size: 12.5px;
  color: var(--tertiary, var(--accent));
  margin: 8px 0 0;
}
.fast-style-live-wrap {
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fast-style-variations {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}
.fast-style-variation-canvas {
  width: 100%;
  aspect-ratio: 16 / 11;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  display: block;
}
.fast-style-live-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.fast-style-live-hint {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}

/* Resultado: compuesto sobre producto real */
.fast-result-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  min-height: 200px;
  justify-content: center;
}
.fast-result-canvas {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.fast-result-status {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* Playground de la muestra */
.fast-result-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}
.fast-ctl-group { display: flex; flex-direction: column; gap: 8px; }
.fast-ctl-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.fast-ctl-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.fast-ctl-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.fast-ctl-chip:hover { border-color: rgba(255,255,255,0.35); color: var(--text); }
.fast-ctl-chip.is-active {
  border-color: var(--accent);
  color: #fff;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
}
.fast-ctl-swatch {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  padding: 0;
  transition: transform .1s, border-color .15s;
}
.fast-ctl-swatch:hover { transform: scale(1.1); }
.fast-ctl-swatch.is-active { border-color: #fff; box-shadow: 0 0 0 2px var(--accent); }
.fast-ctl-sep { width: 1px; align-self: stretch; background: var(--border); margin: 0 4px; }
.fast-ctl-slider { width: 100%; max-width: 320px; accent-color: var(--accent); }

/* Fila de tarjetas */
.fast-style-cards {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 0;
}

.fast-style-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  background: var(--surface-glass);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 8px 10px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.fast-style-card:hover { border-color: rgba(255,255,255,0.3); }
.fast-style-card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}

/* Miniaturas de tarjeta */
.fast-style-thumb {
  width: 64px;
  height: 44px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--surface-2);
  position: relative;
  display: block;
}
/* None: damero neutro */
.fast-style-thumb--checker {
  background:
    repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%)
    0 0 / 10px 10px;
}
/* Líneas diagonales */
.fast-style-thumb--geo {
  background: var(--surface-2);
}
.fast-style-thumb--geo::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent, transparent 6px,
    rgba(255,255,255,0.15) 6px, rgba(255,255,255,0.15) 7px
  );
}
/* Puntos */
.fast-style-thumb--dots {
  background: var(--surface-2);
}
.fast-style-thumb--dots::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,0.25) 1.5px, transparent 1.5px);
  background-size: 10px 10px;
}
/* Cuadrícula */
.fast-style-thumb--grid { background: var(--surface-2); }
.fast-style-thumb--grid::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.16) 1px, transparent 1px);
  background-size: 9px 9px;
}
/* Ondas */
.fast-style-thumb--waves { background: var(--surface-2); }
.fast-style-thumb--waves::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-radial-gradient(
    circle at 50% -60%,
    transparent 0, transparent 6px,
    rgba(255,255,255,0.14) 6px, rgba(255,255,255,0.14) 7px
  );
}
/* Confeti */
.fast-style-thumb--confetti { background: var(--surface-2); }
.fast-style-thumb--confetti::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(255,120,180,0.55) 2px, transparent 2px),
    radial-gradient(circle, rgba(120,200,255,0.55) 2px, transparent 2px),
    radial-gradient(circle, rgba(255,220,120,0.55) 2px, transparent 2px);
  background-size: 18px 18px, 18px 18px, 18px 18px;
  background-position: 2px 3px, 10px 11px, 6px 15px;
}

.fast-style-card-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}
.fast-style-card.is-selected .fast-style-card-label { color: var(--text); }

/* Subsecciones dentro de la sección Logo (presencia, posición, fondo) */
.fast-style-subsection { margin-top: 16px; }
.fast-style-subsection:first-of-type { margin-top: 10px; }
.fast-section-sublabel {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Tarjetas de tamaño de patrón */
.fast-style-size-row { margin-top: 14px; }
.fast-style-size-card { min-width: 58px; }
.fast-style-size-icon {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
  width: 64px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fast-style-size-card.is-selected .fast-style-size-icon { color: var(--accent); }

/* Slider de presencia del logo */
.fast-style-presence-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.fast-style-presence-slider {
  flex: 1;
  accent-color: var(--accent);
  height: 4px;
  border-radius: 999px;
  background: var(--surface-2);
}
.fast-style-presence-hint {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.fast-style-presence-label {
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  margin: 0;
  min-height: 16px;
}

/* ================= Pantalla de generacion del PDF ================= */
.gen-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(12, 8, 16, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.gen-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 34px 28px 26px;
  text-align: center;
}
.gen-card h3 { font-size: 17px; margin-bottom: 8px; }

/* Anillo giratorio en CSS: no hace falta ningun icono ni imagen (y nada de
   emojis, GUIA_UI.md seccion 1). */
.gen-spinner {
  width: 46px;
  height: 46px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 3px solid var(--surface-2);
  border-top-color: var(--accent);
  animation: gen-spin 0.85s linear infinite;
}
@keyframes gen-spin { to { transform: rotate(360deg); } }

.gen-step { font-size: 13px; color: var(--text-muted); margin: 0 0 16px; min-height: 19px; }
.gen-bar {
  height: 5px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}
.gen-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--gradient-primary);
  transition: width 0.35s ease;
}
.gen-hint { font-size: 11px; color: var(--text-muted); opacity: 0.75; margin: 14px 0 0; }

/* ================= Reordenar slides ================= */
.slide-move { display: flex; gap: 2px; flex-shrink: 0; }
.slide-move-btn {
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 5px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slide-move-btn svg { width: 14px; height: 14px; fill: var(--text-muted); }
.slide-move-btn:hover { background: var(--surface-2); }
.slide-move-btn:hover svg { fill: var(--accent); }

/* Texto de apoyo dentro de una seccion del panel de controles. */
.section-help {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 12px;
}

/* Nombre del borrador dentro del modal de confirmacion de borrado. */
.del-draft-name {
  font-weight: 600;
  color: var(--text) !important;
  margin-bottom: 6px !important;
}
/* Accion destructiva: se distingue del primario normal para que no se
   confirme por inercia.

   Roja de verdad, no un rojo apagado. La version anterior pintaba
   --danger-soft (rgba(147,0,10,.32)) sobre el morado del fondo, y esa mezcla
   se leia MARRON, no roja: el color perdia lo unico que tenia que comunicar.
   El degradado va de carmin a coral para que se distinga tanto del fondo
   como del primario de marca (--gradient-primary, morado -> magenta). */
.btn-danger {
  background: linear-gradient(135deg, #c2123c, #ff4d5e);
  color: #fff4f4;
  border: none;
  box-shadow: 0 6px 20px rgba(194, 18, 60, 0.34);
}
.btn-danger:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow: 0 8px 26px rgba(194, 18, 60, 0.48);
}
.btn-danger:active:not(:disabled) { transform: scale(0.985); }

/* Armado: mientras corre la cuenta regresiva el boton es gris neutro, SIN
   rastro de rojo -- un rojo traslucido se leeria como "boton roto" en vez de
   "todavia no". Pisa a proposito el opacity de .btn:disabled (esta despues
   en el archivo, misma especificidad): aqui el gris ya comunica el estado,
   y bajarle ademas la opacidad dejaba el numero de la cuenta ilegible. */
.btn-danger:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
  box-shadow: none;
  opacity: 1;
  cursor: default;
}

/* Numero de la cuenta regresiva, dentro del propio boton. */
.btn-countdown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  font-size: 12px;
  font-weight: 700;
  /* Tabulares: sin esto el boton se movia un pixel al pasar de 3 a 2 a 1. */
  font-variant-numeric: tabular-nums;
}

/* Barra que se llena durante el armado. La duracion la inyecta el JS en
   --arm-duration para que no haya dos fuentes de verdad del "3". */
.btn-arming { position: relative; overflow: hidden; }
.btn-arming::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, #c2123c, #ff4d5e);
  transform: scaleX(0);
  transform-origin: left;
  animation: btn-arm var(--arm-duration, 3s) linear forwards;
}
@keyframes btn-arm { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .btn-arming::after { animation: none; }
}

/* ---- Paso 5 del Modo Rápido: campos del PDF + selección de productos (admin) ---- */
.fast-pdf-fields,
.fast-pick-products {
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
}
.fast-pdf-fields .fast-section-label,
.fast-pick-products .fast-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}
.fast-pdf-fields .fast-section-label .material-symbols-outlined {
  font-size: 18px;
  color: var(--accent);
}
.fast-pdf-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 2px;
  font-size: 14px;
  cursor: pointer;
}
.fast-pdf-row + .fast-pdf-row { border-top: 1px solid var(--border); }
.fast-pick-products .catalog-search { width: 100%; margin-bottom: 10px; }
.fast-pick-list {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.fast-pick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  font-size: 13.5px;
  cursor: pointer;
}
.fast-pick-row + .fast-pick-row { border-top: 1px solid var(--border); }
.fast-pick-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fast-pick-sku { color: var(--text-muted); font-size: 12px; white-space: nowrap; }

/* ---- Ventana fusionada "Estilo y muestra": pie de la muestra ---- */
.fast-sample-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.fast-sample-note { font-size: 12px; color: var(--text-muted); }
.fast-shapes-row { flex-wrap: wrap; }
