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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #e8eaf0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 70px;
  padding-bottom: 70px;
}

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

@media (max-width: 768px) {
  body {
    padding-top: 60px;
    padding-bottom: 55px;
  }

  .navbar {
    height: 50px !important;
    padding: 5px 10px !important;
    min-height: 50px !important;
  }

  .navbar .container-fluid {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
    height: 100%;
    position: relative !important;
  }

  .navbar-brand {
    font-size: 0.85rem !important;
    flex: 0 0 auto !important;
    margin: 0 auto !important;
    padding: 0 !important;
    line-height: 1.3 !important;
    text-align: center !important;
  }

  .logout-button {
    padding: 6px 12px !important;
    font-size: 0.85rem !important;
    position: absolute !important;
    right: 10px !important;
    margin: 0 !important;
  }

  .logout-button span {
    display: none !important;
  }

  .logout-button i {
    margin: 0 !important;
  }
}

@media (max-width: 576px) {
  body {
    padding-bottom: 50px;
  }

  .navbar-brand {
    font-size: 0.75rem !important;
    line-height: 1.2 !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;
}

/* Header/Navbar */
.navbar {
  height: 60px;
  z-index: 1000;
}

.navbar .container-fluid {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  height: 100%;
}

.navbar-brand {
  font-size: 1rem;
  color: var(--primary-color) !important;
  flex: 0 1 auto;
  margin: 0;
}

.navbar-brand p {
  margin: 0;
  line-height: 1.2;
}

.logout-button {
  white-space: nowrap;
  background-color: var(--danger-color);
  border-color: var(--danger-color);
  flex-shrink: 0;
}

.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;
  }
}

/* Botones */
.btn {
    border-radius: 10px;
    padding: 12px 30px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-color);
    border: none;
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.btn-danger, .btn-logout {
    background: var(--danger-color);
    border: none;
    color: white;
}

.btn-danger:hover, .btn-logout:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3);
}

/* Footer */
footer {
    background-color: #1f2937;
    color: white;
    padding: 10px 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    font-size: 1rem;
}

footer a {
    color: white;
    text-decoration: none;
    transition: opacity 0.2s;
}

footer a:hover {
    opacity: 0.8;
}

footer img {
    filter: brightness(1.1);
}

footer .container {
    min-height: auto;
    display: flex;
    flex-direction: row !important;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

/* Footer Responsive */
@media (max-width: 768px) {
    footer {
        padding: 8px 0;
    }

    footer .container {
        gap: 12px !important;
        font-size: 0.75rem;
        padding: 0 10px;
    }

    footer img[alt="Isologo Cormons"] {
        width: 30px !important;
        height: 30px !important;
        margin-right: 5px !important;
    }

    footer img[alt="Logo WhatsApp"] {
        width: 18px !important;
        height: 18px !important;
        margin-right: 4px !important;
    }
}

@media (max-width: 576px) {
    footer {
        padding: 6px 0;
    }

    footer .container {
        gap: 8px !important;
        font-size: 0.7rem;
    }

    footer img[alt="Isologo Cormons"] {
        width: 24px !important;
        height: 24px !important;
    }

    footer img[alt="Logo WhatsApp"] {
        width: 16px !important;
        height: 16px !important;
    }
}

/* 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;
  }
}

@media (max-width: 400px) {
  .card-body {
    padding: 0.875rem !important;
  }

  section.card .card-body {
    padding: 1rem 0.75rem !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: normal;
  word-wrap: break-word;
  min-width: fit-content;
  font-size: 0.875rem;
  padding: 0.75rem 0.5rem !important;
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
}

@media (min-width: 768px) {
  .search-tabs .nav-link {
    font-size: 1rem;
    white-space: nowrap;
    padding: 1rem !important;
    min-height: auto;
  }
}

@media (max-width: 576px) {
  .search-tabs .nav-link {
    font-size: 0.8rem;
    padding: 0.6rem 0.4rem !important;
    line-height: 1.25;
  }
}

@media (max-width: 400px) {
  .search-tabs .nav-link {
    font-size: 0.72rem;
    padding: 0.5rem 0.3rem !important;
    line-height: 1.2;
  }
}

.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;
}

/* Asegurar que el formulario de búsqueda no se rompa en móviles */
#search-form {
  width: 100%;
}

#search-form .input-group {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
}

#search-form .input-group .position-relative {
  flex: 1 1 auto;
  min-width: 0;
}

#search-form .input-group .btn {
  flex-shrink: 0;
  margin-left: 0;
}

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

  #search-form .form-control {
    font-size: 16px !important;
    padding: 0.75rem 1rem !important;
  }

  #search-form .btn {
    padding: 0.75rem 1rem !important;
    min-width: 48px;
  }
}

@media (max-width: 400px) {
  #search-form .form-control {
    font-size: 14px !important;
    padding: 0.65rem 0.75rem !important;
    padding-right: 2.5rem !important;
  }

  #search-form .btn {
    padding: 0.65rem 0.85rem !important;
    min-width: 44px;
  }

  #search-form .btn i {
    font-size: 0.9rem;
  }
}

/* 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;
  }
}
/* Desplegable de depósitos verde */
select#select-deposito.form-select {
    background-color: #f8fff8 !important;  
    border: 2px solid #28a745 !important;      
    color: #155724 !important;             
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23198754' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e") !important;
}

select#select-deposito.form-select:focus {
    background-color: #f0fff0 !important;  
    border-color: #20c997 !important;      
    box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.25) !important; 
    outline: 0 !important;
}

select#select-deposito.form-select option {
    background-color: #f8fff8 !important;
    color: #155724 !important;
}

select#select-deposito.form-select option:checked {
    background-color: #28a745 !important;
    color: white !important;
}

/* Botón editar stock - verde outline */
.edit-stock-btn {
    color: #28a745 !important;
    background-color: white !important;
    border: 2px solid #28a745 !important;
    font-weight: 500 !important;
    transition: all 0.2s ease-in-out;
}

.edit-stock-btn:hover {
    background-color: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.edit-stock-btn:focus {
    background-color: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.25) !important;
    outline: 0 !important;
}

.edit-stock-btn:active {
    background-color: #1e7e34 !important;
    color: white !important;
    border-color: #1e7e34 !important;
    transform: translateY(0);
}

/* Botón ver más - verde outline */
.ver-mas-btn {
    color: #28a745 !important;
    background-color: white !important;
    border: 2px solid #28a745 !important;
    font-weight: 500 !important;
    transition: all 0.2s ease-in-out;
}

.ver-mas-btn:hover {
    background-color: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.ver-mas-btn:focus {
    background-color: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.25) !important;
    outline: 0 !important;
}

.ver-mas-btn:active {
    background-color: #1e7e34 !important;
    color: white !important;
    border-color: #1e7e34 !important;
    transform: translateY(0);
}

/* Estilos para modal Ver Más */
#ver-mas-detalle {
    white-space: pre-wrap; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    font-size: 13px; 
    line-height: 1.4; 
    max-height: 450px; 
    overflow-y: auto;
    border: 1px solid #28a745 !important;
    margin-bottom: 0;
}

/* Estilos para modales */
.modal-content {
    border-radius: 8px;
}

.modal-header.bg-success {
    background-color: #28a745 !important;
    border-bottom: none;
    padding: 1rem;
}

.modal-body {
    background-color: #f8f9fa;
}

.modal-body .form-label {
    color: #333;
    font-size: 14px;
}

.modal-body p, .modal-body span {
    color: #666;
    font-size: 14px;
}

.modal-footer {
    background-color: #f8f9fa;
    border-top: none;
    padding: 1rem;
}