@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  /* Paleta de Colores - Tema Claro Moderno (Premium) */
  --bg-app: #f4f6fa;
  --bg-card: #ffffff;
  --bg-input: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --primary: #4f46e5;
  --primary-light: #e0e7ff;
  --primary-dark: #3730a3;
  
  --success: #10b981;
  --success-light: #d1fae5;
  --success-dark: #065f46;
  
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --warning-dark: #78350f;
  
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --danger-dark: #991b1b;
  
  --border: #e2e8f0;
  --border-focus: #cbd5e1;
  
  /* Sombras y Bordes */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.12);
  
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
}

/* Contenedor del sistema fluido */
.phone-viewport {
  width: 100%;
  height: 100vh;
  background-color: var(--bg-app);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

/* Área de contenido con scroll */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 90px 16px; /* padding inferior para dejar espacio a la tab bar */
  scroll-behavior: smooth;
}

/* Ocultar barra de scroll para estética premium */
.content-area::-webkit-scrollbar {
  display: none;
}

/* --- ENCABEZADO --- */
.app-header {
  padding: 16px 16px 8px 16px;
  background-color: var(--bg-app);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.delivery-info {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.delivery-info svg {
  color: var(--primary);
}

.delivery-details {
  display: flex;
  flex-direction: column;
}

.delivery-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.delivery-address {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 4px;
}

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

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  position: relative;
  transition: var(--transition-smooth);
  color: var(--text-main);
}

.icon-btn:active {
  transform: scale(0.92);
  background-color: var(--border);
}

.notification-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  background-color: var(--danger);
  border-radius: 50%;
  border: 1.5px solid var(--bg-card);
}

.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--primary-light);
}

/* --- BUSCADOR --- */
.search-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-bar {
  flex: 1;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.search-bar svg {
  color: var(--text-light);
}

.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 14px;
  color: var(--text-main);
}

/* --- BANNER DE INVENTARIO RÁPIDO --- */
.quick-inventory-banner {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 8px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.banner-content {
  max-width: 60%;
  z-index: 2;
}

.banner-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.banner-subtitle {
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
  margin-bottom: 12px;
}

.banner-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.banner-btn:active {
  transform: scale(0.95);
  box-shadow: none;
}

.banner-illustration {
  width: 110px;
  height: auto;
  object-fit: contain;
  z-index: 2;
  position: absolute;
  right: 12px;
  bottom: 8px;
}

.banner-bg-shape {
  position: absolute;
  right: -20px;
  bottom: -20px;
  width: 150px;
  height: 150px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  z-index: 1;
}

/* --- CARRUSEL DE CATEGORÍAS --- */
.categories-container {
  margin-bottom: 20px;
}

.categories-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: none; /* Firefox */
}

.categories-scroll::-webkit-scrollbar {
  display: none; /* Safari/Chrome */
}

.category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  min-width: 68px;
}

.category-icon-wrapper {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-md);
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-sm);
}

.category-icon-wrapper svg {
  color: var(--text-muted);
  width: 22px;
  height: 22px;
  transition: var(--transition-smooth);
}

.category-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

/* Estado Activo Categoría */
.category-item.active .category-icon-wrapper {
  background-color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.category-item.active .category-icon-wrapper svg {
  color: white;
}

.category-item.active .category-label {
  color: var(--primary);
  font-weight: 600;
}

/* --- SECCIÓN GENERAL --- */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-link {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

/* --- GRILLA DE PRODUCTOS (POS) --- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.product-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  overflow: hidden;
}

.product-card:active {
  transform: scale(0.98);
}

.product-card-image {
  width: 100%;
  height: 100px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background-color: var(--bg-app);
  margin-bottom: 10px;
}

.product-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.product-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-sku {
  font-size: 10px;
  color: var(--text-light);
  font-weight: 500;
}

.product-stock {
  font-size: 10px;
  font-weight: 600;
  margin-top: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  align-self: flex-start;
}

.stock-ok {
  background-color: var(--success-light);
  color: var(--success-dark);
}

.stock-low {
  background-color: var(--warning-light);
  color: var(--warning-dark);
}

.stock-out {
  background-color: var(--danger-light);
  color: var(--danger-dark);
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.product-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.add-cart-btn {
  background-color: var(--primary);
  color: white;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.3);
  transition: var(--transition-smooth);
}

.add-cart-btn:active {
  transform: scale(0.85);
}

/* --- TAB BAR INFERIOR --- */
.bottom-tab-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom, 8px);
  box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.05);
  z-index: 10;
}

.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  width: 20%;
  transition: var(--transition-smooth);
}

.tab-item svg {
  width: 22px;
  height: 22px;
  transition: var(--transition-smooth);
}

.tab-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.tab-item.active {
  color: var(--primary);
}

.tab-item.active svg {
  transform: translateY(-2px);
  color: var(--primary);
}

/* --- BOTÓN FLOTANTE DEL CARRITO (EN POS) --- */
.cart-floating-btn {
  position: absolute;
  bottom: 88px;
  right: 16px;
  background-color: var(--primary);
  color: white;
  border: none;
  height: 56px;
  border-radius: 28px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 8px;
  box-shadow: 0 8px 16px rgba(79, 70, 229, 0.35);
  cursor: pointer;
  z-index: 9;
  transition: var(--transition-smooth);
}

.cart-floating-btn:active {
  transform: scale(0.95);
  box-shadow: 0 4px 8px rgba(79, 70, 229, 0.25);
}

.cart-badge {
  background-color: var(--danger);
  color: white;
  border-radius: 50%;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1.5px solid var(--primary);
}

.cart-total-badge {
  font-weight: 600;
  font-size: 13px;
}

/* --- VISTAS / PANTALLAS (SPA) --- */
.app-view {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.app-view.active {
  display: block;
}

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

/* --- VISTA: VENTAS/HISTORIAL --- */
.sales-history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sale-history-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.sale-history-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sale-id {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.sale-date {
  font-size: 11px;
  color: var(--text-light);
}

.sale-payment-method {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: var(--bg-app);
  color: var(--text-muted);
  align-self: flex-start;
  font-weight: 500;
}

.sale-history-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.sale-amount {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.sale-items-count {
  font-size: 11px;
  color: var(--text-muted);
}

/* --- VISTA: INVENTARIO COMPLETO --- */
.inventory-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.inventory-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.inventory-item-image {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.inventory-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.inventory-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inventory-item-sku {
  font-size: 10px;
  color: var(--text-light);
}

.inventory-item-stock-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.inventory-stock-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.inventory-item-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  text-align: right;
}

.inventory-edit-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
}

.inventory-edit-btn:hover {
  background-color: var(--primary-light);
}

.add-product-btn-floating {
  position: absolute;
  bottom: 88px;
  right: 16px;
  background-color: var(--success);
  color: white;
  border: none;
  height: 56px;
  width: 56px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 8px 16px rgba(16, 185, 129, 0.35);
  cursor: pointer;
  z-index: 9;
  transition: var(--transition-smooth);
}

.add-product-btn-floating:active {
  transform: scale(0.9);
}

/* --- VISTA: REPORTES --- */
.report-summary-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.summary-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.summary-card-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.summary-card-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

.summary-card-sub {
  font-size: 10px;
  color: var(--text-light);
}

.summary-card.accent {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
  border-color: var(--primary-light);
}

.summary-card.accent .summary-card-title {
  color: var(--primary-dark);
}

.summary-card.accent .summary-card-value {
  color: var(--primary-dark);
}

.report-section {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.report-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chart-placeholder {
  height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
}

.bar-chart-container {
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  height: 140px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.bar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 12%;
}

.bar-column {
  width: 100%;
  background-color: var(--primary-light);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  transition: height 0.5s ease-out;
  position: relative;
}

.bar-column.active {
  background-color: var(--primary);
}

.bar-column::before {
  content: attr(data-val);
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 600;
  color: var(--text-muted);
}

.bar-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
}

/* --- VISTA: PERFIL Y AJUSTES --- */
.settings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-group {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.settings-group-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input, .form-group select {
  background-color: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  transition: var(--transition-smooth);
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--primary);
  background-color: var(--bg-card);
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  width: 100%;
}

.btn-primary:active {
  background-color: var(--primary-dark);
  transform: scale(0.98);
}

/* --- MODALES DESLIZANTES --- */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 100;
  display: none;
  justify-content: flex-end;
  flex-direction: column;
}

.modal-overlay.active {
  display: flex;
}

.modal-sheet {
  background-color: var(--bg-card);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  max-height: 85%;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.1);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

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

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
}

.modal-close-btn {
  background: var(--bg-app);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

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

/* --- LISTADO DEL CARRITO --- */
.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background-color: var(--bg-app);
  padding: 10px;
  border-radius: var(--radius-md);
}

.cart-item-img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 2px;
}

.cart-qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: none;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.cart-qty-btn:active {
  background-color: var(--bg-app);
}

.cart-item-qty {
  font-size: 12px;
  font-weight: 700;
  min-width: 16px;
  text-align: center;
}

.cart-totals-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.totals-row.grand-total {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  border-top: 1px dashed var(--border);
  padding-top: 8px;
  margin-top: 4px;
}

/* --- SECCIÓN DE COBRO --- */
.payment-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.payment-option {
  border: 1.5px solid var(--border);
  background-color: var(--bg-card);
  padding: 12px 6px;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.payment-option.active {
  border-color: var(--primary);
  background-color: var(--primary-light);
  color: var(--primary-dark);
}

.payment-option svg {
  width: 20px;
  height: 20px;
}

.payment-option span {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

/* --- EXITO DEL COBRO --- */
.success-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 0;
}

.success-icon-wrapper {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background-color: var(--success-light);
  color: var(--success);
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  animation: scalePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scalePop {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.success-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--success-dark);
  margin-bottom: 8px;
}

.success-details {
  background-color: var(--bg-app);
  border-radius: var(--radius-md);
  padding: 12px 24px;
  width: 100%;
  margin-bottom: 20px;
}

.success-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}

.success-row:last-child {
  margin-bottom: 0;
}

.success-row span:last-child {
  font-weight: 600;
}

/* --- MOCK SCANNER VIEW --- */
.scanner-viewport {
  background-color: #000;
  height: 180px;
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  margin-bottom: 16px;
}

.scanner-video-simulation {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, #334155 0%, #0f172a 100%);
  position: relative;
}

.scanner-laser {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2.5px;
  background-color: var(--danger);
  box-shadow: 0 0 8px var(--danger);
  animation: laserSweep 2s ease-in-out infinite alternate;
}

@keyframes laserSweep {
  from { top: 10%; }
  to { top: 90%; }
}

.scanner-overlay-box {
  position: absolute;
  width: 70%;
  height: 60%;
  border: 2px dashed rgba(255, 255, 255, 0.6);
  border-radius: 8px;
}

.scanner-instructions {
  font-size: 11px;
  text-align: center;
  color: var(--text-muted);
  line-height: 1.4;
}

.mock-scan-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.mock-scan-item-btn {
  background-color: var(--bg-app);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: var(--transition-smooth);
}

.mock-scan-item-btn:active {
  background-color: var(--primary-light);
  border-color: var(--primary);
}

/* ==========================================================================
   RESPONSIVE DESIGN: DESKTOP / WEB DASHBOARD
   ========================================================================== */
@media (min-width: 768px) {
  /* Diseño en Grid de 2 Columnas para la App Completa */
  .phone-viewport {
    display: grid;
    grid-template-columns: 245px 1fr;
    grid-template-rows: auto 1fr;
    grid-template-areas: 
      "sidebar header"
      "sidebar main";
    height: 100vh;
  }
  
  /* Cabecera superior */
  .app-header {
    grid-area: header;
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    box-shadow: var(--shadow-sm);
  }
  
  /* Contenido principal */
  .content-area {
    grid-area: main;
    padding: 24px;
    padding-bottom: 96px; /* Espacio de cortesía */
    height: calc(100vh - 84px);
    overflow-y: auto;
  }
  
  /* Sidebar Lateral (Conversión de Bottom Tab Bar) */
  .bottom-tab-bar {
    grid-area: sidebar;
    position: static;
    height: 100vh;
    border-top: none;
    border-right: 1px solid var(--border);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 24px 16px;
    gap: 8px;
    box-shadow: none;
    background-color: var(--bg-card);
  }
  
  .tab-item {
    width: 100%;
    flex-direction: row;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    justify-content: flex-start;
    color: var(--text-muted);
  }
  
  .tab-item.active {
    background-color: var(--primary-light);
    color: var(--primary);
  }
  
  .tab-item svg {
    transform: none !important;
  }
  
  .tab-label {
    font-size: 13px;
    text-transform: none;
    letter-spacing: normal;
  }
  
  /* Redimensionamiento de Grillas de Productos */
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
  }
  
  .product-card-image {
    height: 130px;
  }
  
  /* Tarjetas de Reporte horizontales */
  .report-summary-cards {
    grid-template-columns: repeat(4, 1fr);
  }
  
  /* Grilla del escáner en escritorio */
  .mock-scan-list {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Ajustar modales deslizantes para ser ventanas centradas en escritorio */
  .modal-overlay {
    justify-content: center;
    align-items: center;
    padding: 20px;
  }
  
  .modal-sheet {
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  
  @keyframes zoomIn {
    from { transform: scale(0.92); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
  }

  /* Ajuste de botones flotantes en escritorio */
  .cart-floating-btn, .add-product-btn-floating {
    bottom: 24px;
    right: 24px;
  }
}
