:root {
  --primary: #ff5100;
  --brand-orange: #ff5100;
  --brand-orange-light: #ff6a2c;
  --brand-purple: #6a2c9f;
  --brand-purple-light: #8b4cbf;
  --bg: #f8fafc;
  --card-bg: #ffffff87;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --accent: #16a34a;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }

html, body {
  background-color: var(--bg);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100svh; /* evita que la barra de navegación del móvil tape contenido */
  overflow-x: hidden;
  overflow-y: auto; /* red de seguridad: si algo no cabe, se puede bajar con scroll */
}

body {
  background-image: url('../Img/Fondo_mail.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

.presentation-container {
  min-height: 100vh;
  min-height: 100svh;
  width: 100vw;
  display: flex;
  justify-content: center;
  align-items: center;
  align-items: safe center; /* si el contenido no cabe, se ancla arriba en vez de recortarse */
  padding: 20px;
}

.brand-logo-fixed {
  position: fixed;
  top: 18px;
  left: 20px;
  height: 34px;
  width: auto;
  z-index: 50;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
}

.welcome-logo {
  display: block;
  height: auto;
  width: auto;
  margin-top: 40px;
  margin-bottom: 18px;
}

.station-section {
  display: none;
  width: min(92vw, 1000px);
  min-height: min(88vh, 680px);
  min-height: min(88svh, 680px);
}

.station-section.active {
  display: flex;
  flex-direction: column;
}

.station-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 30px 35px;
  width: 100%;
  flex: 1;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: visible;
}

.card-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.badge {
  display: inline-block;
  background: #fff3e0;
  color: var(--primary);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-muted {
  background: #f1f5f9;
  color: var(--text-muted);
}

.btn-back {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.btn-back:hover { background: #f1f5f9; color: var(--text-main); }

h1 { font-size: clamp(1.35rem, 3.2vw, 2rem); font-weight: 800; color: var(--text-main); margin-bottom: 8px; }
h2 { font-size: clamp(1.1rem, 2.4vw, 1.45rem); font-weight: 800; color: var(--text-main); margin-bottom: 6px; }
p { color: var(--text-muted); font-size: clamp(0.82rem, 1.6vw, 0.95rem); }

.progress-bar-container {
  width: 100%;
  background-color: #e2e8f0;
  border-radius: 8px;
  height: 6px;
  margin: 10px 0 15px 0;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background-color: var(--primary);
  width: 0%;
  transition: width 0.3s ease;
}

.business-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 15px;
  margin: 20px 0;
  flex: 1;
  min-height: 0;
}

.biz-option {
  background: #f8fafc;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 4px;
}

.biz-option:hover, .biz-option.selected {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transform: translateY(-2px);
}

.biz-option h3 { font-size: clamp(1rem, 2vw, 1.15rem); font-weight: 700; margin-bottom: 2px; }
.biz-option p { font-size: clamp(0.78rem, 1.4vw, 0.88rem); }

.diag-framing {
  margin-bottom: 6px;
}

.diag-framing p {
  color: var(--text-main);
  font-size: clamp(0.8rem, 1.7vw, 0.92rem);
  margin-bottom: 4px;
}

.diag-question {
  font-weight: 700;
  color: var(--text-main);
  font-size: clamp(0.88rem, 1.9vw, 1.02rem);
  margin: 10px 0 4px 0;
}

.diag-subnote {
  font-size: clamp(0.72rem, 1.5vw, 0.82rem);
  color: var(--text-muted);
  margin-bottom: 6px;
}

.diagnostic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-content: start;
  gap: 10px;
  margin: 12px 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 5px;
}

.diag-chip {
  background: #f8fafc;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.diag-chip:hover { border-color: #cbd5e1; background: #f1f5f9; }

.diag-chip.selected {
  background: #f0fdf4;
  border-color: var(--accent);
  color: #14532d;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.15);
}

.diag-chip .check-icon {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.diag-chip.selected .check-icon { opacity: 1; }

.transition-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 10px 30px;
  overflow-y: auto;
}

.transition-body::-webkit-scrollbar { width: 5px; }
.transition-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.transition-body p {
  max-width: 560px;
  margin: 0 auto 6px auto;
}

.transition-checklist {
  list-style: none;
  margin: 22px auto 26px auto;
  max-width: 480px;
  text-align: left;
  width: 100%;
}

.transition-checklist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.98rem;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
}

.transition-checklist li span.tick {
  color: var(--accent);
  font-weight: 800;
}

.pitch-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  overflow-y: auto;
  padding: 4px 2px;
}

.pitch-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.accordion-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.accordion-item {
  border-radius: 14px;
  overflow: hidden;
}

.accordion-item.reto-bg { background: #fee2e2; }
.accordion-item.solucion-bg { background: #dcfce7; }

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  user-select: none;
}

.accordion-header.reto { color: #dc2626; }
.accordion-header.solucion { color: #15803d; }

.accordion-icon {
  font-size: 1rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.accordion-item.open .accordion-icon { transform: rotate(180deg); }

.accordion-content {
  display: none;
  padding: 0 16px 16px 16px;
}

.accordion-item.open .accordion-content { display: block; }

.accordion-text {
  color: var(--text-main) !important;
  font-size: clamp(0.9rem, 1.9vw, 1rem) !important;
  line-height: 1.55;
}

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

.benefit-chip {
  background: #ffffff;
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 8px 14px;
  border-radius: 20px;
  white-space: nowrap;
}

.nav-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.btn-next {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s ease;
}

.btn-next:hover { opacity: 0.9; }

.final-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
}

.final-scroll::-webkit-scrollbar { width: 5px; }
.final-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.ecosystem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 16px 0;
}

.ecosystem-col {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px;
}

.ecosystem-col h4 {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 10px;
}

.feature-btn {
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  text-align: left;
  margin-bottom: 6px;
}

.feature-btn:last-child { margin-bottom: 0; }

.feature-btn:hover {
  border-color: var(--primary);
  background: #fff3e0;
  color: var(--primary);
}

.closing-quote {
  background: #fff3e0;
  border-radius: 14px;
  padding: 16px 20px;
  margin: 6px 0 14px 0;
}

.closing-quote p {
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.55;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.stat-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
}

.stat-box .stat-icon {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.stat-box .stat-value {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
}

.stat-box .stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr; }
}

.final-cta-box {
  background: #f1f5f9;
  padding: 12px 16px;
  border-radius: 12px;
  text-align: center;
}

.signup-form {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  max-width: 620px;
}

.signup-form .terms {
  grid-column: 1 / -1;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}

.form-group input {
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.92rem;
  font-family: 'Inter', sans-serif;
  color: var(--text-main);
  background: #ffffff;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group input.invalid {
  border-color: #dc2626;
}

.field-error {
  display: none;
  color: #dc2626;
  font-size: 0.74rem;
  font-weight: 600;
}

.field-error.visible {
  display: block;
}

/* Términos y política (igual que index.php) */
.terms {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: #f8fafc;
  border: 1px solid var(--border-color);
  padding: 10px 12px;
  border-radius: 10px;
  text-align: left;
}

.terms a {
  color: var(--brand-purple);
  font-weight: 700;
  text-decoration: underline;
}

.policy-accepted-icon {
  display: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  margin-right: 6px;
  vertical-align: middle;
}

#policy-warning {
  color: #dc2626;
}

/* Modal de Política de Tratamiento de Datos */
.policy-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh; height: 100svh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 200;
  justify-content: center;
  align-items: center;
}

.policy-modal-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 25px 30px;
  max-width: 640px;
  width: 90%;
  max-height: 85vh;
  border: 1px solid var(--border-color);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  position: relative;
}

.policy-modal-card h2 {
  color: var(--brand-purple);
  font-size: 1.2rem;
  margin-bottom: 12px;
  padding-right: 30px;
}

.policy-body {
  overflow-y: auto;
  padding-right: 8px;
  flex: 1;
}

.policy-body p {
  color: var(--text-main);
  font-size: 0.85rem;
  margin-bottom: 12px;
  line-height: 1.55;
}

.policy-body ul {
  margin: 0 0 12px 20px;
  color: var(--text-main);
  font-size: 0.85rem;
}

.policy-actions {
  margin-top: 14px;
}

@keyframes progress-bar-stripes {
  0% { background-position: 1rem 0; }
  100% { background-position: 0 0; }
}

.policy-accept-btn {
  width: 100%;
  padding: 13px 18px;
  border: none;
  border-radius: 50px;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  position: relative;
  overflow: hidden;
  cursor: not-allowed;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 15px rgba(106, 44, 159, 0.3);
  background-color: #e9ecef;
}

.policy-accept-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: var(--progress, 0%);
  background-color: #8b4cbf;
  background-image: linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);
  background-size: 1rem 1rem;
  border-radius: 50px;
  animation: progress-bar-stripes 1s linear infinite;
  transition: width 0.3s ease, background-color 0.3s ease;
  z-index: 1;
}

.policy-accept-btn:not(:disabled) {
  cursor: pointer;
}

.policy-accept-btn:not(:disabled)::before {
  background-color: var(--brand-purple);
}

.policy-accept-btn:not(:disabled):hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 6px 20px rgba(106, 44, 159, 0.4);
}

.policy-accept-btn span {
  position: relative;
  z-index: 10;
  color: #fff;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 0 5px rgba(0,0,0,0.5);
}

.policy-close {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 1.6rem;
  font-weight: bold;
  color: var(--brand-purple);
  cursor: pointer;
  line-height: 1;
}

.policy-close:hover { color: var(--brand-orange); }

.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh; height: 100svh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 100;
  justify-content: center;
  align-items: center;
}

.modal-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 25px 30px;
  max-width: 480px;
  width: 90%;
  border: 1px solid var(--border-color);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

@media (max-width: 700px) {
  .station-card { padding: 20px 18px; }
  .business-grid,
  .diagnostic-grid,
  .ecosystem-grid,
  .signup-form { grid-template-columns: 1fr; }
  .business-grid { grid-template-rows: none; }
}

/* Aviso de rotación para pantallas pequeñas en vertical */
#rotate-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh; height: 100svh;
  background: linear-gradient(135deg, var(--brand-purple) 0%, var(--brand-orange) 100%);
  z-index: 500;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 30px;
  color: #ffffff;
}

#rotate-overlay.visible { display: flex; }

.rotate-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  animation: rotateHint 1.6s ease-in-out infinite;
}

@keyframes rotateHint {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(90deg); }
}

#rotate-overlay h2 {
  color: #ffffff;
  font-size: 1.3rem;
  margin-bottom: 8px;
}

#rotate-overlay p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  max-width: 320px;
}

/* Teléfonos en horizontal: compactar para que se vea similar al escritorio */
@media (orientation: landscape) and (max-height: 500px) {
  .station-section { width: min(94vw, 1000px); min-height: min(94vh, 680px); min-height: min(94svh, 680px); }
  .station-card { padding: 12px 22px; }
  .card-header-actions { margin-bottom: 4px; }
  .brand-logo-fixed { height: 24px; top: 8px; left: 10px; }
  .welcome-logo { height: auto; margin-top: 10px; margin-bottom: 6px; }
  h1 { font-size: 1.05rem; margin-bottom: 4px; }
  h2 { font-size: 0.95rem; margin-bottom: 4px; }
  p { font-size: 0.72rem; }
  .progress-bar-container { margin: 4px 0 6px 0; height: 5px; }
  .business-grid,
  .diagnostic-grid,
  .ecosystem-grid { gap: 6px; margin: 8px 0; }
  .signup-form { gap: 8px 12px; margin-top: 8px; }
  .biz-option { padding: 8px 10px; }
  .biz-option h3 { font-size: 0.85rem; margin-bottom: 2px; }
  .biz-option p { font-size: 0.68rem; }
  .diag-chip { padding: 7px 10px; font-size: 0.72rem; }
  .diag-question { font-size: 0.78rem; margin: 6px 0 2px 0; }
  .diag-subnote { font-size: 0.65rem; margin-bottom: 4px; }
  .btn-next { padding: 7px 12px; font-size: 0.72rem; }
  .btn-back { padding: 4px 10px; font-size: 0.68rem; }
  .nav-actions { margin-top: 6px; }
  .transition-checklist { margin: 10px auto 12px auto; }
  .transition-checklist li { padding: 6px 10px; font-size: 0.78rem; gap: 6px; }
  .accordion-header { padding: 8px 12px; font-size: 0.85rem; }
  .accordion-content { padding: 0 12px 10px 12px; }
  .accordion-text { font-size: 0.75rem !important; line-height: 1.4; }
  .pitch-body { gap: 6px; }
  .pitch-label { font-size: 0.65rem; margin-bottom: 4px; }
  .benefit-chip { font-size: 0.68rem; padding: 5px 10px; }
  .ecosystem-col { padding: 8px; }
  .ecosystem-col h4 { font-size: 0.72rem; margin-bottom: 6px; }
  .feature-btn { font-size: 0.66rem; padding: 6px 8px; margin-bottom: 4px; }
  .closing-quote { padding: 10px 12px; margin: 4px 0 8px 0; }
  .closing-quote p { font-size: 0.75rem; }
  .form-group input { padding: 7px 10px; font-size: 0.78rem; }
  .form-group label { font-size: 0.68rem; }
  .terms { font-size: 0.65rem; padding: 6px 8px; }
}

/* ===================== SIMULADOR ===================== */

.sim-subtitle {
  background: #fff3e0;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 4px;
}

.sim-subtitle p {
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.88rem;
}

/* --- Distribución del menú: libro (4/7 izquierda) + pedido (3/7 derecha) --- */
/* Fila siempre, en pantallas grandes y pequeñas */

.sim-menu-body {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex: 1;
  min-height: 0;
  gap: 12px;
  margin-top: 8px;
}

.sim-menu-book-col {
  flex: 3;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.sim-menu-cart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  gap: 8px;
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
}

.sim-cart-panel-title {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text-main);
  flex-shrink: 0;
}

.sim-cart-items-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 2px;
}

.sim-cart-empty {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.sim-cart-item-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  font-size: 0.78rem;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 5px;
}

.sim-cart-item-name { color: var(--text-main); font-weight: 600; flex: 1; }
.sim-cart-item-qty { color: var(--text-muted); flex-shrink: 0; }
.sim-cart-item-subtotal { color: var(--brand-orange); font-weight: 700; flex-shrink: 0; }

.sim-menu-cart-col .sim-cart-footer {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 0;
  padding-top: 8px;
  flex-shrink: 0;
}

.sim-menu-cart-col .sim-cart-total { text-align: center; }

/* --- Menú tipo libro (flip-book), recoloreado con la marca --- */

.sim-book-outer {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
  padding: 6px 0;
}

.sim-flip-book {
  display: none;
  box-shadow:
    -6px 0 14px rgba(0,0,0,0.25),
    6px 0 14px rgba(0,0,0,0.25),
    0 10px 26px rgba(0,0,0,0.3);
}

.sim-page {
  background-color: #ffffff;
  color: var(--text-main);
  overflow: hidden;
  border: 1px solid var(--border-color);
  font-family: 'Inter', sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

.sim-page-cover {
  background: linear-gradient(160deg, var(--brand-purple) 0%, #2a1245 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 24px 20px;
  box-sizing: border-box;
  border: 2px solid rgba(255,255,255,0.15);
}

.sim-cover-logo {
  width: 62px;
  height: 62px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--brand-orange);
  box-shadow: 0 6px 16px rgba(0,0,0,0.4);
  margin-bottom: 12px;
  flex-shrink: 0;
  background: #fff;
}

.sim-cover-title {
  font-size: clamp(1.05rem, 3vw, 1.4rem);
  font-weight: 800;
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #fff;
  line-height: 1.2;
}

.sim-cover-subtitle {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 5px;
  color: var(--brand-orange-light);
  margin: 0;
  text-transform: uppercase;
}

.sim-cover-swipe {
  margin-top: 26px;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.sim-cover-info {
  margin-top: 16px;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.7);
}

.sim-btn-inicio {
  margin-top: 20px;
  padding: 8px 18px;
  background: transparent;
  color: var(--brand-orange-light);
  border: 1px solid var(--brand-orange-light);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.sim-btn-inicio:hover { background: var(--brand-orange); color: #fff; border-color: var(--brand-orange); }

.sim-page-index {
  background: linear-gradient(160deg, var(--brand-purple) 0%, #2a1245 100%);
  color: #fff;
  padding: 20px 18px 16px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sim-page-index h2 {
  color: #fff;
  text-align: center;
  font-size: 1.1rem;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  text-transform: uppercase;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.sim-index-items { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.sim-index-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px;
  color: #eee;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 1px dashed rgba(255,255,255,0.2);
  transition: all 0.2s ease;
}

.sim-index-item:last-child { border-bottom: none; }

.sim-index-item:hover {
  color: var(--brand-orange-light);
  background: rgba(255,255,255,0.06);
  padding-left: 10px;
}

.sim-index-item span:last-child { color: rgba(255,255,255,0.5); font-size: 0.78rem; }

.sim-page-content {
  padding: 16px 16px 10px;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sim-page-header {
  text-align: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--brand-orange);
  flex-shrink: 0;
}

.sim-page-header h2 {
  color: var(--text-main);
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sim-page-items { flex: 1; overflow: hidden; display: flex; flex-direction: column; }

.sim-page-footer {
  flex-shrink: 0;
  margin-top: 4px;
  text-align: center;
  font-size: 0.66rem;
  color: var(--text-muted);
  padding-top: 4px;
  border-top: 1px solid var(--border-color);
}

.sim-menu-item {
  padding: 7px 0 6px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.sim-menu-item:last-child { border-bottom: none; padding-bottom: 0; }

.sim-item-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 3px;
}

.sim-item-title { font-weight: 700; font-size: 0.82rem; color: var(--text-main); flex: 1; line-height: 1.25; }
.sim-item-price { font-weight: 800; color: var(--brand-orange); font-size: 0.82rem; white-space: nowrap; }
.sim-item-desc { font-size: 0.68rem; color: var(--text-muted); margin: 0 0 4px; line-height: 1.3; }

.sim-item-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 2px;
}

.sim-item-actions .sim-qty-btn {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 81, 0, 0.1);
  color: var(--brand-orange);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.sim-item-actions .sim-qty-btn.sim-add-only {
  background: var(--brand-orange);
  color: #fff;
}

.sim-item-actions .sim-qty-num { min-width: 14px; text-align: center; font-size: 0.78rem; font-weight: 700; color: var(--text-main); }

.sim-book-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 6px;
  flex-shrink: 0;
}

.sim-book-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255, 81, 0, 0.08);
  border: 1px solid rgba(255, 81, 0, 0.25);
  color: var(--brand-orange);
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sim-book-btn:hover { background: var(--brand-orange); color: #fff; border-color: var(--brand-orange); }

.sim-book-indicator { font-size: 0.75rem; color: var(--text-muted); min-width: 70px; text-align: center; font-weight: 600; }

.sim-cart-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.sim-cart-total { font-weight: 800; font-size: 1rem; color: var(--text-main); }
.sim-cart-total span { color: var(--primary); }

.sim-chat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  flex: 1;
  min-height: 0;
  margin-top: 10px;
}

.sim-chat-mesa {
  background: #f8fafc;
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sim-chat-mesa-header {
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  text-align: center;
  padding: 8px;
}

.sim-chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sim-chat-bubble {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 0.7rem;
  color: var(--text-main);
  align-self: flex-start;
  max-width: 92%;
  opacity: 0;
  animation: simFadeIn 0.3s ease forwards;
}

.sim-chat-bubble.own {
  align-self: flex-end;
  background: #fff3e0;
  border-color: var(--brand-orange);
}

@keyframes simFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.sim-caja-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 0;
  flex-wrap: wrap;
  gap: 8px;
}

.sim-estado-badge {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.78rem;
}

.sim-estado-badge.ordenado { background: #fef3c7; color: #92400e; }
.sim-estado-badge.servido { background: #dbeafe; color: #1e40af; }
.sim-estado-badge.pagado { background: #dcfce7; color: #166534; }

.sim-caja-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: block;
}

.sim-caja-table thead, .sim-caja-table tbody { display: table; width: 100%; table-layout: fixed; }

.sim-caja-table th, .sim-caja-table td {
  text-align: left;
  padding: 8px 6px;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border-color);
}

.sim-caja-table th {
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.sim-caja-total-row td {
  font-weight: 800;
  color: var(--text-main);
  border-bottom: none;
  padding-top: 10px;
}

.sim-metodo-pago-row {
  display: flex;
  gap: 10px;
  margin: 10px 0;
}

.sim-metodo-btn {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 2px solid var(--border-color);
  background: #f8fafc;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-main);
}

.sim-metodo-btn.selected {
  border-color: var(--primary);
  background: #fff3e0;
  color: var(--primary);
}

.sim-resumen-totales {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.sim-resumen-total-box {
  background: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.sim-resumen-total-box .sim-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.sim-resumen-total-box .sim-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 4px;
}

.sim-resumen-total-box.efectivo .sim-value { color: var(--accent); }
.sim-resumen-total-box.transferencia .sim-value { color: var(--brand-purple); }
.sim-resumen-total-box.total .sim-value { color: var(--brand-orange); }

.sim-closing-msg {
  background: #fff3e0;
  border-radius: 14px;
  padding: 14px 18px;
  margin: 8px 0;
}

.sim-closing-msg p {
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.5;
}

@media (max-width: 700px) {
  .sim-chat-grid { grid-template-columns: 1fr 1fr; }
  .sim-resumen-totales { grid-template-columns: 1fr; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .sim-subtitle { padding: 6px 10px; }
  .sim-subtitle p { font-size: 0.7rem; }
  .sim-cover-logo { width: 44px; height: 44px; }
  .sim-cover-title { font-size: 0.9rem; }
  .sim-cover-subtitle { font-size: 0.58rem; letter-spacing: 3px; }
  .sim-page-header h2 { font-size: 0.85rem; }
  .sim-page-content { padding: 8px 10px 6px; }
  .sim-menu-item { padding: 4px 0 3px; }
  .sim-item-title, .sim-item-price { font-size: 0.68rem; }
  .sim-item-desc { font-size: 0.58rem; margin-bottom: 2px; }
  .sim-item-actions .sim-qty-btn { width: 18px; height: 18px; font-size: 0.7rem; }
  .sim-book-btn { width: 26px; height: 26px; font-size: 0.85rem; }
  .sim-book-indicator { font-size: 0.62rem; min-width: 50px; }
  .sim-menu-body { gap: 6px; margin-top: 4px; }
  .sim-menu-cart-col { padding: 6px; gap: 4px; }
  .sim-cart-panel-title { font-size: 0.7rem; }
  .sim-cart-items-list { gap: 3px; }
  .sim-cart-item-row, .sim-cart-empty { font-size: 0.62rem; padding-bottom: 3px; }
  .sim-cart-total { font-size: 0.72rem; }
  .sim-chat-grid { gap: 6px; margin-top: 6px; }
  .sim-chat-mesa-header { padding: 4px; font-size: 0.65rem; }
  .sim-chat-bubble { font-size: 0.6rem; padding: 4px 6px; }
  .sim-caja-table th, .sim-caja-table td { padding: 4px; font-size: 0.66rem; }
  .sim-estado-badge { padding: 3px 10px; font-size: 0.65rem; }
  .sim-metodo-btn { padding: 6px; font-size: 0.68rem; }
  .sim-resumen-total-box { padding: 6px; }
  .sim-resumen-total-box .sim-value { font-size: 0.82rem; }
  .sim-closing-msg { padding: 8px 10px; }
  .sim-closing-msg p { font-size: 0.7rem; }
}
