:root {
  --bg: #0b0f17;
  --panel: #131926;
  --panel-2: #1a2234;
  --border: #263147;
  --text: #eef2ff;
  --muted: #94a3b8;
  --accent: #6366f1;
  --accent-2: #22d3ee;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at top left, #172038 0%, var(--bg) 55%);
  color: var(--text);
  min-height: 100vh;
}

.app-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #0b0f17;
}

.brand h1 {
  font-size: 1.1rem;
  font-weight: 700;
}

.subtitle {
  font-size: 0.82rem;
  color: var(--muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.voice-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.voice-picker select {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.85rem;
}

.status-badge {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel-2);
}

.status-badge.live {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--success);
  color: #6ee7b7;
}

.status-badge.error {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--danger);
  color: #fca5a5;
}

.banner.warning {
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: #fde68a;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.banner.warning a,
.banner.info a {
  color: #67e8f9;
}

.banner.info {
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.4);
  color: #cffafe;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.api-setup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.api-key-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.api-key-form input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  color: var(--text);
  font-size: 0.85rem;
  min-width: 220px;
}

.btn-sm {
  padding: 7px 13px;
  font-size: 0.82rem;
}

.hidden {
  display: none !important;
}

.main-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 16px;
  align-items: start;
}

@media (max-width: 960px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.voice-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.orb-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 12px;
  border-bottom: 1px solid var(--border);
}

.avatar-stage {
  position: relative;
  width: 100%;
  max-width: 390px;
  height: 255px;
  margin-bottom: 14px;
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #1e2a4a 0%, #0d1324 72%, #070a12 100%);
  border: 2px solid var(--border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.avatar-stage.speaking {
  border-color: var(--success);
  box-shadow: 0 0 28px rgba(16, 185, 129, 0.35);
}

.avatar-stage.listening {
  border-color: var(--accent-2);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.25);
}

.avatar-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  gap: 8px;
}

.placeholder-monogram {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b0f17;
  font-size: 1.8rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 0 28px rgba(99, 102, 241, 0.45);
}

.placeholder-title {
  font-weight: 700;
  font-size: 0.98rem;
}

.placeholder-sub {
  font-size: 0.78rem;
  color: var(--muted);
  max-width: 310px;
  line-height: 1.4;
}

.avatar-badge {
  position: absolute;
  bottom: 10px;
  left: 12px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(11, 15, 23, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--text);
  backdrop-filter: blur(6px);
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 480px;
  margin-top: 6px;
  line-height: 1.45;
}

.call-controls {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 11px 18px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.12s, opacity 0.15s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #4f46e5);
  color: white;
}

.btn-secondary {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.tip-headphones {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--muted);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.section-header h3 {
  font-size: 0.95rem;
}

.tool-pill {
  font-size: 0.75rem;
  background: rgba(34, 211, 238, 0.15);
  color: #67e8f9;
  border: 1px solid rgba(34, 211, 238, 0.4);
  padding: 3px 10px;
  border-radius: 999px;
}

.transcript-list {
  height: 290px;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  max-width: 86%;
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.msg.user {
  align-self: flex-end;
  background: rgba(99, 102, 241, 0.22);
  border: 1px solid rgba(99, 102, 241, 0.45);
}

.msg.agent {
  align-self: flex-start;
  background: var(--panel-2);
  border: 1px solid var(--border);
}

.msg .role-tag {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 3px;
  font-weight: 600;
}

.text-fallback {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.text-fallback input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.88rem;
}

.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
}

.tab.active {
  background: var(--panel-2);
  border-color: var(--border);
  color: var(--text);
}

.tab-content {
  display: none;
  max-height: 580px;
  overflow-y: auto;
}

.tab-content.active {
  display: block;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.catalog-filter {
  margin-bottom: 12px;
}

.catalog-filter input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 0.86rem;
}

.product-card, .order-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-card h4 {
  font-size: 0.95rem;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.price {
  font-size: 1.05rem;
  font-weight: 700;
  color: #6ee7b7;
}

.stock-tag {
  font-size: 0.75rem;
  color: var(--muted);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.chip {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.16);
  color: #c7d2fe;
}

.chip.magsafe {
  background: rgba(34, 211, 238, 0.16);
  color: #67e8f9;
}

.orders-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}

.order-total {
  color: #6ee7b7;
  font-size: 1rem;
}

.empty-state {
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
  padding: 28px 14px;
  line-height: 1.5;
}

/* --- Modo Vitrina / Kiosco para pantalla física en tienda --- */
body.kiosk-mode .app-shell {
  max-width: 100%;
  padding: 18px 24px;
  min-height: 100vh;
}

body.kiosk-mode .topbar-right .voice-picker,
body.kiosk-mode #previewVoiceBtn,
body.kiosk-mode #simliBtn,
body.kiosk-mode #changeKeyBtn,
body.kiosk-mode #apiWarning,
body.kiosk-mode #simliSetupBanner,
body.kiosk-mode .text-fallback {
  display: none !important;
}

body.kiosk-mode .main-grid {
  grid-template-columns: 1.25fr 1fr;
  gap: 22px;
}

body.kiosk-mode .avatar-stage {
  max-width: 100%;
  height: 440px;
  border-radius: 22px;
}

body.kiosk-mode .btn {
  padding: 15px 28px;
  font-size: 1.08rem;
  border-radius: 14px;
}

body.kiosk-mode .transcript-list {
  height: 200px;
}
