.products-table {
  width: 100%;
  border-collapse: collapse;
}
    
.products-table th,
.products-table td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.products-table th {
    background-color: #f5f5f5;
}

.product-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.actions button {
    margin-right: 5px;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
    
.edit-btn {
  color: #2196F3;
  margin-right: 8px;
  cursor: pointer !important;
}
    
.delete-btn {
  color: #F44336;
  cursor: pointer !important;
}

/* También para el SVG dentro de los botones */
.edit-btn svg, .delete-btn svg {
  pointer-events: none;
}
    
/* Formulario de producto */
.product-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin-bottom: 10px;
}

.form-group {
  margin-bottom: 0; /* Reset para usar grid gap */
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: #555;
}

.full-width {
  grid-column: 1 / -1;
}

    /* Agregar estos estilos para los botones de iconos */
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: background-color 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}


/* Estilo para el formulario de especificaciones */
#specificationsContainer {
  margin-bottom: 16px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 10px;
}

/* Estilo para la tabla de productos */
.products-table img {
  border: 1px solid #eee;
}

/* Tooltip para IDs largos */
[title] {
  cursor: help;
}

/* Añadir estos estilos para los campos adicionales */
.extra-fields-section {
  background-color: #f5f7fa;
  padding: 15px;
  border-radius: 6px;
  margin-bottom: 20px;
  border-left: 4px solid #4dabf7;
}

.extra-fields-section h3 {
  margin-top: 0;
  color: #3a8cbc;
  font-size: 16px;
  margin-bottom: 15px;
}

/* Estilos para el modal mejorado */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.6);
}

.modal-content {
  position: relative;
  background-color: #fff;
  margin: 2% auto;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  max-height: 90vh;
  overflow-y: auto;
}

/* Sistema de pestañas */
.tabs-container {
  margin-bottom: 25px;
}

.tabs-header {
  display: flex;
  border-bottom: 2px solid #eaeaea;
  margin-bottom: 20px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.tab-btn.active {
  color: #2196F3;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: #2196F3;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Formulario de 3 columnas */
.product-form-grid {
  display: grid;
  gap: 20px;
}

.three-columns {
  grid-template-columns: repeat(3, 1fr);
}

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

.full-width {
  grid-column: 1 / -1;
}

.preview-img {
  grid-row: span 2;
}

.image-preview {
  width: 100%;
  height: 200px;
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f9f9f9;
}

.image-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Estilos para especificaciones */
.specs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.specs-container {
  max-height: 400px;
  overflow-y: auto;
  padding: 0 5px;
}

.spec-row {
  display: grid;
  grid-template-columns: 2fr 3fr auto;
  gap: 10px;
  background-color: #f5f7fa;
  padding: 12px 15px;
  border-radius: 6px;
  margin-bottom: 10px;
  align-items: center;
  border-left: 3px solid #2196F3;
}

.spec-row input {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 100%;
}

.remove-spec {
  background: #ff5252;
  color: white;
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Campos adicionales */
.extra-fields-section {
  padding: 0;
  background-color: transparent;
}

.no-fields-message {
  text-align: center;
  color: #888;
  font-style: italic;
  padding: 20px;
}

/* Footer del formulario */
.form-footer {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #eaeaea;
  display: flex;
  justify-content: flex-end;
  gap: 15px;
}

.form-footer button {
  padding: 10px 20px;
  font-size: 15px;
}

/* Agregar estos estilos para mejorar la apariencia del textarea */
textarea#productDescription {
  width: 100%;
  min-height: 40px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
}

/* Asegurar que full-width funciona correctamente en la cuadrícula */
.full-width {
  grid-column: 1 / -1 !important;
}

/* Ajustar el espacio para el contenedor de descripción */
.form-group.full-width {
  margin-top: 10px;
  margin-bottom: 15px;
}

.compact-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--primary, #2196F3);
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.compact-btn:hover {
  background-color: #0d8bf2;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.compact-btn svg {
  stroke: white;
}

/* Estilo para botones de marketplace con color morado característico */
.compact-btn.marketplace-btn {
  background-color: #6e2ff7; /* Color morado característico */
  color: white;
  border: none;
}

.compact-btn.marketplace-btn:hover {
  background-color: #5a1edf; /* Versión más oscura para hover */
  box-shadow: 0 3px 8px rgba(110, 47, 247, 0.2);
}

/* Versión pequeña del botón */
.compact-btn.small.marketplace-btn {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 4px;
}

/* Asegurar que el texto se ve bien con el fondo morado */
.compact-btn.marketplace-btn svg {
  stroke: white;
}

/* Ajustar la fila de categoría-subcategoría */
.category-subcategory-row {
  margin-bottom: 15px;
}

/* Actualizar las definiciones Grid para mejor ajuste */
.three-columns {
  grid-template-columns: 1fr 1fr 1fr;
  gap: 15px;
}

/* Quitar los posicionamientos antiguos que ya no necesitamos */
.second-row {
  grid-column: auto;
  grid-row: auto;
}

.rating-field {
  grid-column: auto;
  grid-row: auto;
}

.image-field {
  grid-column: auto;
  grid-row: auto;
}

/* Asegurar que los inputs tengan el mismo estilo */
.form-column input, 
.form-column select {
  width: 100%;
  padding: 10px;
  border: 1px solid #dce0e4;
  border-radius: 6px;
  font-size: 14px;
  background-color: #fff;
}

/* Estilos para inputs numéricos más compactos */
input[type="number"] {
  text-align: center;
}
/* Nueva fila para rating, imagen e ID familia */
.rating-image-family-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  width: 100%;
}

/* Ajustar los anchos proporcionales */
.rating-column {
  flex: 0.8; /* Tamaño ajustado para calificación */
}

.image-column {
  flex: 2; /* Más espacio para URLs de imagen */
}

.family-column {
  flex: 1.5; /* Tamaño medio para ID de familia */
}

/* Estilos para la sección de marketplaces */
.marketplace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.best-price-section {
  max-width: 60%;
}

.best-price-section h3 {
  margin-top: 0;
  color: #333;
  font-size: 18px;
  margin-bottom: 10px;
}

.best-price-display {
  background-color: #f9fafb;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #eaeaea;
}

/* Badges específicos de marketplace */
.promo-badge {
  background-color: #ff9800;
  color: white;
}

.best-badge {
  background-color: #4caf50;
  color: white;
}

/* Tabla de marketplaces */
.marketplaces-table-container {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.marketplaces-table {
  width: 100%;
  border-collapse: collapse;
}

.marketplaces-table th {
  position: sticky;
  top: 0;
  background-color: #f5f5f5;
  z-index: 1;
}

/* Estilos para la visualización de precio */
.marketplace-summary {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.best-price-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.best-price-tag .price {
  font-weight: 600;
  font-size: 15px;
}

.best-price-tag small {
  color: #666;
  font-size: 12px;
}

/* Botón específico para marketplaces */
.marketplace-btn {
  align-self: flex-start;
  margin-top: 5px;
  font-size: 12px;
  background-color: #e9ecef;
  color: #495057;
}

.marketplace-btn:hover {
  background-color: #dee2e6;
}

/* Radio button para seleccionar mejor precio */
.select-best-price {
  margin-right: 0;
  cursor: pointer;
}

/* Personalizar el aspecto de campos numéricos en marketplaces */
.marketplaces-table input[type="number"] {
  max-width: 80px;
}

.variant-checkbox-wrapper {
  display: flex;
  align-items: center;
  margin: 0 10px;
}

.variant-checkbox {
  margin-right: 5px;
}

.spec-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}

.spec-row .spec-name {
  flex: 1;
  margin-right: 10px;
}

.spec-row .spec-value {
  flex: 2;
  margin-right: 10px;
}

.variant-checkbox-wrapper label {
  font-size: 0.9em;
  white-space: nowrap;
  color: #555;
}


/* Estilos para gestión de familias */

.family-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
}

.family-search input {
  width: 300px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.families-table-container {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

.families-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.families-table th,
.families-table td {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}

.families-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}

.families-table tbody tr:hover {
  background-color: #f8f9fa;
}

.variant-fields-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.variant-field-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background-color: #f9f9f9;
}

.variant-field-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  outline: none;
}

.remove-variant-field {
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.remove-variant-field:hover {
  color: #a71e2a;
}

.form-section {
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background-color: #fafafa;
}

.form-section h3 {
  margin: 0 0 8px 0;
  color: #333;
  font-size: 16px;
}

.help-text {
  margin: 0 0 16px 0;
  color: #666;
  font-size: 13px;
  font-style: italic;
}

.secondary-btn.small {
  padding: 6px 12px;
  font-size: 13px;
}

.variant-fields-badge {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.variant-badge {
  background-color: #e3f2fd;
  color: #1565c0;
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.specs-count-badge {
  background-color: #f3e5f5;
  color: #7b1fa2;
  padding: 2px 6px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.family-actions {
  display: flex;
  gap: 8px;
}

.family-id-cell {
  font-family: monospace;
  font-size: 12px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Optimización móvil para marketplaces */
@media (max-width: 768px) {
  .marketplace-header {
    flex-direction: column;
    gap: 15px;
  }
  
  .best-price-section {
    max-width: 100%;
  }
  
  .marketplaces-table-container {
    max-height: 300px;
  }
}