:root {
  --primary-color: #16a34a;        
  --primary-dark: #15803d;        
  --danger-color: #ef4444;        
  --header-height: 60px;           
  --footer-height: 50px;
  --header-height-mobile: 70px;    /* Header más alto en móviles */
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: var(--footer-height);
  font-size: 14px; /* Base font size para móviles */
}



/* Responsive font sizes */
@media (min-width: 768px) {
  body {
    font-size: 16px;
  }
}

/* Custom font sizes para mayor control responsive */
.fs-7 { font-size: 0.875rem; }
.fs-8 { font-size: 0.75rem; }

@media (min-width: 768px) {
  .fs-7 { font-size: 0.9rem; }
  .fs-8 { font-size: 0.8rem; }
}
@media (max-width: 576px) {
  #empresa-usuario-header {
    font-size: 1rem;
    white-space: normal !important;
    line-height: 1.1;
    padding-top: 0.6rem;
  }
  
  /* Botón más armonioso y centrado */
  .logout-button {
    font-size: 0.8rem !important; /* Un poquito más grande */
    padding: 0.4rem 0.6rem !important; /* Más equilibrado */
    min-height: auto !important;
    line-height: 1.2 !important;
  }
  
  .logout-button i {
    font-size: 0.75rem;
  }
  
  /* CENTRADO VERTICAL - container del navbar */
  .navbar .container-fluid {
    display: flex !important;
    align-items: center !important; /* Centrado vertical */
    min-height: 50px !important;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
  }
  
  /* El navbar-brand también centrado */
  .navbar-brand {
    white-space: normal !important;
    line-height: 1.1;
    margin-bottom: 0 !important; /* Quitar margen que descentra */
    display: flex !important;
    align-items: center !important;
  }
  
  /* Header más compacto */
  header {
    height: 55px !important;
    padding: 0.15rem 0 !important;
  }
  
  main {
    margin-top: 55px !important;
  }
}
/* Stock styles */
.stock-available {
  color: var(--bs-success);
  font-weight: 600;
  background-color: rgba(22, 163, 74, 0.1);
}

.stock-low {
  color: var(--bs-warning);
  font-weight: 600;
  background-color: rgba(245, 158, 11, 0.1);
}

.stock-unavailable {
  color: var(--bs-danger);
  font-weight: 600;
  background-color: rgba(239, 68, 68, 0.1);
}

/* Primary colors and buttons */
.nav-link.active {
  color: var(--primary-color) !important;
  background-color: rgba(22, 163, 74, 0.05) !important;
}

.btn-primary {
  background-color: var(--primary-color) !important;
  border-color: var(--primary-color) !important;
}

.btn-primary:hover {
  background-color: var(--primary-dark) !important;
  border-color: var(--primary-dark) !important;
}

.text-primary {
  color: var(--primary-color) !important;
}

.border-primary {
  border-color: var(--primary-color) !important;
}

.logout-button {
  background-color: var(--danger-color);
  border-color: var(--danger-color);
}

.logout-button:hover {
  background-color: #dc2626;
  border-color: #dc2626;
}

/* Header responsive */
header {
  height: var(--header-height-mobile);
  padding: 0.5rem 0;
}

@media (min-width: 768px) {
  header {
    height: var(--header-height);
    padding: 1rem 0;
  }
}

/* Main content responsive */
main {
  margin-top: var(--header-height-mobile);
  margin-bottom: var(--footer-height);
  padding-top: 1rem;
}

@media (min-width: 768px) {
  main {
    margin-top: var(--header-height);
    padding-top: 1.5rem;
  }
}

/* Footer responsive */
footer.fixed-bottom {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 1020;
  height: var(--footer-height);
  padding: 0.75rem 1rem;
}

/* Cards responsive */
.card {
  border-radius: 0.5rem;
}

@media (max-width: 767px) {
  .card {
    border-radius: 0.375rem;
    margin-bottom: 1rem !important;
  }
  
  .card-body {
    padding: 1rem !important;
  }
}

/* Product card animations and responsive */
.product-card {
  animation: fadeInUp 0.3s ease-out forwards;
  min-height: 250px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (min-width: 768px) {
  .product-card {
    min-height: 300px;
  }
  
  .product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
  }
}

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

/* Search tabs responsive */
.search-tabs {
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.search-tabs::-webkit-scrollbar {
  display: none;
}

.search-tabs .nav-link {
  border: none;
  color: #6c757d;
  transition: all 0.3s ease;
  white-space: nowrap;
  min-width: fit-content;
  font-size: 0.875rem;
}

@media (min-width: 768px) {
  .search-tabs .nav-link {
    font-size: 1rem;
  }
}

.search-tabs .nav-link:hover {
  background-color: rgba(22, 163, 74, 0.05);
}

.search-tabs .nav-link.active {
  color: white !important;
  background-color: var(--primary-color) !important;
  border: none;
}

/* Form controls responsive */
.form-control-lg {
  font-size: 1rem;
  padding: 0.75rem 1rem;
}

@media (max-width: 767px) {
  .form-control-lg {
    font-size: 16px; /* Previene zoom en iOS */
    padding: 0.875rem 1rem;
  }
}

/* Clear search button responsive */
#clear-search {
  display: none;
  opacity: 0.6;
  z-index: 5;
  cursor: pointer;
  right: 12px;
  background-color: transparent;
  border: none;
  padding: 0.25rem;
  font-size: 0.8rem;
  transition: opacity 0.2s ease;
}

#clear-search:hover {
  opacity: 0.9;
}

.search-has-value #clear-search {
  display: block;
}

.search-has-value #search-query {
  padding-right: 2.5rem;
}

/* Camera button responsive */
.barcode-img {
  height: 60px;
  width: auto;
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .barcode-img {
    height: 80px;
  }
}

#camera-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 80px;
  margin: 0 auto;
  border: 2px dashed var(--primary-color);
  background-color: rgba(22, 163, 74, 0.02);
  transition: all 0.2s ease;
}

#camera-btn:hover {
  background-color: rgba(22, 163, 74, 0.05);
  border-color: var(--primary-dark);
}

/* Table responsive */
.table-responsive {
  border-radius: 0.375rem;
  overflow: hidden;
}

.table th {
  border-top: none;
  font-weight: 600;
  background-color: #f8f9fa;
  padding: 0.75rem 0.5rem;
}

.table td {
  padding: 0.75rem 0.5rem;
  vertical-align: middle;
  border-top: 1px solid #dee2e6;
}

@media (min-width: 768px) {
  .table th,
  .table td {
    padding: 0.75rem 1rem;
  }
}

.table tbody tr {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.table tbody tr:hover {
  background-color: rgba(22, 163, 74, 0.05);
}

/* Modal responsive */
@media (max-width: 575px) {
  .modal-fullscreen-sm-down {
    width: 100vw;
    max-width: none;
    height: 100vh;
    margin: 0;
  }
  
  .modal-fullscreen-sm-down .modal-content {
    height: 100vh;
    border: none;
    border-radius: 0;
  }
}

/* Scanner styles responsive */
#reader {
  width: 100% !important;
  min-height: 300px !important;
  border: none !important;
  box-shadow: none !important;
  position: relative !important;
  overflow: hidden !important;
}

@media (min-width: 768px) {
  #reader {
    min-height: 400px !important;
  }
}

#reader video {
  width: 100% !important;
  height: auto !important;
  object-fit: cover !important;
  max-height: 60vh !important;
  transform: none !important;
  -webkit-transform: none !important;
  filter: none !important;
}

@media (min-width: 768px) {
  #reader video {
    max-height: 70vh !important;
  }
}

#reader__scan_region {
  background-color: #f8f9fa !important;
  padding: 10px !important;
  position: relative !important;
}

#reader canvas:not(:first-of-type) {
  display: none !important;
}

#reader select {
  max-width: 100% !important;
  margin: 10px auto !important;
  font-size: 14px !important;
}

@media (min-width: 768px) {
  #reader select {
    font-size: 16px !important;
  }
}

/* Corregir elementos duplicados en móviles */
#reader div:has(> video) {
  position: relative !important;
  overflow: hidden !important;
}

#reader video:not(:first-child) {
  display: none !important;
}

/* Estado del escaneo */
.scanning-active {
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { opacity: 0.5; }
  50% { opacity: 1; }
  100% { opacity: 0.5; }
}

/* Utilidades responsive adicionales */
.min-vh-100 {
  min-height: 100vh;
}

/* Espaciado responsive */
@media (max-width: 767px) {
  .px-md-3 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  .py-md-3 {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }
  
  .mb-md-4 {
    margin-bottom: 1.5rem !important;
  }
  
  .mt-md-4 {
    margin-top: 1.5rem !important;
  }
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .product-card,
  .nav-link,
  .btn,
  #clear-search {
    animation: none;
    transition: none;
  }
}

/* Focus styles mejorados para accesibilidad */
.btn:focus,
.form-control:focus,
.nav-link:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
  box-shadow: 0 0 0 0.2rem rgba(22, 163, 74, 0.25);
}

/* Loading spinner responsive */
.spinner-border {
  width: 1.5rem;
  height: 1.5rem;
}

@media (min-width: 768px) {
  .spinner-border {
    width: 2rem;
    height: 2rem;
  }
}

/* Mejor handling de texto largo en móviles */
@media (max-width: 767px) {
  .product-name {
    word-break: break-word;
    hyphens: auto;
    line-height: 1.3;
  }
  
  .table td {
    word-break: break-word;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  
  .table td:last-child {
    white-space: normal;
    max-width: none;
  }
}

/* Mejoras para touch devices */
@media (hover: none) and (pointer: coarse) {
  .btn {
    min-height: 44px; /* Tamaño mínimo recomendado para touch */
  }
  
  .table tbody tr {
    cursor: default;
  }
  
  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Dark mode support (opcional) */
@media (prefers-color-scheme: dark) {
  /* Se puede implementar más adelante si es necesario */
}

/* Print styles */
@media print {
  .fixed-bottom,
  .btn,
  .modal,
  #camera-btn,
  #camera-btn-desktop {
    display: none !important;
  }
  
  .card {
    border: 1px solid #000;
    break-inside: avoid;
  }
  
  .product-card {
    box-shadow: none !important;
  }
}


/* ✅ AGREGAR ESTAS LÍNEAS AL FINAL DE TU ARCHIVO styles.css */

/* Estilos para hacer el precio más llamativo */
.product-price {
  background: linear-gradient(135deg, #28a745, #20c997) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  font-family: 'Inter', 'Arial Black', 'Helvetica', sans-serif !important;
  letter-spacing: 1px !important;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1) !important;
  font-weight: 900 !important;
}

/* Fallback para navegadores que no soportan background-clip */
@supports not (-webkit-background-clip: text) {
  .product-price {
    color: #28a745 !important;
    font-weight: 900 !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1) !important;
  }
}

/* Hacer el título del producto más prominente y negro */
.product-name {
  color: #000000 !important;
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  letter-spacing: -0.5px !important;
  line-height: 1.2 !important;
  font-weight: 700 !important;
}

/* Efecto hover más sutil en la card del producto */
.product-card:hover {
  transform: translateY(-3px) !important;
  transition: transform 0.3s ease-in-out !important;
  box-shadow: 0 12px 30px rgba(0,0,0,0.15) !important;
}

/* Responsive para el precio en móviles */
@media (max-width: 767px) {
  .product-price {
    font-size: 1.75rem !important; /* Más grande en móviles */
    letter-spacing: 0.5px !important;
  }

  
  .product-name {
    font-size: 1.5rem !important; /* Más pequeño en móviles pero aún prominente */
    line-height: 1.3 !important;
  }
}