/* Modo comerciante */

.top-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
.mode-btn {
  height: 40px; padding: 0 16px; border-radius: var(--radius-pill); border: 1px solid rgb(245 242 236 / 0.3);
  background: rgb(17 17 17 / 0.55); backdrop-filter: blur(10px); font-weight: 500; font-size: 0.86rem;
  transition: background var(--duration-fast), border-color var(--duration-fast);
}
.mode-btn:hover { border-color: var(--accent); }
.mode-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--night-900); }
.cart-btn { justify-self: auto; }

.is-admin .intro, .is-admin .assistant-btn, .is-admin .hint, .is-admin #cart-btn { opacity: 0 !important; pointer-events: none !important; }
.is-admin .stage { cursor: default; }

/* Zonas visibles con su nombre */
.hotspot-tag { display: none; }
.hotspots.is-admin .hotspot {
  background: rgb(255 90 54 / 0.14); box-shadow: 0 0 0 2px var(--accent); border-radius: 2px;
}
.hotspots.is-admin .hotspot:hover { background: rgb(255 90 54 / 0.3); }
.hotspots.is-admin .hotspot-tag {
  display: block; position: absolute; left: -2px; bottom: calc(100% + 4px); max-width: 160px; padding: 2px 7px;
  border-radius: 4px; background: var(--accent); color: var(--night-900); font-size: 0.7rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}

.draw-layer { position: absolute; inset: 0; cursor: crosshair; touch-action: none; }
.draft { position: absolute; border: 2px dashed var(--accent); background: rgb(255 90 54 / 0.15); border-radius: 2px; }

/* Panel lateral */
.admin {
  position: absolute; left: var(--edge); top: calc(var(--edge) * 3.6); bottom: var(--edge); width: min(360px, calc(100% - 2 * var(--edge)));
  display: flex; flex-direction: column; border-radius: var(--radius-panel); background: var(--paper); color: var(--ink);
  box-shadow: var(--shadow-panel); overflow: hidden; animation: slide-left 420ms var(--ease-out-expo);
}
@keyframes slide-left { from { opacity: 0; transform: translateX(-24px); } }
.admin-body { flex: 1; overflow: auto; padding: 6px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.admin-section { padding: 14px 0; border-bottom: 1px solid rgb(20 20 20 / 0.08); }
.admin-section h3 { margin: 0 0 10px; font: 400 1.35rem var(--font-display); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.scene-pill { font: 600 0.72rem var(--font-ui); padding: 3px 9px; border-radius: var(--radius-pill); background: var(--night-700); color: var(--paper); }
.steps { margin: 0 0 12px; padding-left: 18px; font-size: 0.84rem; color: var(--ink-soft); display: grid; gap: 3px; }
.wide { width: 100%; }
.admin .btn-primary { background: var(--night-700); color: var(--paper); }
.admin .btn-primary:hover { background: var(--night-900); }
.admin.drawing .btn-primary[data-draw] { background: var(--accent); color: var(--night-900); }
.draw-hint { display: none; margin: 8px 0 0; font-size: 0.84rem; color: var(--accent-ink); font-weight: 600; }
.admin.drawing .draw-hint { display: block; }
.zones, .scenes { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.zones .empty { font-size: 0.84rem; color: var(--ink-soft); }
.zone-row { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; background: #fff; }
.zone-row img { width: 32px; height: 46px; object-fit: cover; border-radius: 2px; box-shadow: 0 1px 3px rgb(0 0 0 / 0.25); }
.zone-row div { flex: 1; display: grid; min-width: 0; }
.zone-row strong { font: 400 1rem/1.1 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zone-row span { font-size: 0.74rem; color: var(--ink-soft); }
.mini { border: 1px solid rgb(20 20 20 / 0.15); background: transparent; border-radius: var(--radius-pill); padding: 4px 9px; font-size: 0.72rem; font-weight: 600; }
.mini:hover { border-color: var(--ink); }
.mini.danger { color: var(--out); }
.scenes { grid-template-columns: 1fr 1fr; }
.scene-chip {
  width: 100%; text-align: left; padding: 8px 10px; border-radius: 10px; border: 1px solid rgb(20 20 20 / 0.1); background: #fff;
  display: grid; gap: 1px; font-size: 0.82rem; font-weight: 500;
}
.scene-chip small { color: var(--ink-soft); font-size: 0.7rem; }
.scene-chip:hover { border-color: var(--ink); }
.scene-chip.current { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.admin-section .btn-ghost { margin-top: 10px; }
.admin-foot { padding-top: 12px; font-size: 0.74rem; color: var(--ink-soft); }
.admin-foot p { margin: 0 0 8px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent-ink); font-weight: 600; text-decoration: underline; font-size: 0.78rem; }

.zone-popover {
  position: absolute; z-index: 5; display: grid; gap: 4px; width: 210px; padding: 10px; border-radius: 12px;
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow-panel);
}
.zone-popover strong { font: 400 1.05rem/1.15 var(--font-display); padding: 2px 4px 6px; }
.zone-popover button { text-align: left; border: 0; background: transparent; padding: 7px 8px; border-radius: 8px; font-size: 0.86rem; }
.zone-popover button:hover { background: rgb(20 20 20 / 0.06); }
.zone-popover .danger { color: var(--out); }

/* Formularios */
.modal {
  width: min(640px, calc(100% - 24px)); max-height: calc(100% - 24px); padding: 0; border: 0; border-radius: var(--radius-panel);
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow-panel);
}
.modal::backdrop { background: rgb(0 0 0 / 0.5); backdrop-filter: blur(3px); }
.modal[open] { animation: rise 380ms var(--ease-out-expo); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 10px; }
.modal-head h2 { margin: 0; font: 400 1.7rem/1.05 var(--font-display); }
.seg { display: flex; gap: 4px; margin: 4px 20px 0; padding: 4px; border-radius: var(--radius-pill); background: rgb(20 20 20 / 0.06); }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 12px; border-radius: var(--radius-pill); font-weight: 500; font-size: 0.86rem; }
.seg button[aria-selected="true"] { background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
.pane { padding: 16px 20px 4px; display: grid; gap: 12px; }
.new-grid { grid-template-columns: 170px 1fr; align-items: start; }
.new-grid[hidden] { display: none; }
.cover-field { display: grid; gap: 8px; }
.cover-field img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; box-shadow: 0 6px 18px -6px rgb(0 0 0 / 0.4); }
.photo-preview { width: 100%; max-height: 220px; object-fit: cover; border-radius: 8px; }
.file-btn {
  position: relative; display: grid; place-items: center; min-height: 44px; padding: 10px; border-radius: 10px; text-align: center;
  border: 1.5px dashed rgb(20 20 20 / 0.3); font-size: 0.84rem; font-weight: 600; cursor: pointer; background: #fff;
}
.file-btn:hover { border-color: var(--accent); }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.field-note { margin: 0; font-size: 0.74rem; color: var(--ink-soft); }
.fields { display: grid; gap: 10px; }
.field { display: grid; gap: 4px; font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); }
.field input, .field select, .field textarea {
  font: inherit; font-size: 0.92rem; font-weight: 400; color: var(--ink); padding: 9px 11px; border-radius: 9px;
  border: 1px solid rgb(20 20 20 / 0.18); background: #fff; resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgb(255 90 54 / 0.18); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-errors { margin: 8px 20px 0; min-height: 1.2em; font-size: 0.84rem; color: var(--out); font-weight: 500; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px 20px; }
.modal .btn-primary { background: var(--night-700); color: var(--paper); }

/* Miniaturas del asistente con la foto del producto */
img.thumb { width: 46px; height: 68px; object-fit: cover; }

@media (max-width: 700px) {
  .mode-btn { height: 36px; padding: 0 12px; font-size: 0.78rem; }
  .admin { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 52%; border-radius: var(--radius-panel) var(--radius-panel) 0 0; }
  .new-grid { grid-template-columns: 1fr; }
  .cover-field img { max-width: 140px; }
}

.panel-link { display: block; text-align: center; text-decoration: none; margin: 4px 0 12px; }
