:root {
  --primary: #E85D26;
  --primary-dark: #C94A1A;
  --secondary: #F7B731;
  --accent: #27AE60;
  --bg: #FFF8F0;
  --bg-card: #FFFFFF;
  --dark: #2D1B14;
  --dark-light: #4A3228;
  --text: #333333;
  --text-light: #888888;
  --text-muted: #BBBBBB;
  --border: #F0E6DC;
  --danger: #E74C3C;
  --shadow: 0 2px 12px rgba(45, 27, 20, 0.08);
  --shadow-lg: 0 8px 32px rgba(45, 27, 20, 0.15);
  --radius: 14px;
  --radius-sm: 10px;
  --nav-height: 70px;
  --header-height: 56px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  user-select: none;
  -webkit-user-select: none;
}

#app {
  height: 100%;
  position: relative;
}

/* Stable viewport sizing for iPhone PWA */
html, body, #app {
  height: 100svh;
}

@supports (height: 100dvh) {
  html, body, #app {
    height: 100dvh;
  }
}

/* ====== SCREENS ====== */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
}
.screen.active { display: flex; }

/* ====== LOGIN ====== */
#login-screen {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
  justify-content: center;
  align-items: center;
  padding: 20px;
  padding-top: var(--safe-top);
}

.login-container {
  text-align: center;
  width: 100%;
  max-width: 320px;
}

.login-logo {
  font-size: 64px;
  margin-bottom: 8px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.login-title {
  color: #FFF;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 4px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 28px;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  transition: all 0.2s;
}

.pin-dot.filled {
  background: var(--primary);
  border-color: var(--primary);
  transform: scale(1.2);
}

.pin-dot.error {
  border-color: var(--danger);
  background: var(--danger);
  animation: shake 0.4s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.pin-error {
  color: var(--danger);
  font-size: 13px;
  height: 20px;
  margin-bottom: 8px;
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 280px;
  margin: 0 auto;
}

.pin-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.08);
  color: #FFF;
  font-size: 28px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: all 0.15s;
}

.pin-btn:active {
  background: rgba(255,255,255,0.2);
  transform: scale(0.92);
}

.pin-btn-empty {
  background: transparent;
  pointer-events: none;
}

.pin-btn-del {
  background: transparent;
  color: rgba(255,255,255,0.6);
}

/* ====== MAIN SCREEN ====== */
#main-screen {
  background: var(--bg);
}

/* ====== HEADER ====== */
#app-header {
  min-height: calc(var(--header-height) + var(--safe-top));
  padding: 0 20px;
  padding-top: var(--safe-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

#app-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--dark);
}

.header-btn {
  background: var(--primary);
  color: #FFF;
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

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

/* ====== VIEW CONTAINER ====== */
#view-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px);
}

/* ====== BOTTOM NAVIGATION ====== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--dark);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  border-top: 1px solid rgba(255,255,255,0.05);
  border-radius: 0;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s;
  min-width: 56px;
}

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

.nav-item svg {
  stroke: currentColor;
}

.nav-item span {
  letter-spacing: 0.3px;
}

/* ====== CART BAR ====== */
.cart-bar {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 8px);
  left: 12px;
  right: 12px;
  background: var(--dark);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 90;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

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

.cart-bar-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #FFF;
  cursor: pointer;
}

.cart-bar-count {
  background: var(--primary);
  color: #FFF;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.cart-bar-text {
  font-size: 14px;
  opacity: 0.7;
}

.cart-bar-total {
  font-size: 18px;
  font-weight: 700;
}

.cart-bar-btn {
  background: var(--accent);
  color: #FFF;
  border: none;
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s;
}

.cart-bar-btn:active {
  transform: scale(0.95);
}

/* ====== VENTA VIEW ====== */
.product-type-tabs {
  display: flex;
  gap: 10px;
  padding: 16px 16px 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.product-type-tabs::-webkit-scrollbar { display: none; }

.type-tab {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 25px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.type-tab .tab-icon {
  font-size: 20px;
}

.type-tab.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #FFF;
}

.type-tab:active {
  transform: scale(0.95);
}

.fillings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 12px 16px;
}

.filling-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.filling-card:active {
  transform: scale(0.95);
}

.filling-card.selected {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(232, 93, 38, 0.25);
}

.filling-card .filling-icon {
  font-size: 36px;
  display: block;
  margin-bottom: 6px;
}

.filling-card .filling-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.filling-card .filling-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--primary);
  color: #FFF;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}

.filling-card.in-cart .filling-badge {
  display: flex;
}

/* Expanded filling card (quantity selector) */
.filling-expanded {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px;
  margin: 8px 16px;
  box-shadow: var(--shadow-lg);
  animation: expandIn 0.25s ease;
  border: 2px solid var(--primary);
}

@keyframes expandIn {
  from { transform: scaleY(0.8); opacity: 0; }
  to { transform: scaleY(1); opacity: 1; }
}

.filling-expanded-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.filling-expanded-icon {
  font-size: 44px;
}

.filling-expanded-info h3 {
  font-size: 18px;
  font-weight: 700;
}

.filling-expanded-info p {
  font-size: 13px;
  color: var(--text-light);
}

.qty-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 16px;
}

.qty-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-card);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.qty-btn:active {
  background: var(--primary);
  border-color: var(--primary);
  color: #FFF;
  transform: scale(0.9);
}

.qty-btn.minus { color: var(--danger); }

.qty-value {
  font-size: 36px;
  font-weight: 800;
  min-width: 50px;
  text-align: center;
  color: var(--dark);
}

.filling-expanded-actions {
  display: flex;
  gap: 10px;
}

.btn-add-cart {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--primary);
  color: #FFF;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s;
}

.btn-add-cart:active {
  transform: scale(0.97);
  background: var(--primary-dark);
}

.btn-cancel-fill {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--bg-card);
  color: var(--text-light);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* ====== EMPTY STATE ====== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 30px;
  text-align: center;
}

.empty-state-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 16px;
  color: var(--text-light);
  line-height: 1.5;
}

.empty-state-btn {
  margin-top: 20px;
  padding: 12px 28px;
  background: var(--primary);
  color: #FFF;
  border: none;
  border-radius: 25px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* ====== CRUD LISTS (Productos / Guisos) ====== */
.crud-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.crud-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  padding: 14px 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.crud-item-icon {
  font-size: 32px;
  width: 44px;
  text-align: center;
}

.crud-item-info {
  flex: 1;
}

.crud-item-info h4 {
  font-size: 16px;
  font-weight: 600;
}

.crud-item-info p {
  font-size: 13px;
  color: var(--text-light);
}

.crud-item-actions {
  display: flex;
  gap: 6px;
}

.crud-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--text-light);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crud-btn:active {
  background: var(--border);
}

.crud-btn.danger:active {
  background: var(--danger);
  color: #FFF;
}

/* ====== MODAL ====== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: center;
  align-items: flex-end;
  z-index: 200;
  padding: 0 0 var(--safe-bottom) 0;
}

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

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 95vh;
  overflow-y: auto;
  padding: 20px 20px;
  padding-bottom: calc(20px + var(--safe-bottom));
  animation: modalSlideUp 0.3s ease;
}

.modal-overlay.modal-fullheight {
  align-items: center;
  padding: 10px;
}

.modal-overlay.modal-fullheight .modal-content {
  max-height: 96vh;
  border-radius: var(--radius);
}

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

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

/* ====== FORMS ====== */
.form-group {
  margin-bottom: 16px;
}

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

.form-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--bg);
  font-size: 16px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

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

.emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.emoji-option {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--bg);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.emoji-option.selected {
  border-color: var(--primary);
  background: rgba(232, 93, 38, 0.1);
  transform: scale(1.1);
}

.form-btn {
  width: 100%;
  padding: 15px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s;
}

.form-btn:active { transform: scale(0.97); }

.form-btn-primary {
  background: var(--primary);
  color: #FFF;
}

.form-btn-danger {
  background: var(--danger);
  color: #FFF;
  margin-top: 8px;
}

.form-btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--border);
  margin-top: 8px;
}

/* ====== HISTORIAL ====== */
.sale-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin: 8px 16px;
  box-shadow: var(--shadow);
}

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

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

.sale-total {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}

.sale-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sale-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding: 4px 0;
}

.sale-item-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sale-item-qty {
  color: var(--text-light);
}

.sale-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* ====== DATE FILTER ====== */
.date-filter {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.date-filter::-webkit-scrollbar { display: none; }

.date-chip {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.date-chip.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #FFF;
}

/* ====== AJUSTES ====== */
.settings-section {
  padding: 16px;
}

.settings-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

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

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

.settings-item:active {
  background: var(--bg);
}

.settings-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-icon {
  font-size: 22px;
}

.settings-item-text h4 {
  font-size: 15px;
  font-weight: 600;
}

.settings-item-text p {
  font-size: 12px;
  color: var(--text-light);
}

.settings-arrow {
  color: var(--text-muted);
  font-size: 18px;
}

.settings-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0 4px 8px;
}

/* ====== CART DETAIL MODAL ====== */
.cart-detail-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

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

.cart-detail-icon { font-size: 28px; }

.cart-detail-info {
  flex: 1;
}

.cart-detail-info h4 { font-size: 15px; font-weight: 600; }
.cart-detail-info p { font-size: 13px; color: var(--text-light); }

.cart-detail-qty {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cart-qty-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-qty-btn:active {
  background: var(--primary);
  color: #FFF;
  border-color: var(--primary);
}

.cart-detail-price {
  font-weight: 700;
  font-size: 15px;
  min-width: 50px;
  text-align: right;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 0;
  font-size: 20px;
  font-weight: 800;
}

.cart-total-row span:last-child {
  color: var(--primary);
}

/* ====== PAYMENT KEYPAD ====== */
.payment-total-display {
  text-align: center;
  font-size: 15px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.payment-total-display strong {
  color: var(--text);
  font-size: 17px;
}

.payment-input-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  padding: 6px 0 2px;
}

.payment-sign {
  font-size: 26px;
  font-weight: 600;
  color: var(--text-light);
}

.payment-amount {
  font-size: 44px;
  font-weight: 800;
  color: var(--dark);
  min-width: 40px;
}

.payment-cambio {
  text-align: center;
  font-size: 16px;
  padding: 2px 0 8px;
  transition: color 0.2s;
}

.payment-cambio.positive {
  color: var(--accent);
}

.payment-cambio.positive strong {
  font-size: 20px;
}

.payment-cambio.negative {
  color: var(--danger);
  opacity: 0.6;
}

.payment-quick-amounts {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 2px 0 10px;
}

.payment-quick-btn {
  padding: 7px 16px;
  border-radius: 20px;
  border: 2px solid var(--border);
  background: var(--bg);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}

.payment-quick-btn.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #FFF;
}

.payment-quick-btn:active {
  transform: scale(0.93);
}

.payment-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 280px;
  margin: 0 auto 14px;
}

.pay-key {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  font-size: 24px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  transition: all 0.15s;
}

.pay-key:active {
  background: var(--primary);
  color: #FFF;
  transform: scale(0.92);
}

.pay-key-clear {
  background: rgba(231, 76, 60, 0.1);
  color: var(--danger);
  font-size: 15px;
  font-weight: 700;
}

.pay-key-clear:active {
  background: var(--danger);
  color: #FFF;
}

.pay-key-del {
  background: transparent;
  color: var(--text-light);
}

.pay-key-del:active {
  background: var(--border);
  color: var(--text);
}

.payment-confirm-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ====== CHECKOUT SUCCESS ====== */
.checkout-success {
  text-align: center;
  padding: 30px 20px;
}

.checkout-success-icon {
  font-size: 72px;
  margin-bottom: 12px;
  animation: popIn 0.5s ease;
}

@keyframes popIn {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.checkout-success h2 {
  font-size: 24px;
  margin-bottom: 16px;
}

.checkout-success .total {
  font-size: 36px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 24px;
}

.checkout-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.checkout-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.checkout-detail-label {
  font-size: 15px;
  color: var(--text-light);
}

.checkout-detail-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.checkout-detail-item.checkout-cambio {
  background: rgba(39, 174, 96, 0.1);
  border: 2px solid var(--accent);
}

.checkout-cambio .checkout-detail-label {
  color: var(--accent);
  font-weight: 700;
  font-size: 16px;
}

.cambio-amount {
  font-size: 28px;
  font-weight: 800;
  color: var(--accent);
}

/* ====== PRODUCT FILLING ASSIGN ====== */
.assign-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.assign-chip {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--bg);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.assign-chip.active {
  border-color: var(--accent);
  background: rgba(39, 174, 96, 0.1);
}

.assign-chip-icon { font-size: 24px; }
.assign-chip-name { font-size: 12px; font-weight: 600; margin-top: 4px; }

/* ====== STATS SUMMARY ====== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 16px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

/* ====== TOAST ====== */
.toast {
  position: fixed;
  top: calc(20px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--dark);
  color: #FFF;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 600;
  z-index: 300;
  transition: transform 0.3s ease;
  white-space: nowrap;
}

.toast.visible {
  transform: translateX(-50%) translateY(0);
}

/* ====== SCROLLBAR ====== */
#view-container::-webkit-scrollbar { width: 0; }

/* ====== WITH CART BAR - extra padding ====== */
#view-container.has-cart {
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 80px);
}

/* ====== CHECKBOX TOGGLE ====== */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.toggle-label { font-size: 14px; font-weight: 600; }

/* ====== No items message ====== */
.no-fillings-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 32px 16px;
  color: var(--text-light);
  font-size: 14px;
}

/* ====== PROMOCIONES ====== */

/* Tag en tabs de producto en vista Venta */
.tab-promo {
  background: var(--secondary);
  color: var(--dark);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  margin-left: 4px;
  white-space: nowrap;
}

.type-tab.active .tab-promo {
  background: rgba(255,255,255,0.3);
  color: #FFF;
}

/* Tags en lista de productos */
.promo-active-tag {
  color: var(--accent);
  font-weight: 700;
}

.promo-inactive-tag {
  color: var(--text-muted);
}

/* Boton promo activa en crud */
.crud-btn.promo-on {
  background: var(--secondary);
}

/* Selector de cantidad en promo form */
.promo-qty-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 8px 0;
}

/* Fila de promo aplicada en cart detail */
.promo-applied-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}

.promo-applied-icon {
  font-size: 18px;
}

.promo-applied-text {
  flex: 1;
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}

.promo-applied-saving {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

/* Subtotal tachado y ahorro en cart detail */
.cart-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0 0;
  font-size: 15px;
  color: var(--text-light);
}

.cart-subtotal-striked {
  text-decoration: line-through;
}

.cart-savings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

/* Badge de ahorro en cart bar */
.cart-bar-savings {
  background: var(--accent);
  color: #FFF;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  margin-left: 4px;
}

/* Texto de ahorro en checkout success */
.checkout-savings {
  color: var(--accent);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
}
