
:root {
  /* Colors - Taste Skill (Refined Warm Palette) */
  --primary-color: #e2725b; /* Terracotta */
  --accent-color: #d05d46;
  --success-color: #7b916a; /* Sage Green slightly deepened */
  --bg-color: #fdfaf6; /* Warmer, softer beige */
  --surface-color: #ffffff;
  --surface-muted: #f5f2ed;
  --text-primary: #2c2520; /* Deeper for better contrast */
  --text-secondary: #8c827a;
  --border-color: #e8e4dc;
  --border-light: rgba(0, 0, 0, 0.08);
  
  /* Shadows - Impeccable (Soft, multi-layered) */
  --shadow-sm: 0 2px 8px rgba(44, 37, 32, 0.04), 0 1px 2px rgba(44, 37, 32, 0.02);
  --shadow-md: 0 8px 24px rgba(44, 37, 32, 0.06), 0 2px 8px rgba(44, 37, 32, 0.04);
  --shadow-lg: 0 24px 48px rgba(44, 37, 32, 0.08), 0 12px 24px rgba(44, 37, 32, 0.04);
  --shadow-primary: 0 8px 24px rgba(226, 114, 91, 0.25), 0 2px 8px rgba(226, 114, 91, 0.15);

  /* Spacing - Impeccable (8px Grid System) */
  --space-1: 0.25rem; /* 4px */
  --space-2: 0.5rem;  /* 8px */
  --space-3: 0.75rem; /* 12px */
  --space-4: 1rem;    /* 16px */
  --space-6: 1.5rem;  /* 24px */
  --space-8: 2rem;    /* 32px */
  
  /* Radii - Consistent shape language */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;
  --radius-xl: 24px;

  /* Spacing extras */
  --space-12: 3rem;  /* 48px */

  /* Typography */
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  
  /* Animations - Emil Kowalski (Spring Physics) */
  --spring-snappy: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --spring-bouncy: cubic-bezier(0.34, 1.56, 0.64, 1.2);
  --spring-smooth: cubic-bezier(0.25, 1, 0.5, 1);
  --duration-fast: 200ms;
  --duration-normal: 400ms;
}

@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes popScale {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(-30px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes progressShrink {
  from { width: 100%; }
  to { width: 0%; }
}

.animate-slide-up {
  animation: slideUpFade var(--duration-normal) var(--spring-bouncy) both;
}

.glass-panel {
  background: rgba(253, 250, 246, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.8);
  box-shadow: var(--shadow-lg);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
  padding-bottom: 80px; 
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6, .title, .product-name, .category-title {
  font-family: var(--font-heading);
}

body.pos-layout {
  padding-bottom: 0;
  height: 100vh;
  overflow: hidden;
}

header {
  text-align: center;
  padding: var(--space-8) var(--space-4) var(--space-4) var(--space-4);
  background: var(--bg-color);
  position: relative;
  border-bottom: none;
}

/* Taste Skill: Subdued, elegant background pattern instead of heavy lines */
.pattern-bg {
  background-size: 40px 40px;
  background-image: radial-gradient(rgba(226, 114, 91, 0.05) 1px, transparent 1px);
  background-color: var(--bg-color);
}

.title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-color);
  letter-spacing: -0.02em;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-4);
}

.category-section {
  margin-bottom: var(--space-12);
}

.category-title {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-color); /* Impeccable: 1px solid instead of 2px heavy */
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  letter-spacing: -0.01em;
}

.category-title i {
  background-color: rgba(226, 114, 91, 0.08);
  color: var(--accent-color);
  width: 36px !important;
  height: 36px !important;
  padding: 8px;
  border-radius: var(--radius-pill);
  margin-right: 0 !important;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6); /* 24px gap */
}

.product-card {
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color); /* Impeccable definition */
  transition: transform var(--duration-normal) var(--spring-bouncy), box-shadow var(--duration-normal) var(--spring-smooth), border-color var(--duration-normal) var(--spring-smooth);
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  cursor: default;
  position: relative;
}

.out-of-stock {
  opacity: 0.6;
  cursor: not-allowed;
  position: relative;
  pointer-events: none;
}

.out-of-stock::after {
  content: 'Agotado';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.product-card:active {
  transform: scale(0.96);
  box-shadow: none;
}

.product-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-md);
  border-color: rgba(226, 114, 91, 0.2);
}

.product-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-image-container {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--surface-muted);
  border: 1px solid var(--border-color);
  position: relative;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--duration-normal) var(--spring-smooth);
}

.product-card:hover .product-image {
  transform: scale(1.05); /* Taste: subtle image scale on hover */
}

.product-name {
  font-size: 1.3rem; /* Aumentado */
  font-weight: 700;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
  line-height: 1.3;
}

.product-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  line-height: 1.4;
}

.price-list {
  list-style: none;
  margin-bottom: var(--space-3);
}

.price-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  margin-bottom: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px dashed var(--border-color);
}

.price-item:first-child {
  border-top: none;
  padding-top: 0;
}

.btn-add {
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--duration-normal) var(--spring-bouncy);
}

.btn-add:hover {
  background: var(--accent-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
}

.btn-add:active, .btn-add-full:active {
  transform: scale(0.92);
}

/* Radio Buttons Styles (Tip 1) */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.radio-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #faf8f5;
}

.radio-label:hover {
  border-color: var(--accent-color);
}

.radio-label input[type="radio"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  margin-right: 10px;
  position: relative;
  outline: none;
  cursor: pointer;
}

.radio-label input[type="radio"]:checked {
  border-color: var(--accent-color);
}

.radio-label input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  background: var(--accent-color);
  border-radius: 50%;
}

.radio-label.selected {
  border-color: var(--accent-color);
  background: rgba(214, 109, 74, 0.05);
}

.radio-text-container {
  display: flex;
  align-items: center;
}

.radio-price {
  font-weight: 700;
  color: var(--accent-color);
}

/* Add to Cart full width button */
.btn-add-full {
  width: 100%;
  background: var(--accent-color);
  color: white;
  border: none;
  padding: 0.8rem;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-add-full:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(226, 114, 91, 0.3);
}

/* Cart floating bar */
.cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--surface-color);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.cart-bar.visible {
  transform: translateY(0);
}

/* ====================
   NAV BOTTOM / TABS
   ==================== */
.nav-bottom {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 800px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: space-around;
  padding: var(--space-2) var(--space-4) var(--space-4) var(--space-4);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 -4px 32px rgba(44, 37, 32, 0.08);
  border-top: 1px solid var(--border-color);
  z-index: 100;
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  transition: transform var(--duration-normal) var(--spring-smooth);
}

.nav-item {
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--duration-normal) var(--spring-bouncy);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-lg);
  cursor: pointer;
}

.nav-item.active {
  color: var(--accent-color);
  background: rgba(226, 114, 91, 0.08);
  transform: translateY(-4px);
}

.nav-item:active {
  transform: scale(0.92);
}

.cart-info {
  display: flex;
  flex-direction: column;
}

.cart-total {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-color);
  letter-spacing: -0.02em;
}

.cart-items-count {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.btn-checkout {
  background: var(--success-color);
  color: white;
  border: none;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--duration-normal) var(--spring-bouncy);
  box-shadow: 0 4px 12px rgba(123, 145, 106, 0.3);
}

.btn-checkout:hover {
  background: #6e845e;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(123, 145, 106, 0.4);
}

.btn-checkout:active {
  transform: scale(0.94);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(44, 37, 32, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  justify-content: center;
  align-items: center;
  transition: opacity var(--duration-normal) var(--spring-smooth);
}

.modal.active {
  display: flex;
}

.modal-content {
  background: rgba(253, 250, 246, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  width: 90%;
  max-width: 450px;
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUpFade var(--duration-normal) var(--spring-bouncy);
  border: 1px solid rgba(255,255,255,0.8);
}

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

.modal-header h2 {
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.btn-close {
  background: rgba(44, 37, 32, 0.05);
  color: var(--text-secondary);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast) var(--spring-smooth);
}

.btn-close:hover {
  background: rgba(44, 37, 32, 0.1);
  color: var(--text-primary);
  transform: rotate(90deg);
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px dashed var(--border-color);
  animation: slideUpFade var(--duration-normal) var(--spring-bouncy) both;
}

/* Stagger entrance for cart items */
.cart-item:nth-child(1) { animation-delay: 50ms; }
.cart-item:nth-child(2) { animation-delay: 100ms; }
.cart-item:nth-child(3) { animation-delay: 150ms; }
.cart-item:nth-child(4) { animation-delay: 200ms; }

.cart-item-info h4 {
  font-size: 1.1rem;
  margin-bottom: var(--space-1);
  color: var(--text-primary);
  font-weight: 600;
}

.cart-item-price {
  font-weight: 700;
  color: var(--accent-color);
}

/* Checkout Form Styles (Tips 2 & 3) */
.checkout-form {
  margin-top: var(--space-6);
}

.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: var(--space-2);
  color: var(--text-primary);
}

.form-help {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: var(--space-1);
}

.form-control {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: all var(--duration-fast) var(--spring-smooth);
  box-shadow: inset 0 2px 4px rgba(44, 37, 32, 0.02);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: inset 0 2px 4px rgba(44, 37, 32, 0.02), 0 0 0 3px rgba(226, 114, 91, 0.15);
}

.form-control.input-short {
  width: 120px;
  text-align: center;
}

.form-control.input-long {
  width: 100%;
  resize: vertical;
  min-height: 80px;
}

.btn-submit-order {
  width: 100%;
  background: var(--success-color);
  color: white;
  border: none;
  padding: var(--space-4);
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 1.1rem;
  cursor: pointer;
  margin-top: var(--space-4);
  transition: all var(--duration-normal) var(--spring-bouncy);
  box-shadow: 0 4px 16px rgba(123, 145, 106, 0.3);
}
.btn-submit-order:hover {
  background: #6e845e;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(123, 145, 106, 0.4);
}
.btn-submit-order:active {
  transform: scale(0.96);
}

/* Admin Panel */
.admin-container {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.order-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.order-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.order-card.new {
  animation: highlight 2s infinite alternate;
}

@keyframes highlight {
  from { border-color: var(--border-color); }
  to { border-color: var(--accent-color); box-shadow: 0 0 10px rgba(214, 109, 74, 0.3); }
}

.order-header {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.8rem;
  margin-bottom: 1rem;
}

.order-table {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-color);
}

.order-time {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.order-items {
  list-style: none;
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--text-primary);
}

.order-items li {
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border-color);
}

.btn-complete {
  width: 100%;
  background: var(--success-color);
  color: white;
  border: none;
  padding: 1rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

.admin-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
}



.sales-summary {
  background: var(--surface-color);
  padding: 0.8rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

/* POS Contingencia */
.pos-container {
  display: flex;
  height: 100vh;
  width: 100%;
  flex-direction: row-reverse; /* Estilo Odoo: Boleta a la izquierda */
  background: var(--surface-color); /* Fondo gris claro */
}

.pos-menu-section {
  flex: 1;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  overflow-y: hidden;
}

.pos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0 !important;
  background: transparent !important;
  border: none;
}

.pos-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}



.btn-category {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}

.btn-category.active {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.pos-product-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.2rem;
  padding-bottom: 2rem;
  align-items: start;
}

.pos-ticket-section {
  width: 380px;
  background: var(--bg-color); /* Fondo blanco para el ticket */
  border-right: 1px solid var(--border-color); /* Borde a la derecha ahora */
  box-shadow: 2px 0 10px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.ticket-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-color);
}

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

.ticket-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-color);
}

.ticket-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.pos-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.pos-actions button {
  flex: 1;
  padding: 1rem;
  border-radius: 8px;
  border: none;
  font-weight: 700;
  cursor: pointer;
}

/* POS specific product card tweaks */
.pos-product-card {
  background: var(--surface-color);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  padding: 0 0 0.5rem 0;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 230px;
  overflow: hidden;
}

.pos-product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.pos-product-card img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.pos-product-card-body {
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  flex: 1 1 auto;
  gap: 0.4rem;
}

.pos-product-card h4 {
  font-family: var(--font-secondary);
  color: var(--text-primary);
  font-size: 0.9rem;
  margin: 0;
  min-height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
}

.pos-product-card p {
  color: var(--accent-color);
  font-weight: 700;
  font-size: 1rem;
}

.pos-flavor-select {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.4rem 0.5rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-primary);
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23d05d46' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 16px;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pos-flavor-select:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px rgba(208, 93, 70, 0.2);
}

.pos-flavor-select:hover {
  border-color: rgba(208, 93, 70, 0.5);
}

/* Icon & Visual Richness Styles */
.lucide {
  width: 24px;
  height: 24px;
  stroke-width: 2;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pattern-bg {
  position: relative;
  /* overflow: hidden removed to fix dropdowns */
}
.pattern-bg::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(var(--border-color) 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.5;
  z-index: 0;
}
.pattern-bg > * {
  position: relative;
  z-index: 1;
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.header-icon {
  width: 40px;
  height: 40px;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
}
.empty-icon {
  width: 64px;
  height: 64px;
  color: var(--border-color);
  margin-bottom: 1rem;
}

/* Toast Notifications Premium */
.toast-container {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  pointer-events: none;
}
.toast {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  animation: toastSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, fadeOut 0.4s ease 2.6s forwards;
  opacity: 0;
  border: 1px solid rgba(255,255,255,0.6);
  position: relative;
  overflow: hidden;
}
.toast::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--success-color);
  animation: progressShrink 2.6s linear forwards;
}
.toast-icon {
  background: var(--success-color);
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}
@keyframes slideDown {
  from { transform: translateY(-50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-20px) scale(0.9); }
}

/* Extras / Agregados Checkboxes */
.extras-group {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-color);
}
.extras-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.extras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.checkbox-label input {
  accent-color: var(--accent-color);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* Builder Modal Styles */
.builder-content {
  width: 95%;
  max-width: 600px;
  height: 85vh; /* Alto casi completo tipo App */
}

.builder-step-title {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin: 1.5rem 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 2px dashed var(--border-color);
  padding-bottom: 0.5rem;
}

.builder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
}

.builder-card-radio {
  display: none;
}

.builder-card-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1rem;
  background: var(--surface-color);
  border: 2px solid var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  height: 100%;
  position: relative;
  user-select: none;
}

.builder-card-label:active {
  transform: scale(0.96);
}

.builder-card-radio:checked + .builder-card-label {
  border-color: var(--accent-color) !important;
  border-width: 2.5px;
  background: rgba(226, 114, 91, 0.14) !important;
  box-shadow: 0 0 0 1px var(--accent-color), 0 4px 12px rgba(226, 114, 91, 0.22);
}

.builder-card-radio:checked + .builder-card-label::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 8px;
  width: 20px;
  height: 20px;
  background: var(--accent-color);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
}

.builder-card-label i {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.builder-card-radio:checked + .builder-card-label i {
  color: var(--accent-color);
}

.builder-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  color: var(--text-primary);
}

.builder-card-price {
  font-size: 0.75rem;
  color: var(--accent-color);
  font-weight: 700;
}

.builder-extras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.8rem;
}

.builder-select {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface-color);
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.builder-select:focus {
  outline: none;
  border-color: var(--accent-color);
}

/* Navegación y Búsqueda */
.search-container {
  margin-top: 1rem;
  position: relative;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  width: 20px;
  height: 20px;
}

.search-input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 2.8rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--surface-color);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-color);
}

.sticky-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253, 251, 247, 0.95);
  backdrop-filter: blur(8px);
  padding: 0.8rem 1rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

/* Barra de scroll sutil para indicar que se puede deslizar */
.sticky-nav {
  scrollbar-width: thin;
  scrollbar-color: #D9D7D2 transparent;
}
html.dark-theme .sticky-nav {
  scrollbar-color: #45403D transparent;
}

.sticky-nav::-webkit-scrollbar {
  height: 4px; /* Barra delgada */
}
.sticky-nav::-webkit-scrollbar-track {
  background: transparent;
}
.sticky-nav::-webkit-scrollbar-thumb {
  background-color: #D9D7D2;
  border-radius: 10px;
}
html.dark-theme .sticky-nav::-webkit-scrollbar-thumb {
  background-color: #45403D;
}

.nav-pill {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.75rem;
  white-space: nowrap;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
  text-decoration: none; /* las píldoras pueden ser <a> */
}

.nav-pill i {
  width: 16px;
  height: 16px;
}

.nav-pill.active {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.nav-pill.active i {
  color: white;
}

/* Print Styles (80mm Thermal Printer) */
@media print {
  @page {
    margin: 0; /* Elimina cabecera y pie de página del navegador (fecha y URL) */
  }
  body * {
    visibility: hidden;
  }
  
  #print-section, #print-section * {
    visibility: visible;
  }
  
  #print-section {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    max-width: 53mm; /* Adjusted for 58mm paper */
    margin: 0; /* Left aligned because the 58mm paper is on the left side of the 80mm printer */
    font-family: 'Inter', sans-serif;
    color: #000;
  }

  .print-container {
    padding: 2px 5px; /* Minimal padding since max-width handles the margins */
    background: var(--surface-color);
  }

  /* Reset colors for printing */
  .pattern-bg::before { display: none; }
  
  .print-header {
    text-align: center;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .print-title {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    letter-spacing: 1px;
  }

  .print-subtitle {
    font-size: 12px;
    margin: 2px 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #444;
  }

  .print-info-grid {
    width: 100%;
    text-align: left;
    font-size: 13px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #ccc;
  }

  .print-info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
  }

  .print-items-header {
    display: flex;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 5px;
  }

  .print-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 4px;
    align-items: flex-start;
  }

  .print-divider {
    border-top: 1px dashed #000;
    margin: 10px 0;
  }

  .print-summary {
    margin-top: 15px;
  }

  .text-muted {
    font-size: 12px;
  }

  .print-total-main {
    font-weight: 900;
    font-size: 16px;
    margin-top: 8px;
    padding-top: 8px;
  }

  .print-total-final {
    font-weight: 900;
    font-size: 18px;
    margin-top: 8px;
  }

  .print-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .qr-placeholder {
    margin: 10px 0;
  }
}

/* ==========================================================================
   KDS Kanban Board Styles
   ========================================================================== */
.kds-board {
  height: calc(100vh - 120px);
  overflow: hidden;
}

.kds-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--surface-color);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  height: 100%;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.kds-header {
  padding: 1rem 1.5rem;
  border-bottom: 2px solid transparent;
  background: var(--surface-color);
}

.kds-header h2 {
  margin: 0;
  font-size: 1.2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kds-count {
  background: var(--bg-color);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.kds-header.nuevo { border-bottom-color: #ef4444; }
.kds-header.nuevo h2 { color: #ef4444; }

.kds-header.preparacion { border-bottom-color: #f59e0b; }
.kds-header.preparacion h2 { color: #f59e0b; }

.kds-header.listos { border-bottom-color: #10b981; }
.kds-header.listos h2 { color: #10b981; }

.kds-list {
  padding: 1rem;
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-color);
}

.kds-card {
  background: var(--surface-color);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: slideIn 0.3s ease-out forwards;
}

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

.kds-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bg-color);
}

.kds-card-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.kds-card-time {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.kds-card-items {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
  max-height: 180px;
  overflow-y: auto;
}
.kds-card-items::-webkit-scrollbar {
  width: 4px;
}
.kds-card-items::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.kds-card-items li {
  padding: 0.3rem 0;
  font-size: 0.95rem;
  border-bottom: 1px dashed var(--border-color);
}
.kds-card-items li:last-child { border-bottom: none; }

.kds-btn {
  width: 100%;
  padding: 0.8rem;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 0.2s;
}
.kds-btn:hover { opacity: 0.9; }

.kds-btn-nuevo { background: #fee2e2; color: #b91c1c; }
.kds-btn-preparacion { background: #fef3c7; color: #b45309; }
.kds-btn-listo { background: #d1fae5; color: #047857; }

/* Historial Modal */
.historial-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 0.8rem;
}
.historial-info h4 { margin: 0 0 0.3rem 0; font-size: 1.1rem; }
.historial-info p { margin: 0; font-size: 0.9rem; color: var(--text-secondary); }

/* Hamburger Menu */
.hamburger-container {
  position: relative;
  display: inline-block;
}
.btn-hamburger {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: 8px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-hamburger:hover {
  background: var(--border-color);
}
.hamburger-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 110%;
  background: var(--surface-color);
  width: 320px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.15);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  z-index: 1000;
  padding: 0.75rem;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 90vh;
  overflow-y: auto;
}
.hamburger-dropdown.show {
  display: flex;
}

/* Grid de 2 columnas para los ítems del menú */
.hamburger-dropdown .menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.3rem;
}

/* Botones dentro del grid */
.hamburger-dropdown a,
.hamburger-dropdown button {
  padding: 0.55rem 0.75rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-primary);
  font-weight: 500;
  background: var(--bg-color);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: 0.82rem;
  transition: background 0.15s, border-color 0.15s;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hamburger-dropdown a svg,
.hamburger-dropdown button svg {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
}
.hamburger-dropdown a:hover,
.hamburger-dropdown button:hover {
  background: var(--border-color);
  border-color: var(--border-color);
}

/* Separador de sección */
.hamburger-dropdown .menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.2rem 0;
}

/* Botones de acción (ancho completo) */
.hamburger-dropdown .menu-action-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.3rem;
}

/* Estilos específicos */
.hamburger-dropdown button#btn-open-gasto {
  color: #e53e3e;
}
.hamburger-dropdown button#btn-open-gasto:hover {
  background: rgba(229, 62, 62, 0.08);
}
.hamburger-dropdown button#btn-close-shift {
  color: #e53e3e;
  font-weight: 600;
  border-color: rgba(229, 62, 62, 0.2);
}
.hamburger-dropdown button#btn-close-shift:hover {
  background: rgba(229, 62, 62, 0.08);
}
.hamburger-dropdown button#btn-toggle-delivery {
  font-weight: 600;
}


@media (max-width: 360px) {
  .hamburger-dropdown {
    width: min(320px, 92vw);
    right: 0;
  }
}

/* POS Search Bar */
.pos-search-container {
  display: flex;
  align-items: center;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0 1rem;
  margin-bottom: 1rem;
  height: 42px;
}
.pos-search-input {
  border: none;
  background: transparent;
  width: 100%;
  padding: 0.5rem;
  outline: none;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-primary);
}

/* Fix for dropdowns being cut off by headers */
header { overflow: visible !important; z-index: 50 !important; }

.pos-container { overflow: hidden; }

/* Segmented Control for Order Type */
.order-type-container {
    display: flex;
    background: var(--bg-color);
    padding: 0.3rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.order-type-label {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem;
    cursor: pointer;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.7;
}

.order-type-label input[type="radio"] {
    display: none;
}

.order-type-label:has(input[type="radio"]:checked) {
    background: var(--accent-color);
    color: white;
    opacity: 1;
    box-shadow: 0 4px 10px rgba(192, 107, 62, 0.3);
}

.order-type-label:has(input[type="radio"]:checked) i {
    color: white;
}

/* SKELETON SCREENS (UX Psychology) */
@keyframes shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}

.skeleton-box {
    background: #f6f7f8;
    background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-repeat: no-repeat;
    background-size: 800px 100%;
    animation-duration: 1.5s;
    animation-fill-mode: forwards;
    animation-iteration-count: infinite;
    animation-name: shimmer;
    animation-timing-function: linear;
    border-radius: 8px;
}

.skeleton-card {
    display: flex;
    flex-direction: column;
    height: 160px;
    padding: 0;
    overflow: hidden;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.skeleton-card .s-img {
    height: 100px;
    width: 100%;
    border-radius: 0;
}

.skeleton-card .s-text {
    height: 14px;
    margin: 10px;
    width: 70%;
}

.skeleton-card .s-price {
    height: 16px;
    margin: 0 10px;
    width: 40%;
}

/* ANIMACIONES AVANZADAS (Motion UI - Spring Physics) */

/* 1. Staggered Slide Up con efecto Spring (Resorte) */
@keyframes slideUpSpring {
    0% { 
        opacity: 0; 
        transform: translateY(40px) scale(0.95); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.pos-product-card, .product-card {
    /* Mantenemos solo transform y opacity como indicó el manual */
    animation: slideUpSpring 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
    /* La variable CSS --stagger-idx se inyectará desde JS */
    animation-delay: calc(var(--stagger-idx, 0) * 40ms);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
}

/* 2. Micro-interacciones Táctiles (Shrink on Active) */
.pos-product-card:active, .product-card:active {
    transform: scale(0.92) !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important;
    transition: transform 0.1s ease-out;
}

.action-btn:active, .btn-pay-cash:active, .btn-pay-card:active, .btn-add-cart:active, .category-btn:active {
    transform: scale(0.94);
    transition: transform 0.1s ease-out;
}

/* 3. Pop del Carrito (Atención Visual) */
@keyframes cartBounce {
    0% { transform: scale(1); }
    40% { transform: scale(1.15); color: var(--accent-color); text-shadow: 0 0 10px rgba(226,114,91,0.5); }
    100% { transform: scale(1); }
}

.cart-pop {
    animation: cartBounce 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 4. Modales Elásticos */
.modal-content {
    transform: scale(0.95) translateY(20px);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
    will-change: transform, opacity;
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* ANIMACION DEL MENU HAMBURGUESA */
@keyframes dropdownFade {
  0% { 
    opacity: 0; 
    transform: translateY(-15px) scale(0.95); 
  }
  100% { 
    opacity: 1; 
    transform: translateY(0) scale(1); 
  }
}

.hamburger-dropdown.show {
  display: flex !important;
  animation: dropdownFade 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  transform-origin: top right;
}

.btn-hamburger i, .btn-hamburger svg {
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.btn-hamburger.menu-open i, .btn-hamburger.menu-open svg {
  transform: rotate(90deg) scale(1.1);
}

/* =========================================
   MASTERCLASS MICROINTERACCIONES & FISICAS
   ========================================= */

/* 1. KDS Cards (Cocina) - Entrada elástica */
@keyframes popInElastic {
  0% { transform: scale(0.9) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.kds-card {
  animation: popInElastic 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
  will-change: transform, opacity;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease !important;
}
.kds-card:hover {
  transform: translateY(-4px) scale(1.02) !important;
}

/* 2. Todos los Inputs, Selects y Textareas - Respiración y Glow */
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease, border-color 0.2s ease !important;
}
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
  transform: scale(1.015);
  box-shadow: 0 0 0 4px rgba(226, 114, 91, 0.15) !important;
  border-color: var(--accent-color) !important;
  outline: none;
}

/* 3. Botones Flotantes y de Categoría - Tacto gomoso */
.btn-category {
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s, color 0.2s !important;
}
.btn-category:active, .nav-item:active {
  transform: scale(0.92) !important;
}
.btn-category:not(.active):hover {
  transform: translateY(-3px) !important;
}

/* 4. Cart Bar (Menú Cliente) - Aparición en resorte */
.cart-bar {
  transition: transform 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

/* 5. Iconos que reaccionan al mouse (Giran o escalan sutilmente) */
button:hover i[data-lucide], button:hover svg {
  transform: scale(1.15) rotate(5deg);
}
button i[data-lucide], button svg {
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 6. Modales (Background Fade Suave) */
@keyframes fadeInOverlay {
  from { background-color: rgba(0, 0, 0, 0); backdrop-filter: blur(0px); }
  to { background-color: rgba(0, 0, 0, 0.4); backdrop-filter: blur(4px); }
}
.modal.active {
  animation: fadeInOverlay 0.4s ease forwards !important;
}

/* 7. Tickets y Notificaciones (Pop-in y Fade) */
@keyframes popToast {
  0% { transform: translateY(30px) scale(0.8); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}
.toast {
  animation: popToast 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both !important;
}

/* 8. Segmented Controls (Para Servir / Llevar) */
.order-type-container label {
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s, box-shadow 0.2s !important;
}
.order-type-container:has(input:checked) label:active {
  transform: scale(0.95);
}
.order-type-container input:checked + label {
  transform: scale(1.02);
}

/* 9. Componentes "Chips" para Sabores y Tamaños */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: center;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}
.chip {
  background: var(--surface-muted);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  user-select: none;
}
.chip:hover {
  background: var(--border-color);
  transform: translateY(-2px);
}
.chip:active {
  transform: scale(0.9);
}
.chip.active {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
  box-shadow: 0 4px 10px rgba(226, 114, 91, 0.3);
  transform: scale(1.05);
}

/* 10. Modal de Opciones (POS) */
.big-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.8rem;
}
.big-option-btn {
    background: var(--surface-muted);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 1rem 0.5rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    user-select: none;
}
.big-option-btn:active {
    transform: scale(0.95);
}
.big-option-btn.active {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(226, 114, 91, 0.3);
    transform: scale(1.05);
}


.reporte-tab {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0.4rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.reporte-tab.active {
  background: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

/* ============================================================
   ✨ VISUAL ENHANCEMENTS LAYER — Café Amor Ángela
   Animaciones, brillo, microinteracciones y pulido visual
   ============================================================ */

/* --- 1. NUEVAS KEYFRAMES --- */
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(226,114,91,0.0); }
  50%       { box-shadow: 0 0 0 8px rgba(226,114,91,0.15); }
}
@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-4px); }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.92) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes borderPulse {
  0%, 100% { border-color: var(--border-color); }
  50%       { border-color: rgba(226,114,91,0.4); }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes ticketItemIn {
  from { opacity: 0; transform: translateX(-12px) scale(0.96); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes categoryBtnActive {
  0%   { transform: scale(1); }
  40%  { transform: scale(0.88); }
  70%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}
@keyframes successPop {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.15) rotate(-2deg); }
  60%  { transform: scale(0.95) rotate(1deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

/* --- 2. FONDO MEJORADO — patrón sutil animado --- */
body.pos-layout {
  background: linear-gradient(135deg, #fdfaf6 0%, #f8f4ee 50%, #fdf6f0 100%);
}

/* Fondo del menú web con patrón sutil */
body.pattern-bg {
  background-image: 
    radial-gradient(rgba(226,114,91,0.04) 1px, transparent 1px),
    radial-gradient(rgba(226,114,91,0.02) 1px, transparent 1px);
  background-size: 40px 40px, 20px 20px;
  background-position: 0 0, 10px 10px;
}

/* --- 3. TARJETAS POS — profundidad, brillo en hover --- */
.pos-product-card {
  background: 
    linear-gradient(145deg, #ffffff 0%, #fdfaf6 100%) !important;
  border: 1px solid rgba(232,228,220,0.8) !important;
  transition: 
    transform 220ms cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 220ms ease,
    border-color 220ms ease !important;
  will-change: transform;
}

.pos-product-card:hover {
  transform: translateY(-5px) scale(1.015) !important;
  box-shadow: 
    0 12px 32px rgba(44,37,32,0.1),
    0 4px 8px rgba(44,37,32,0.06),
    0 0 0 1px rgba(226,114,91,0.1) !important;
  border-color: rgba(226,114,91,0.25) !important;
}

.pos-product-card img {
  transition: transform 400ms cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.pos-product-card:hover img {
  transform: scale(1.08) !important;
}

/* Animación de entrada escalonada de las tarjetas */
.pos-product-card.animate-slide-up {
  animation: fadeInScale 350ms var(--spring-bouncy) both;
  animation-delay: calc(var(--stagger-idx, 0) * 45ms);
}

/* --- 4. BOTONES DE CATEGORÍA — splash animado --- */
.btn-category {
  position: relative;
  overflow: hidden;
  transition:
    background 200ms var(--spring-bouncy),
    color 200ms ease,
    transform 200ms var(--spring-snappy),
    box-shadow 200ms ease !important;
  font-size: 0.85rem;
}

.btn-category::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 400ms ease;
}

.btn-category:hover::before {
  transform: translateX(100%);
}

.btn-category.active {
  background: linear-gradient(135deg, #e2725b 0%, #c9563e 100%) !important;
  box-shadow: 0 4px 14px rgba(226,114,91,0.35), 0 2px 4px rgba(226,114,91,0.2) !important;
  transform: scale(1.04) !important;
}

.btn-category:not(.active):hover {
  background: rgba(226,114,91,0.07) !important;
  border-color: rgba(226,114,91,0.25) !important;
  transform: translateY(-1px) !important;
}

/* --- 5. SIDEBAR DEL TICKET — gradiente suave --- */
.pos-ticket-section {
  background: linear-gradient(180deg, #ffffff 0%, #fdf8f4 100%) !important;
  border-left: 1px solid rgba(232,228,220,0.6) !important;
  box-shadow: -4px 0 20px rgba(44,37,32,0.04) !important;
}

/* Ítem del ticket con animación de entrada */
.ticket-item {
  animation: ticketItemIn 250ms var(--spring-bouncy);
  border-radius: 8px;
  transition: background 200ms ease;
}

.ticket-item:hover {
  background: rgba(226,114,91,0.04);
}

/* Total con animación de conteo */
#ticket-total, .pos-total-price {
  animation: countUp 300ms var(--spring-bouncy);
  display: inline-block;
}

/* --- 6. BOTÓN GUARDAR BOLETA — gradiente animado --- */
.btn-guardar, #btn-guardar, button[onclick*="guardar"] {
  background: linear-gradient(135deg, #7b916a, #6e845e) !important;
  background-size: 200% 200% !important;
  transition: all 250ms var(--spring-bouncy) !important;
  position: relative;
  overflow: hidden;
}

.btn-guardar:hover, #btn-guardar:hover {
  background: linear-gradient(135deg, #6e845e, #5f7550) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(123,145,106,0.4) !important;
}

/* --- BOTONES DE ACCIÓN Y COBRO POS (ERGONOMÍA VISUAL) --- */
#btn-send-kitchen {
  background: linear-gradient(135deg, #4f772d, #31572c) !important;
  color: #ffffff !important;
}
#btn-send-kitchen:hover {
  background: linear-gradient(135deg, #598334, #396332) !important;
  box-shadow: 0 4px 12px rgba(49, 87, 44, 0.4) !important;
}

#btn-pay-cash {
  background: linear-gradient(135deg, #16a34a, #15803d) !important;
  color: #ffffff !important;
}
#btn-pay-cash:hover {
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.4) !important;
}

#btn-pay-card {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  color: #ffffff !important;
}
#btn-pay-card:hover {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.4) !important;
}

#btn-pay-pluxee {
  background: linear-gradient(135deg, #ea580c, #c2410c) !important;
  color: #ffffff !important;
}
#btn-pay-pluxee:hover {
  background: linear-gradient(135deg, #f97316, #ea580c) !important;
  box-shadow: 0 4px 12px rgba(194, 65, 12, 0.4) !important;
}

#btn-pay-transferencia {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  color: #ffffff !important;
}
#btn-pay-transferencia:hover {
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
  box-shadow: 0 4px 12px rgba(3, 105, 161, 0.4) !important;
}

#btn-pay-mixed {
  background: linear-gradient(135deg, #475569, #334155) !important;
  color: #ffffff !important;
}
#btn-pay-mixed:hover {
  background: linear-gradient(135deg, #64748b, #475569) !important;
  box-shadow: 0 4px 12px rgba(51, 65, 85, 0.4) !important;
}

#btn-pay-fiado {
  background: linear-gradient(135deg, #d97706, #b45309) !important;
  color: #ffffff !important;
}
#btn-pay-fiado:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  box-shadow: 0 4px 12px rgba(180, 83, 9, 0.4) !important;
}

/* --- 7. BOTONES DE ACCIÓN — micro-bounce --- */
.action-btn, .btn-pay-cash, .btn-pay-card {
  transition: 
    transform 180ms var(--spring-snappy),
    box-shadow 180ms ease,
    background 180ms ease !important;
}

.action-btn:hover, .btn-pay-cash:hover, .btn-pay-card:hover {
  transform: translateY(-2px) scale(1.02) !important;
}

/* --- 8. MODAL — entrada más suave y elegante --- */
.modal-content {
  animation: fadeInScale 350ms cubic-bezier(0.34, 1.56, 0.64, 1) both !important;
}

/* Backdrop glass más bonito */
.modal.active {
  backdrop-filter: blur(10px) saturate(160%) !important;
  -webkit-backdrop-filter: blur(10px) saturate(160%) !important;
  background: rgba(44, 37, 32, 0.35) !important;
}

/* --- 9. TARJETAS DEL MENÚ WEB --- */
.product-card {
  transition:
    transform 220ms cubic-bezier(0.175, 0.885, 0.32, 1.275),
    box-shadow 220ms ease,
    border-color 220ms ease !important;
  will-change: transform;
}

.product-card:hover {
  transform: translateY(-5px) scale(1.01) !important;
  box-shadow: 
    0 16px 40px rgba(44,37,32,0.1),
    0 4px 12px rgba(44,37,32,0.06),
    0 0 0 1px rgba(226,114,91,0.08) !important;
  border-color: rgba(226,114,91,0.18) !important;
}

/* --- 10. CHIPS DE SABORES — efecto selección elegante --- */
.chip {
  transition:
    background 180ms var(--spring-bouncy),
    color 180ms ease,
    transform 180ms var(--spring-snappy),
    box-shadow 180ms ease !important;
  cursor: pointer;
}

.chip.active {
  background: linear-gradient(135deg, #e2725b 0%, #c9563e 100%) !important;
  color: white !important;
  box-shadow: 0 3px 10px rgba(226,114,91,0.3) !important;
  transform: scale(1.05) !important;
}

.chip:hover:not(.active) {
  transform: scale(1.04) translateY(-1px) !important;
  border-color: rgba(226,114,91,0.3) !important;
}

/* --- 11. BOTÓN AGREGAR AL CARRITO — shimmer en hover --- */
.btn-add {
  position: relative;
  overflow: hidden;
  transition: all 220ms var(--spring-bouncy) !important;
}

.btn-add::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
  background-size: 200% 100%;
  transform: translateX(-100%);
  transition: none;
}

.btn-add:hover::after {
  animation: shimmer 600ms ease forwards;
}

.btn-add:hover {
  transform: translateY(-2px) scale(1.04) !important;
  box-shadow: 0 6px 18px rgba(226,114,91,0.3) !important;
}

/* --- 12. INPUT FOCUS — animación elegante --- */
input:focus, select:focus, textarea:focus {
  outline: none !important;
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 0 3px rgba(226,114,91,0.12), inset 0 2px 4px rgba(44,37,32,0.02) !important;
  transition: all 200ms ease !important;
}

/* --- 13. HEADER POS — sutil sombra inferior --- */
.pos-header {
  position: relative;
}

.pos-header::after {
  content: '';
  position: absolute;
  bottom: -1rem;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.5), transparent);
  pointer-events: none;
}

/* --- 14. OPCIONES MODAL (tamaños/sabores) — hover premium --- */
.big-option-btn {
  transition: 
    all 200ms cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  position: relative;
  overflow: hidden;
}

.big-option-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 200ms ease;
}

.big-option-btn:hover::before { opacity: 1; }

.big-option-btn:hover:not(.active) {
  background: rgba(226,114,91,0.07) !important;
  border-color: rgba(226,114,91,0.3) !important;
  transform: translateY(-2px) scale(1.03) !important;
}

.big-option-btn.active {
  background: linear-gradient(135deg, #e2725b 0%, #c9563e 100%) !important;
  box-shadow: 0 6px 18px rgba(226,114,91,0.35), 0 2px 6px rgba(226,114,91,0.2) !important;
  transform: scale(1.06) !important;
}

/* --- 15. SCROLLBAR — elegante y coherente --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(226,114,91,0.25);
  border-radius: 999px;
  transition: background 200ms ease;
}
::-webkit-scrollbar-thumb:hover { background: rgba(226,114,91,0.5); }

/* --- 16. ORDEN NUEVA — pulso animado más llamativo --- */
.order-card.new {
  animation: borderPulse 1.8s ease-in-out infinite !important;
}

/* --- 17. NAVEGACIÓN MENÚ WEB — píldoras premium --- */
.nav-pill {
  transition: 
    all 220ms var(--spring-bouncy) !important;
  position: relative;
  overflow: hidden;
}

.nav-pill::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 100%;
  height: 2px;
  background: var(--accent-color);
  transition: transform 220ms var(--spring-bouncy);
  border-radius: 999px;
}

.nav-pill.active {
  color: var(--accent-color) !important;
  background: rgba(226,114,91,0.08) !important;
  border-color: rgba(226,114,91,0.2) !important;
  transform: scale(1.04) !important;
}

.nav-pill:hover:not(.active) {
  transform: translateY(-1px) !important;
  background: rgba(226,114,91,0.05) !important;
}

/* --- 18. FOTO EN MODAL — aparece con zoom suave --- */
#options-modal-image {
  transition: 
    opacity 300ms ease,
    transform 350ms var(--spring-bouncy) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 24px rgba(44,37,32,0.15) !important;
}

/* --- 19. TÍTULO DEL HEADER ADMIN/POS --- */
.pos-header h1, .admin-title, .pos-header .title {
  background: linear-gradient(135deg, #e2725b 0%, #c9563e 60%, #b54530 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- 20. TOAST / NOTIFICACIONES --- */
.toast-notification, .toast {
  border-left: 3px solid var(--accent-color) !important;
  backdrop-filter: blur(12px) !important;
}

/* --- 21. TABLA DE ÍTEMS DEL TICKET — divisor sutil --- */
.ticket-items-list li, .ticket-item {
  border-bottom: 1px dashed rgba(232,228,220,0.6) !important;
  padding: 0.4rem 0 !important;
}

/* --- 22. BADGES de estado (NUEVO, EN COCINA, etc.) --- */
[class*="status-"], .badge-nuevo, .badge-en-cocina {
  animation: fadeInScale 300ms var(--spring-bouncy);
}

/* --- 23. ANIMACION para elementos que aparecen dinámicamente --- */
.animate-in {
  animation: fadeInScale 280ms var(--spring-bouncy) both;
}

/* --- 24. BOTONES LUCIDE ICON — hover sutil --- */
.btn-icon {
  transition: 
    transform 180ms var(--spring-snappy),
    background 180ms ease,
    color 180ms ease !important;
}

.btn-icon:hover {
  transform: scale(1.12) !important;
  background: rgba(226,114,91,0.1) !important;
  color: var(--accent-color) !important;
}

/* --- 25. SUMMARY VENTAS DEL DIA — tarjeta pulida --- */
.sales-summary {
  background: linear-gradient(135deg, #ffffff 0%, #fdf8f4 100%) !important;
  border: 1px solid rgba(232,228,220,0.7) !important;
  box-shadow: 0 4px 16px rgba(44,37,32,0.05) !important;
  transition: box-shadow 200ms ease !important;
}

.sales-summary:hover {
  box-shadow: 0 8px 28px rgba(44,37,32,0.08) !important;
}


/* Dark Theme Overrides */
html.dark-theme {
  --bg-color: #1a1614;
  --surface-color: #241f1c;
  --surface-muted: #2d2623;
  --text-primary: #fdfaf6;
  --text-secondary: #b5a89f;
  --border-color: #3d342f;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 24px 48px rgba(0,0,0,0.6);
}

.btn-theme-toggle {
  transition: transform 0.2s;
}
.btn-theme-toggle:hover {
  transform: scale(1.1);
  color: var(--accent-color) !important;
}

/* Dark Theme Overrides */
html.dark-theme {
  --bg-color: #1a1614;
  --surface-color: #241f1c;
  --surface-muted: #2d2623;
  --text-primary: #fdfaf6;
  --text-secondary: #b5a89f;
  --border-color: #3d342f;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.5);
  --shadow-lg: 0 24px 48px rgba(0,0,0,0.6);
}

.btn-theme-toggle {
  transition: transform 0.2s;
}
.btn-theme-toggle:hover {
  transform: scale(1.1);
  color: var(--accent-color) !important;
}

html.dark-theme input,
html.dark-theme select,
html.dark-theme textarea {
  background-color: var(--surface-muted);
  color: var(--text-primary);
  border-color: var(--border-color);
  color-scheme: dark;
}

html.dark-theme .modal-content {
  background-color: var(--surface-color);
  color: var(--text-primary);
}

html.dark-theme .pos-product-card,
html.dark-theme .order-card,
html.dark-theme .stat-card {
  background-color: var(--surface-color);
}


/* Fixes for dark theme */
html.dark-theme .header, 
html.dark-theme .pos-header {
    background: rgba(36, 31, 28, 0.85) !important;
    border-bottom: 1px solid rgba(212, 130, 103, 0.05);
}

html.dark-theme .pos-ticket-section {
  background: var(--surface-color) !important;
}

html.dark-theme .sales-summary {
  background: var(--surface-color) !important;
}

html.dark-theme .pos-product-card {
  background: var(--surface-color) !important;
}

html.dark-theme .sticky-nav {
  background: rgba(36, 31, 28, 0.95);
}

html.dark-theme .kds-header,
html.dark-theme .kds-card {
  background: var(--surface-color);
}

html.dark-theme .nav-pill {
  background: var(--surface-muted);
}

html.dark-theme .pos-header::after {
  background: linear-gradient(to bottom, rgba(0,0,0,0.3), transparent);
}

html.dark-theme .toast {
  background: rgba(36, 31, 28, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: var(--text-primary) !important;
}
.toast-container { align-items: center; }

/* --- Floating Cart --- */
.floating-cart-btn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background: var(--accent-color);
    color: white;
    border-radius: 30px;
    padding: 15px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(212,130,103, 0.4);
    z-index: 1000;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 20px);
}
.floating-cart-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

/* =========================================
   Fase 3: Paquete Visual Premium (Animaciones)
   ========================================= */

/* 1. Glassmorphism en Header */
.header, .pos-header {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(212, 130, 103, 0.1);
}

/* Glassmorphism en Floating Cart */
.floating-cart-btn {
    background: rgba(212, 130, 103, 0.95) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 2. Micro-interacciones Táctiles (Hundimiento) */
.product-card, .pos-product-card, .btn, .btn-add, .btn-add-full, .category-btn, .size-btn, .flavor-chip {
    transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s ease, background-color 0.2s, border-color 0.2s !important;
}

.product-card:active, .pos-product-card:active, .btn:active, .btn-add:active, .btn-add-full:active, .category-btn:active, .size-btn:active, .flavor-chip:active {
    transform: scale(0.95) !important;
}

.floating-cart-btn:active {
    transform: translate(-50%, 0) scale(0.95) !important;
}

/* 3. Modal Bottom Drawer (Carrito Deslizante) */
.bottom-drawer {
    align-items: flex-end; /* Lo alinea abajo */
}
.bottom-drawer .modal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 24px 24px 0 0;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1) !important;
    padding-bottom: env(safe-area-inset-bottom, 20px);
}
.bottom-drawer.active .modal-content {
    transform: translateY(0);
}

/* 4. Skeletons de Carga */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 12px;
}
.skeleton-card {
    height: 280px;
    width: 100%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Modern Dialog Styling */
dialog {
  color: var(--text-primary);
}
dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

/* Modern Web Guidance: Animated Dialog with @starting-style */
dialog {
  color: var(--text-primary);
  transition: opacity 0.4s ease-out, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), display 0.4s allow-discrete, overlay 0.4s allow-discrete;
  opacity: 0;
  transform: scale(0.95) translateY(20px);
}

dialog[open] {
  opacity: 1;
  transform: scale(1) translateY(0);
}

@starting-style {
  dialog[open] {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  transition: background-color 0.4s ease-out, backdrop-filter 0.4s ease-out, display 0.4s allow-discrete, overlay 0.4s allow-discrete;
}

dialog[open]::backdrop {
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
}

@starting-style {
  dialog[open]::backdrop {
    background-color: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
  }
}

/* Scroll snap for recommendation items */
#cross-selling-items > div {
  scroll-snap-align: center;
}

/* Fix dialog centering overriding global resets */
dialog {
  margin: auto !important;
  inset: 0 !important;
  position: fixed !important;
  max-height: 90vh; /* Para que no se desborde la pantalla si es muy largo */
}

[data-theme="dark"] .search-bar input, [data-theme="dark"] .pos-search-input {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===== PANTALLA DE SEGUIMIENTO EN VIVO ===== */
#order-tracking-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem 3rem;
  overflow-y: auto;
  animation: trackingSlideUp 0.4s var(--spring-smooth) both;
}

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

.tracking-header {
  text-align: center;
  margin-bottom: 2rem;
}

.tracking-logo-icon {
  width: 48px;
  height: 48px;
  color: var(--accent-color);
  margin-bottom: 0.75rem;
}

.tracking-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
}

.tracking-greeting {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

/* Barra de progreso de pasos */
.tracking-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 400px;
  margin-bottom: 2rem;
  gap: 0;
}

.tracking-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}

.tracking-step span {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  transition: color 0.4s ease;
}

.step-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-muted);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s var(--spring-smooth);
}

.step-dot i {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  transition: color 0.4s ease;
}

.tracking-step.active .step-dot {
  background: var(--accent-color);
  border-color: var(--accent-color);
  box-shadow: 0 0 0 6px rgba(226, 114, 91, 0.15);
}

.tracking-step.active .step-dot i {
  color: white;
}

.tracking-step.active span {
  color: var(--accent-color);
}

.tracking-step.done .step-dot {
  background: var(--success-color);
  border-color: var(--success-color);
}

.tracking-step.done .step-dot i {
  color: white;
}

.tracking-step.done span {
  color: var(--success-color);
}

.tracking-step.ready .step-dot {
  background: var(--success-color);
  border-color: var(--success-color);
  animation: readyPulse 1.2s ease-in-out infinite;
}

@keyframes readyPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(123, 145, 106, 0.4); }
  50%       { box-shadow: 0 0 0 12px rgba(123, 145, 106, 0); }
}

.tracking-line {
  flex: 1;
  height: 3px;
  background: var(--border-color);
  margin: 0 4px;
  margin-bottom: 20px;
  border-radius: 2px;
  transition: background 0.5s ease;
  min-width: 20px;
}

.tracking-line.filled {
  background: var(--success-color);
}

/* Tarjeta central de estado */
.tracking-status-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  text-align: center;
  width: 100%;
  max-width: 400px;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: all 0.5s var(--spring-smooth);
}

.tracking-status-card.ready-state {
  background: #f0f7ed;
  border-color: var(--success-color);
}

.dark-theme .tracking-status-card.ready-state {
  background: rgba(123, 145, 106, 0.15);
}

.tracking-status-icon {
  position: relative;
  width: 80px;
  height: 80px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tracking-status-icon i {
  width: 48px;
  height: 48px;
  color: var(--accent-color);
  position: relative;
  z-index: 1;
}

.tracking-status-icon.spinning i {
  animation: spinIcon 1.5s linear infinite;
}

@keyframes spinIcon {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.tracking-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--accent-color);
  animation: pulseRing 2s ease-out infinite;
  opacity: 0;
}

@keyframes pulseRing {
  0%   { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(1.5); opacity: 0; }
}

.tracking-status-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.4rem 0;
}

.tracking-status-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Lista de ítems del pedido */
.tracking-items-list {
  width: 100%;
  max-width: 400px;
  margin-bottom: 1.5rem;
}

.tracking-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-primary);
}

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

.tracking-item-qty {
  background: var(--surface-muted);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-right: 0.5rem;
}

/* Botón volver */
.btn-tracking-back {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.btn-tracking-back:hover {
  background: var(--surface-muted);
  color: var(--text-primary);
}

.btn-tracking-back i {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   Responsive Design – Mobile (max-width: 1023px)
   Principio: Desktop sin tocar. Mobile rediseñado con armonía.
   ========================================================================== */
@media screen and (max-width: 1023px) {

  /* ----------------------------------------------------------------
     POS – Estructura General
     ---------------------------------------------------------------- */
  .pos-container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .pos-menu-section {
    width: 100%;
    flex: none;
    height: auto;
    overflow-y: visible;
    border-right: none;
    padding: 0.75rem;
  }

  /* La boleta se oculta: en mobile se accede desde el botón flotante */
  .pos-ticket-section {
    display: none !important;
  }

  /* ----------------------------------------------------------------
     POS – Header / Topbar
     ---------------------------------------------------------------- */
  .pos-header {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.6rem !important;
    align-items: stretch !important;
    padding-bottom: 0.75rem !important;
  }

  /* Fila 1 del header: título a la izquierda, venta + hamburguesa a la derecha */
  .pos-header > div:first-child {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    position: static !important;
    width: 100%;
    min-height: unset !important;
  }

  /* La caja de "Venta del Día" se saca del position:absolute */
  .pos-header .sales-summary {
    position: static !important;
    right: auto !important;
    height: 36px !important;
    padding: 0 0.75rem !important;
    font-size: 0.82rem;
    white-space: nowrap;
    flex-shrink: 0;
    order: 1;
  }

  /* Ocultar la etiqueta larga "Venta del Día:" en mobile; solo el número */
  .pos-header .sales-summary > span:first-child {
    display: none;
  }

  /* ----------------------------------------------------------------
     POS – Tabs de Navegación
     (Venta Directa / Mesas / Web / Fiados)
     En mobile: columna icono + texto corto, sin overflow
     ---------------------------------------------------------------- */
  .tab-btn {
    font-size: 0.68rem !important;
    height: 52px !important;
    padding: 4px 2px !important;
    gap: 3px !important;
    flex-direction: column !important;
    border-radius: 10px !important;
    line-height: 1.1 !important;
    white-space: normal !important;
    text-align: center !important;
    word-break: break-word !important;
  }

  .tab-btn i[data-lucide] {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0;
  }

  /* ----------------------------------------------------------------
     POS – Buscador + Venta Libre
     ---------------------------------------------------------------- */
  .pos-search-container {
    flex: 1 !important;
    min-width: 0;
  }

  /* ----------------------------------------------------------------
     POS – Categorías: scroll horizontal fluido (sin wrap)
     ---------------------------------------------------------------- */
  .pos-categories {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 0.5rem !important;
    padding-bottom: 0.4rem !important;
    margin-bottom: 0.4rem !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .pos-categories::-webkit-scrollbar { display: none; }

  .btn-category {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    font-size: 0.82rem !important;
    padding: 0.35rem 0.85rem !important;
    height: 36px !important;
    min-height: unset !important;
  }

  /* ----------------------------------------------------------------
     POS – Grid de Productos: 2 columnas armoniosas
     ---------------------------------------------------------------- */
  .pos-product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding-bottom: 6rem; /* espacio para el FAB flotante */
    overflow: visible;
  }

  .pos-product-card {
    min-height: 160px !important;
    height: auto !important;
  }

  .pos-product-card img {
    height: 85px !important;
  }

  .pos-product-card-body {
    padding: 0.6rem !important;
  }

  /* ----------------------------------------------------------------
     POS – Touch targets mínimos 44px (estándar ergonómico táctil)
     ---------------------------------------------------------------- */
  button:not(.btn-category) {
    min-height: 44px;
  }

  /* ----------------------------------------------------------------
     Panel Cocina (KDS) – Mobile
     ---------------------------------------------------------------- */
  main.kds-board {
    flex-direction: column !important;
    height: auto !important;
    overflow: visible !important;
    padding: 0.75rem !important;
    gap: 0.75rem !important;
    margin-top: 0.5rem !important;
    max-width: 100% !important;
  }

  .kds-column {
    width: 100% !important;
    /* Sin altura fija — crece con el contenido hasta el máximo */
    height: auto !important;
    min-height: 120px;  /* Solo el header cuando está vacía */
    margin-bottom: 0;
    flex-shrink: 0;
  }

  /* La lista interna puede scrollear si hay muchas tarjetas */
  .kds-list {
    max-height: 65vh;
    overflow-y: auto !important;
    gap: 0.75rem;
  }

  .kds-header {
    padding: 0.85rem 1rem;
  }

  .kds-header h2 {
    font-size: 1.05rem;
  }

  .kds-card {
    touch-action: manipulation;
  }

  .kds-btn {
    padding: 0.85rem 1rem !important;
    font-size: 0.95rem !important;
    min-height: 48px;
  }
}

/* FIX: Desbloquear scroll de página en mobile (override overflow:hidden del desktop) */
@media screen and (max-width: 1023px) {
  html, body {
    overflow-y: auto !important;
    height: auto !important;
  }
  .pos-container {
    overflow: visible !important;
  }
  .pos-menu-section {
    overflow-y: visible !important;
    height: auto !important;
  }
  .pos-product-grid {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }
}

/* FIX: Hamburger dropdown en mobile — pantalla completa para ver todas las opciones */
@media screen and (max-width: 1023px) {
  .hamburger-dropdown {
    position: fixed !important;
    top: 70px !important;
    right: 8px !important;
    left: 8px !important;
    width: auto !important;
    max-height: calc(100vh - 90px) !important;
    overflow-y: auto !important;
    z-index: 9999 !important;
  }
}

/* ==========================================================================
   Responsive: Panel de Cocina (Admin) – Modales y Menús internos
   ========================================================================== */
@media screen and (max-width: 1023px) {

  /* --- Menú hamburguesa: botones con min-height táctil y texto visible --- */
  .hamburger-dropdown a,
  .hamburger-dropdown button {
    min-height: 44px !important;
    font-size: 0.9rem !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: unset !important;
    padding: 0.6rem 0.75rem !important;
  }

  /* Grid de 2 columnas del menú → 1 columna en mobile (más espacio por botón) */
  .hamburger-dropdown .menu-grid {
    grid-template-columns: 1fr !important;
    gap: 0.4rem !important;
  }

  /* --- Modales generales: ocupan casi toda la pantalla --- */
  .modal-content {
    width: 96% !important;
    max-width: 100% !important;
    padding: 1.25rem !important;
    border-radius: 16px !important;
  }

  /* --- Grids de 2 columnas dentro de modales → apilados en mobile --- */
  /* Afecta: Reportes (KPI cards), Gastos, Proveedores, Metas, etc. */
  .modal-content [style*="grid-template-columns: 1fr 1fr"],
  .modal-content [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Grid 1fr 2fr (ej: catálogo) → también apilado */
  .modal-content [style*="grid-template-columns: 1fr 2fr"] {
    grid-template-columns: 1fr !important;
  }

  /* --- Reportes: los dos charts de la fila inferior --- */
  #reportes-modal [style*="grid-template-columns:1fr 1fr"],
  #reportes-modal [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Tabs de período en Reportes: scroll horizontal */
  #reportes-modal [style*="display:flex"][style*="flex-wrap"] {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* --- Calendario de cierre de caja (7 columnas) → más pequeño --- */
  #cdp-grid,
  [style*="grid-template-columns: repeat(7, 1fr)"] {
    font-size: 0.75rem !important;
    gap: 0.2rem !important;
  }

  /* --- Botones de acción en modales: tamaño táctil --- */
  .modal-content button,
  .modal-content a {
    min-height: 44px;
  }

  /* --- KDS board header: sin espacio extra en mobile --- */
  main.kds-board {
    margin-top: 0 !important;
  }
}

/* ==========================================================================
   Interactive Map for POS
   ========================================================================== */
.interactive-map-container {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    user-select: none;
}

.map-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: -1rem;
    font-size: 0.9rem;
    font-weight: 600;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.legend-box {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}
.legend-open { background-color: var(--success-color); }
.legend-occupied { background-color: var(--text-primary); }

.map-zone {
    position: relative;
    border-radius: 8px;
    min-height: 300px;
    width: 100%;
}

/* Zone Terraza */
.zone-terraza {
    background-color: var(--surface-muted);
    border: 6px solid var(--accent-color);
}
.zone-terraza .zone-title {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background-color: var(--accent-color);
    color: white;
    text-align: center;
    padding: 0.5rem;
    font-weight: bold;
}

/* Zone Interior */
.zone-interior {
    background-color: #e8e4dc; /* slightly darker than muted */
    border: 6px solid var(--text-primary);
    min-height: 240px;
    margin-top: 1rem;
}
.zone-interior .zone-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--text-primary);
    color: white;
    text-align: center;
    padding: 0.5rem;
    font-weight: bold;
}

/* Doors in interior */
.door-top-left, .door-top-right {
    position: absolute;
    top: -20px;
    width: 4px;
    height: 20px;
    background-color: var(--text-primary);
    transform-origin: bottom center;
}
.door-top-left {
    left: 40%;
    transform: rotate(-30deg);
}
.door-top-right {
    left: 60%;
    transform: rotate(30deg);
}
.door-gap {
    position: absolute;
    top: -6px;
    left: 40%;
    width: 20%;
    height: 6px;
    background-color: #e8e4dc;
}

/* Tables */
.map-table {
    position: absolute;
    width: 50px;
    height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    border-radius: 4px;
}
.map-table:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}
.map-table.table-open {
    background-color: var(--success-color);
}
.map-table.table-occupied {
    background-color: var(--text-primary);
}
.map-table .table-label {
    font-size: 0.6rem;
    font-weight: normal;
    margin-top: -2px;
}

@media screen and (max-width: 1023px) {
    .map-zone {
        min-height: 250px;
    }
    .zone-interior {
        min-height: 200px;
    }
}

/* ==========================================================================
   Table Pop-up Menu (Contextual)
   ========================================================================== */
.map-table .table-popup-menu {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 100;
}
.map-table.show-popup {
    z-index: 101; /* Bring selected table to front */
}
.map-table.show-popup .table-popup-menu {
    pointer-events: auto;
}
.table-btn-popup {
    position: absolute;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 8px;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    font-weight: 800;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
    white-space: nowrap;
    opacity: 0;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    text-transform: uppercase;
}
/* Individual Colors */
.btn-precuenta { background-color: var(--success-color, #7b916a); }
.btn-cobrar { background-color: var(--accent-color, #d05d46); }
.btn-fiar { background-color: #d97706; }

.table-btn-popup:hover {
    filter: brightness(1.1);
    transform: scale(1.05) !important;
}

.popup-top {
    top: -60px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
}
.map-table.show-popup .popup-top {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

.popup-left {
    top: 50%;
    left: -105px;
    transform: translateY(-50%) scale(0.8);
}
.map-table.show-popup .popup-left {
    transform: translateY(-50%) scale(1);
    opacity: 1;
}

.popup-right {
    top: 50%;
    right: -85px;
    transform: translateY(-50%) scale(0.8);
}
.map-table.show-popup .popup-right {
    transform: translateY(-50%) scale(1);
    opacity: 1;
}

@media screen and (max-width: 450px) {
    .table-btn-popup {
        padding: 0.5rem 0.6rem;
        font-size: 0.75rem;
    }
    .popup-top { top: -45px; }
    .popup-bottom { bottom: -45px; }
    .popup-left { left: -75px; }
    .popup-right { right: -65px; }
}

.btn-eliminar { background-color: #ef4444; }

.popup-bottom {
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
}
.map-table.show-popup .popup-bottom {
    transform: translateX(-50%) scale(1);
    opacity: 1;
}

/* ==========================================================================
   Modo Alto Rendimiento / Liviano (.perf-light)
   Diseñado para hardware con recursos limitados (Intel Atom/i3, GPU integrada
   Intel HD Graphics y RAM <= 4GB). Elimina cuellos de botella de rasterizado GPU
   (backdrop-filter), sombras pesadas y animaciones concurrentes.
   ========================================================================== */
html.perf-light *,
html.perf-light *::before,
html.perf-light *::after {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  transition-duration: 0.001ms !important;
}

/* Modales y Paneles con fondo opaco y borde nítido para legibilidad perfecta */
html.perf-light .glass-panel,
html.perf-light .nav-bottom,
html.perf-light .modal-content,
html.perf-light .hamburger-dropdown,
html.perf-light dialog,
html.perf-light .drawer-content,
html.perf-light .pos-header,
html.perf-light .kds-header {
  background: var(--surface-color) !important;
  border: 1px solid var(--border-color) !important;
}

html.perf-light .modal,
html.perf-light dialog::backdrop {
  background: rgba(0, 0, 0, 0.65) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Desactivar animaciones costosas de entrada y dropdowns */
html.perf-light .animate-slide-up,
html.perf-light .animate-pop-in,
html.perf-light .hamburger-dropdown.show,
html.perf-light .modal-content,
html.perf-light dialog,
html.perf-light dialog::backdrop {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}

/* Optimización de Renderizado en Tarjetas de Catálogo y Listas (Layout Containment) */
html.perf-light .pos-product-card,
html.perf-light .product-card,
html.perf-light .order-card,
html.perf-light .kds-card {
  content-visibility: auto;
  contain-intrinsic-size: 160px;
  contain: layout style paint;
  transform: none !important;
  transition: none !important;
  border: 1px solid var(--border-color) !important;
}

html.perf-light .pos-product-card:hover,
html.perf-light .pos-product-card:active,
html.perf-light .product-card:hover,
html.perf-light .product-card:active {
  transform: none !important;
  box-shadow: none !important;
}

/* Prevenir repintados en inputs y botones */
html.perf-light .pos-search-input,
html.perf-light .pos-search-input:hover,
html.perf-light .pos-search-input:focus {
  transform: none !important;
  box-shadow: none !important;
  transition: none !important;
}

html.perf-light #options-modal-price {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(255, 255, 255, 0.2) !important;
}

html.perf-light #btn-confirm-options {
  box-shadow: none !important;
  transform: none !important;
  transition: none !important;
}

html.perf-light .btn:active,
html.perf-light .btn-add:active,
html.perf-light .btn-hamburger:hover {
  transform: none !important;
}

