/* assets/css/main.css — POS Fast Food - Estilos principales */
/* Fuentes: Nunito (display + body) vía Google Fonts */

:root {
  /* Paleta de colores */
  --color-bg:       #0f0f13;
  --color-surface:  #1a1a22;
  --color-surface2: #22222e;
  --color-border:   #2e2e3e;
  --color-accent:   #ff6b35;
  --color-accent2:  #ff9f1c;
  --color-success:  #2ecc71;
  --color-danger:   #e74c3c;
  --color-warning:  #f39c12;
  --color-info:     #3498db;
  --color-text:     #f0f0f5;
  --color-text-muted: #8888a0;
  --color-glass:    rgba(255,255,255,0.04);
  --color-glass-border: rgba(255,255,255,0.08);

  /* Tipografía */
  --font-display: 'Nunito', sans-serif;
  --font-body:    'Nunito', sans-serif;

  /* Radios */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;

  /* Sombras */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 48px rgba(0,0,0,0.5);
  --shadow-accent: 0 0 24px rgba(255,107,53,0.25);

  /* Transiciones */
  --transition: 0.2s cubic-bezier(0.4,0,0.2,1);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--color-surface); }
::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-accent); }

/* Tipografía */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
p  { color: var(--color-text-muted); }
a  { color: var(--color-accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-accent2); }

/* =============================================
   LAYOUT PRINCIPAL
   ============================================= */

.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo img {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.sidebar-logo-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.sidebar-logo-sub {
  font-size: 0.7rem;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-text-muted);
  padding: 12px 20px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  text-decoration: none;
}

.nav-item:hover {
  background: var(--color-glass);
  color: var(--color-text);
  border-left-color: var(--color-border);
}

.nav-item.activo {
  background: rgba(255,107,53,0.1);
  color: var(--color-accent);
  border-left-color: var(--color-accent);
}

.nav-item .nav-icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent2));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: white;
  flex-shrink: 0;
}

.user-name { font-weight: 600; font-size: 0.85rem; line-height: 1.2; color: var(--color-text); }
.user-role {
  font-size: 0.7rem;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Main content */
.main-content {
  flex: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: 64px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

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

.fecha-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--color-glass);
  border: 1px solid var(--color-glass-border);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 0.82rem;
  color: var(--color-text-muted);
}

.page-content {
  flex: 1;
  padding: 28px;
}

/* =============================================
   CARDS Y GLASS
   ============================================= */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 24px;
}

.card-glass {
  background: var(--color-glass);
  border: 1px solid var(--color-glass-border);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 24px;
}

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

.card-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

/* =============================================
   MÉTRICAS / STATS
   ============================================= */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.metric-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent, var(--color-accent));
}

.metric-icon {
  width: 42px; height: 42px;
  background: rgba(255,107,53,0.12);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  color: var(--color-accent);
}

.metric-value {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 4px;
}

.metric-label {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* =============================================
   BOTONES
   ============================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

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

.btn-primary {
  background: var(--color-accent);
  color: white;
  box-shadow: 0 2px 12px rgba(255,107,53,0.3);
}
.btn-primary:hover:not(:disabled) {
  background: #ff7d4a;
  box-shadow: var(--shadow-accent);
  transform: translateY(-1px);
  color: white;
}

.btn-secondary {
  background: var(--color-surface2);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--color-border);
  color: var(--color-text);
}

.btn-success {
  background: var(--color-success);
  color: white;
}
.btn-success:hover:not(:disabled) { background: #27ae60; color: white; transform: translateY(-1px); }

.btn-danger {
  background: var(--color-danger);
  color: white;
}
.btn-danger:hover:not(:disabled) { background: #c0392b; color: white; }

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}
.btn-ghost:hover:not(:disabled) { color: var(--color-text); border-color: var(--color-text-muted); }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
}
.btn-icon:hover { color: var(--color-text); border-color: var(--color-text-muted); }

/* =============================================
   FORMULARIOS
   ============================================= */

.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 10px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(255,107,53,0.15);
}

.form-control::placeholder { color: var(--color-text-muted); opacity: 0.6; }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238888a0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea.form-control { resize: vertical; min-height: 80px; }

.form-hint { font-size: 0.78rem; color: var(--color-text-muted); margin-top: 4px; }
.form-error { font-size: 0.78rem; color: var(--color-danger); margin-top: 4px; }

/* =============================================
   TABLAS
   ============================================= */

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.table thead th {
  background: var(--color-surface2);
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.table tbody tr {
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition);
}

.table tbody tr:last-child { border-bottom: none; }

.table tbody tr:hover { background: var(--color-glass); }

.table tbody td {
  padding: 12px 16px;
  color: var(--color-text);
  vertical-align: middle;
}

/* =============================================
   BADGES
   ============================================= */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-success { background: rgba(46,204,113,0.15); color: var(--color-success); }
.badge-danger  { background: rgba(231,76,60,0.15); color: var(--color-danger); }
.badge-warning { background: rgba(243,156,18,0.15); color: var(--color-warning); }
.badge-info    { background: rgba(52,152,219,0.15); color: var(--color-info); }
.badge-accent  { background: rgba(255,107,53,0.15); color: var(--color-accent); }
.badge-muted   { background: var(--color-surface2); color: var(--color-text-muted); }

/* =============================================
   TOASTS / NOTIFICACIONES
   ============================================= */

#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 400px;
  pointer-events: all;
  animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
}

.toast.saliendo { animation: toastOut 0.25s ease forwards; }

.toast-icon { width: 20px; height: 20px; flex-shrink: 0; }
.toast-msg { flex: 1; font-size: 0.875rem; font-weight: 500; color: var(--color-text); }

.toast-success { border-left: 4px solid var(--color-success); }
.toast-error   { border-left: 4px solid var(--color-danger); }
.toast-warning { border-left: 4px solid var(--color-warning); }
.toast-info    { border-left: 4px solid var(--color-info); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}

/* =============================================
   MODALES
   ============================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  opacity: 0;
  transition: opacity var(--transition);
}

.modal-overlay.visible { opacity: 1; }

.modal {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%;
  max-width: 520px;
  margin: auto;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition);
}

.modal-overlay.visible .modal { transform: scale(1) translateY(0); }

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

.modal-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: all var(--transition);
}
.modal-close:hover { background: var(--color-danger); color: white; border-color: var(--color-danger); }

/* =============================================
   PÁGINA DE LOGIN
   ============================================= */

/* Keyframes de animación */
@keyframes loginFadeUp {
  from { opacity: 0; transform: translateY(32px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
@keyframes loginBgPulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.6; }
}
@keyframes orb1 {
  0%,100% { transform: translate(0,0) scale(1); }
  33%     { transform: translate(40px,-30px) scale(1.15); }
  66%     { transform: translate(-20px,20px) scale(0.9); }
}
@keyframes orb2 {
  0%,100% { transform: translate(0,0) scale(1); }
  40%     { transform: translate(-50px,30px) scale(1.1); }
  75%     { transform: translate(25px,-15px) scale(0.95); }
}
@keyframes logoEntrance {
  0%   { opacity:0; transform: scale(0.6) rotate(-10deg); }
  60%  { opacity:1; transform: scale(1.1) rotate(3deg); }
  100% { opacity:1; transform: scale(1) rotate(0deg); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-bg);
  padding: 20px;
  overflow: hidden;
  position: relative;
}

/* Orbes de fondo animados */
.login-page::before,
.login-page::after {
  content: '';
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}
.login-page::before {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,107,53,0.18) 0%, transparent 70%);
  top: -150px; left: -150px;
  animation: orb1 12s ease-in-out infinite;
}
.login-page::after {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,159,28,0.12) 0%, transparent 70%);
  bottom: -120px; right: -120px;
  animation: orb2 15s ease-in-out infinite;
}

.login-card {
  background: rgba(26,26,34,0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow:
    0 32px 80px rgba(0,0,0,0.5),
    0 0 0 1px rgba(255,107,53,0.08),
    inset 0 1px 0 rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
  z-index: 1;
  animation: loginFadeUp 0.65s cubic-bezier(0.22,1,0.36,1) both;
}

/* Barra superior con efecto shimmer */
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--color-accent),
    var(--color-accent2),
    var(--color-accent),
    var(--color-accent2)
  );
  background-size: 200% auto;
  animation: shimmer 3s linear infinite;
}

/* Brillo sutil en esquina superior derecha */
.login-card::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(255,107,53,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo img {
  width: 72px; height: 72px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  margin-bottom: 14px;
  animation: logoEntrance 0.7s cubic-bezier(0.22,1,0.36,1) 0.2s both;
  box-shadow: 0 8px 32px rgba(255,107,53,0.3);
}

.login-logo-placeholder {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent2));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 14px;
  animation: logoEntrance 0.7s cubic-bezier(0.22,1,0.36,1) 0.2s both;
  box-shadow: 0 8px 32px rgba(255,107,53,0.35);
}

.login-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* =============================================
   CAJA / POS
   ============================================= */

.pos-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  height: calc(100vh - 64px);
  overflow: hidden;
}

.pos-productos {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--color-border);
}

.pos-filtros {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--color-surface);
}

.cat-btn {
  padding: 6px 16px;
  border-radius: 99px;
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.cat-btn:hover { border-color: var(--color-accent); color: var(--color-accent); }
.cat-btn.activo {
  background: rgba(255,107,53,0.15);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.pos-busqueda {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  flex: 1;
  min-width: 160px;
}

.pos-busqueda input {
  background: none;
  border: none;
  outline: none;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 0.875rem;
  width: 100%;
}
.pos-busqueda input::placeholder { color: var(--color-text-muted); opacity: 0.6; }

.productos-grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  align-content: start;
}

.producto-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}

.producto-card.es-combo {
  border-color: rgba(255,159,28,0.4);
  background: linear-gradient(160deg, rgba(255,159,28,0.06), var(--color-surface) 60%);
}
.producto-card.es-combo:hover {
  border-color: var(--color-accent2);
}

.combo-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent2));
  color: white;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 99px;
  box-shadow: 0 2px 8px rgba(255,107,53,0.4);
}

.producto-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent), var(--shadow-sm);
  transform: translateY(-2px);
}

.producto-card:active { transform: scale(0.97); }

.producto-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--color-surface2);
}

.producto-img-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: var(--color-surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--color-border);
}

.producto-info {
  padding: 10px;
  flex: 1;
}

.producto-nombre {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.producto-precio {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-accent);
}

/* Panel del ticket */
.pos-ticket {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  overflow: hidden;
}

.ticket-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ticket-titulo {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}

.ticket-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.ticket-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--color-border);
  align-items: center;
}

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

.ticket-item-nombre {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
}

.ticket-item-precio {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.ticket-item-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qty-btn {
  width: 26px; height: 26px;
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text);
  font-size: 1rem;
  font-weight: 700;
  transition: all var(--transition);
  flex-shrink: 0;
}
.qty-btn:hover { background: var(--color-accent); border-color: var(--color-accent); }

.qty-num {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.ticket-item-subtotal {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-accent);
  white-space: nowrap;
  text-align: right;
  min-width: 70px;
}

.ticket-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-muted);
}

.ticket-empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: 0.4; }
.ticket-empty p { font-size: 0.875rem; }

.ticket-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface2);
}

.ticket-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.ticket-total-row.total-final {
  border-top: 1px solid var(--color-border);
  margin-top: 6px;
  padding-top: 10px;
  font-size: 1.3rem;
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--color-text);
}

/* Cobrar panel */
.cobrar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
}

.cobrar-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 36px;
  width: 100%;
  max-width: 460px;
  margin: auto;
}

/* =============================================
   CONFIRM ESTILO iOS
   ============================================= */
.ios-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.ios-confirm-overlay.visible { opacity: 1; }

.ios-confirm-card {
  background: rgba(38, 38, 50, 0.92);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  padding: 24px 24px 0;
  width: 100%;
  max-width: 290px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: scale(0.85);
  opacity: 0;
  transition: all 0.28s cubic-bezier(0.22,1,0.36,1);
  overflow: hidden;
}
.ios-confirm-overlay.visible .ios-confirm-card {
  transform: scale(1);
  opacity: 1;
}

.ios-confirm-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
  line-height: 1;
}

.ios-confirm-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-text);
  margin-bottom: 8px;
  line-height: 1.3;
}

.ios-confirm-msg {
  font-size: 0.87rem;
  color: var(--color-text-muted);
  line-height: 1.45;
  margin-bottom: 20px;
  white-space: pre-line;
}

.ios-confirm-actions {
  display: flex;
  margin: 0 -24px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.ios-confirm-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 14px 12px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.15s ease;
}
.ios-confirm-btn + .ios-confirm-btn {
  border-left: 1px solid rgba(255,255,255,0.08);
}
.ios-confirm-btn:hover {
  background: rgba(255,255,255,0.04);
}
.ios-confirm-btn:active {
  background: rgba(255,255,255,0.08);
}
.ios-cancel { color: var(--color-text-muted); }
.ios-ok.ios-primary { color: var(--color-accent); font-weight: 700; }
.ios-ok.ios-success { color: var(--color-success); font-weight: 700; }
.ios-ok.ios-danger  { color: var(--color-danger);  font-weight: 700; }

/* Botones método de pago MEJORADOS */
.metodo-pago-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.metodo-pago-btn {
  position: relative;
  background: var(--color-surface2);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 18px 12px;
  cursor: pointer;
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.92rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.22,1,0.36,1);
  overflow: hidden;
}

.metodo-pago-btn .mp-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  transition: all 0.25s ease;
}

.metodo-pago-btn:hover {
  border-color: rgba(255,107,53,0.5);
  background: rgba(255,107,53,0.04);
  transform: translateY(-2px);
}

.metodo-pago-btn.active {
  border-color: var(--color-accent);
  background: rgba(255,107,53,0.1);
  color: var(--color-accent);
  box-shadow: 0 4px 16px rgba(255,107,53,0.15);
}
.metodo-pago-btn.active .mp-icon {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent2));
  box-shadow: 0 4px 12px rgba(255,107,53,0.4);
}
.metodo-pago-btn.active .mp-icon svg {
  color: white;
}

.metodo-pago-btn::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: transparent;
  transition: all 0.2s ease;
}
.metodo-pago-btn.active::after {
  border-color: var(--color-accent);
  background: var(--color-accent);
  box-shadow: inset 0 0 0 3px var(--color-surface);
}

/* =============================================
   PAGINACIÓN
   ============================================= */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-info {
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.pag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: var(--color-surface2);
  color: var(--color-text);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  border: 1px solid var(--color-border);
  transition: all 0.15s ease;
  cursor: pointer;
}

.pag-btn:hover:not(.disabled):not(.active) {
  background: rgba(255,107,53,0.1);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.pag-btn.active {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent2));
  color: white;
  border-color: transparent;
  cursor: default;
}

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

.pag-ellipsis {
  color: var(--color-text-muted);
  padding: 0 4px;
}

/* =============================================
   RESPONSIVE
   ============================================= */

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--color-text);
  cursor: pointer;
  padding: 6px;
}

/* Overlay para sidebar móvil */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(2px);
  z-index: 99;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sidebar-backdrop.activo { display: block; }

/* Tablet — hasta 1024px */
@media (max-width: 1024px) {
  .pos-layout {
    grid-template-columns: 1fr 320px;
  }
  .grid-2 { grid-template-columns: 1fr 1fr; }
}

/* Mobile — hasta 768px */
@media (max-width: 768px) {
  /* Sidebar deslizable */
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s cubic-bezier(0.22,1,0.36,1);
    z-index: 100;
  }
  .sidebar.abierto { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .main-content { margin-left: 0; }

  .topbar {
    padding: 12px 16px;
    gap: 10px;
  }
  .topbar h2 { font-size: 1.1rem !important; }

  /* Layout POS en móvil: productos arriba, ticket abajo */
  .pos-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    height: auto;
    min-height: calc(100vh - 64px);
  }
  .pos-ticket {
    border-left: none;
    border-top: 1px solid var(--color-border);
    max-height: 50vh;
  }
  .productos-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 10px;
    padding: 12px;
  }
  .producto-card {
    padding: 10px 8px;
  }
  .producto-card .producto-nombre { font-size: 0.78rem; }
  .producto-card .producto-precio { font-size: 0.9rem; }

  .page-content { padding: 16px 12px; }
  .metrics-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .metric-card { padding: 16px; }
  .metric-value { font-size: 1.6rem; }
  .grid-2 { grid-template-columns: 1fr; }

  /* Tablas con scroll horizontal */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .table {
    min-width: 600px;
    font-size: 0.85rem;
  }
  .table th, .table td {
    padding: 10px 8px;
    white-space: nowrap;
  }

  /* Cards y filtros */
  .card { border-radius: var(--radius-md); }
  .card form { flex-direction: column; align-items: stretch !important; }
  .card form > div { width: 100%; }

  /* Modales en móvil */
  .modal, .cobrar-card {
    max-width: 100% !important;
    padding: 24px 20px !important;
    border-radius: var(--radius-lg);
  }
  .modal-overlay, .cobrar-overlay {
    padding: 12px;
  }

  /* Headings */
  h2 { font-size: 1.3rem; }
  h3 { font-size: 1.1rem; }

  /* Botones más cómodos al tap */
  .btn { min-height: 42px; }
  .btn-icon { min-height: 36px; min-width: 36px; }

  /* Header de cada página */
  .d-flex.align-center.justify-between {
    flex-wrap: wrap;
    gap: 12px;
  }

  /* Paginación más compacta */
  .pagination {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .pagination-controls {
    justify-content: center;
  }
  .pag-btn {
    min-width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  /* Login card */
  .login-card {
    padding: 32px 24px;
    max-width: 100%;
  }

  /* Toasts */
  .toast {
    min-width: auto;
    max-width: calc(100vw - 32px);
    font-size: 0.85rem;
  }
}

/* Mobile pequeño — hasta 480px */
@media (max-width: 480px) {
  .login-card {
    padding: 28px 20px;
  }
  .login-title { font-size: 1.3rem; }
  .metrics-grid { grid-template-columns: 1fr; }

  .productos-grid {
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
    gap: 8px;
  }

  .metodo-pago-grid {
    grid-template-columns: 1fr 1fr;
  }
  .metodo-pago-btn {
    padding: 12px 6px;
    font-size: 0.85rem;
  }

  /* Ocultar columnas menos importantes en tablas muy estrechas */
  .table .hide-mobile { display: none; }

  .page-content { padding: 14px 10px; }
  h2 { font-size: 1.15rem; }
}

/* =============================================
   UTILIDADES
   ============================================= */

.text-muted { color: var(--color-text-muted); }
.text-accent { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-danger  { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-center  { text-align: center; }
.text-right   { text-align: right; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }

.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.separator {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 20px 0;
}

/* Estado vacío */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { margin-bottom: 8px; }

/* Animaciones de entrada */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp 0.35s ease forwards; }

/* Spinner */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Print ticket */
@media print {
  @page {
    size: 80mm auto;
    margin: 0;
  }
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: white !important;
    width: 80mm !important;
    height: auto !important;
    min-height: 0 !important;
  }

  /* Colapsar TODO el contenido excepto el ticket.
     display:none quita los elementos del flujo (a diferencia de
     visibility:hidden que mantiene su altura y genera páginas en blanco) */
  body.imprimiendo-ticket > * {
    display: none !important;
  }
  body.imprimiendo-ticket > #ticket-print {
    display: block !important;
    position: static !important;
    width: 80mm !important;
    height: auto !important;
    background: white;
    color: #000;
  }

  .ticket-doc {
    font-family: 'Courier New', 'Consolas', monospace !important;
    font-size: 11px;
    line-height: 1.3;
    color: #000;
    padding: 3mm;
    width: 100%;
    box-sizing: border-box;
  }

  /* Header */
  .tk-header {
    text-align: center;
    padding-bottom: 6px;
    border-bottom: 1px dashed #000;
  }
  .tk-negocio {
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
  }
  .tk-sucursal {
    font-size: 11px;
    margin-bottom: 2px;
  }
  .tk-fecha {
    font-size: 10px;
    color: #333;
  }

  /* Folio box */
  .tk-folio-box {
    text-align: center;
    margin: 6px 0;
    padding: 4px;
    border: 1px solid #000;
    border-radius: 3px;
  }
  .tk-folio-label {
    font-size: 9px;
    letter-spacing: 1px;
    color: #555;
  }
  .tk-folio-num {
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 0.5px;
  }

  /* Tabla de items con widths FIJOS */
  .tk-items {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin: 6px 0;
    font-size: 11px;
  }
  .tk-items thead th {
    border-bottom: 1px dashed #000;
    padding: 2px 0;
    font-weight: bold;
    text-align: left;
    font-size: 9px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
  }
  .tk-items tbody td {
    padding: 3px 0;
    vertical-align: top;
    border-bottom: 1px dotted #999;
  }
  .tk-items .tk-cant   { width: 12mm; text-align: center; }
  .tk-items .tk-nombre { width: auto; padding-right: 2mm; }
  .tk-items .tk-sub    { width: 22mm; text-align: right; white-space: nowrap; }
  .tk-precio {
    font-size: 9px;
    color: #555;
  }

  /* Tabla de totales */
  .tk-totals {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin-top: 8px;
    font-size: 11px;
  }
  .tk-totals td {
    padding: 2px 0;
  }
  .tk-totals td:first-child {
    width: auto;
    text-align: left;
  }
  .tk-totals td:last-child {
    width: 28mm;
    text-align: right;
    white-space: nowrap;
    font-weight: bold;
  }
  .tk-row-total td {
    padding: 4px 0 !important;
    font-size: 14px !important;
    font-weight: bold !important;
    border-top: 1px solid #000;
    border-bottom: 1px solid #000;
  }
  .tk-row-cambio td {
    font-weight: bold !important;
  }

  /* Footer */
  .tk-footer {
    margin-top: 10px;
    padding-top: 6px;
    border-top: 1px dashed #000;
    text-align: center;
    font-size: 10px;
    line-height: 1.4;
  }
  .tk-gracias {
    margin-top: 4px;
    font-style: italic;
    font-weight: bold;
    font-size: 11px;
  }
}
