:root {
  --primary-color: #4361ee;
  --secondary-color: #3f37c9;
  --accent-color: #4895ef;
  --dark-color: #1a1a2e;

  --dracula-color: #2c2f36;
  --dracula-hover-color: rgb(99, 85, 105);

  --light-color: #f8f9fa;
  --success-color: #4cc9f0;
  --warning-color: #f8961e;
  --danger-color: #f94144;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--light-color);
  color: var(--dark-color);
  line-height: 1.6;
  margin: 0;
}

.main {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem;
}

.form-container {
  background: #ffffff;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 2rem;
  margin-bottom: 2rem;
}

/* Generic styling for legacy ABM layouts */
.form {
  background: #ffffff;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 2rem;

  body {
    font-family: "Inter", sans-serif;
    background-color: #2c2f36;
    color: #333;
    line-height: 1.6;
  }

  .main {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0.5rem;
  }

  .form-container {
    background: #eeeeee;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2.5rem;
    margin-bottom: 2rem;
  }

  /* Generic styling for legacy ABM layouts */
  .form {
    background: #eeeeee;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;

    margin-bottom: 2rem;
  }

  body.abm input,
  body.abm select,
  body.abm textarea {
    width: 100%;

    width: 100%;

    max-width: 100%;
    width: 80%;

    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    background-color: #f9fafb;
  }

  body.abm input:focus,
  body.abm select:focus,
  body.abm textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
    background-color: white;
  }

  body.abm button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);

    background-color: var(--primary-color);

    background-color: var(--primary-color);

    background-color: var(--dracula-color);

    color: white;
    box-shadow: var(--box-shadow);
  }

  body.abm button:hover {
    background-color: var(--secondary-color);

    background-color: var(--secondary-color);

    background-color: var(--dracula-hover-color);

    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  }

  body.abm button:active {
    transform: translateY(0);
  }

  .form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eaeaea;
  }

  .back-link {
    display: inline-flex;
    align-items: center;

    color: var(--primary-color);

    color: var(--primary-color);

    color: var(--dracula-color);

    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
  }

  .back-link:hover {
    color: var(--secondary-color);
    transform: translateX(-2px);
  }

  .back-link svg {
    margin-right: 8px;
  }

  h2.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 1.5rem 0 1rem;
    padding-bottom: 0.5rem;

    border-bottom: 2px solid var(--primary-color);

    border-bottom: 2px solid var(--primary-color);

    border-bottom: 2px solid var(--dracula-color);
  }

  .form-grid {
    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;

    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;

    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;

    text-align: -webkit-auto;
  }

  .form-group {
    margin-bottom: 1rem;
    padding: 5px;
  }
  .form-group-title {
    margin-bottom: 1rem;
    padding: 5px;
    width: 100%;
  }

  .form-group-heredado {
    margin-bottom: 1rem;
    padding: 5px;
    display: grid;
    text-align: center;
    margin: 5px;

    align-self: center;
    justify-content: center;
  }

  .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
  }

  .form-control {
    width: 100%;

    width: 100%;

    max-width: 100%;
    width: 80%;

    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    background-color: #f9fafb;
  }
  .form-control-title {
    max-width: 645px;
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
    background-color: #f9fafb;
  }

  .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
    background-color: white;
  }

  .form-control.corto {
    width: 140px;
  }

  .form-control.mediano {
    width: 200px;
  }

  .form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23333' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
  }

  .checkbox-group {
    display: flex;
    align-items: center;
  }

  .checkbox-label {
    margin-left: 0.5rem;
    font-weight: 400;
  }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* padding: 0.75rem 1.5rem; */
    border: none;
    border-radius: var(--border-radius);
    font-family: inherit;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);

    background-color: var(--primary-color);
    color: white;
    box-shadow: var(--box-shadow);
  }

  .btn:hover {
    background-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  }

  .btn:active {
    transform: translateY(0);
  }

  background-color: var(--dracula-color);
  color: white;
  box-shadow: var(--box-shadow);
}

.btn:hover {
  background-color: var(--dracula-hover-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
  transform: translateY(0);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  font-family: inherit;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);

  background-color: var(--primary-color);
  color: white;
  box-shadow: var(--box-shadow);
}

.btn-secondary:hover {
  background-color: var(--secondary-color);

  background-color: var(--dracula-color);
  color: white;
  box-shadow: var(--box-shadow);
}

.btn-secondary:hover {
  background-color: var(--dracula-hover-color);

  color: #fff;
}

.form-actions {
  display: flex;
  justify-content: space-around;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #eaeaea;
}

.stock-info {
  background-color: #f8f9fa;
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-top: 1rem;
}

.stock-info-label {
  font-weight: 500;
  color: #555;
}

.stock-info-value {
  font-weight: 600;
  color: var(--dark-color);
}

.stock-critical {
  color: var(--danger-color);
}

.stock-warning {
  color: var(--warning-color);
}

.stock-good {
  color: var(--success-color);
}

.price-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  text-align: -webkit-center;
}

.price-list input,
select,
textarea {
  max-width: 100%;
  width: 80%;
  padding: 0.55rem;
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  font-family: inherit;
  font-size: 0.75rem;
  transition: var(--transition);
  background-color: #f9fafb;
}

.price-card {
  background: white;
  border-radius: var(--border-radius);
  padding: 1rem;
  box-shadow: var(--box-shadow);
  border-left: 4px solid var(--primary-color);
}

.price-card-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--dark-color);
}

.price-card-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
}

.unit-suffix {
  color: #6c757d;
  font-weight: 400;
  margin-left: 0.25rem;
}

.notifications {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  max-width: 350px;
}

.notification {
  padding: 15px;
  margin-bottom: 1rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  background: white;
  display: flex;
  align-items: center;
  animation: slideIn 0.3s ease-out;
  position: relative;
  min-width: 250px;
}

.notification.success {
  border-left: 4px solid var(--success-color);
  background-color: #f0f9f0;
}

.notification.error {
  border-left: 4px solid var(--danger-color);
  background-color: #fdf0f0;
}

.notification.warning {
  border-left: 4px solid var(--warning-color);
  background-color: #fff8e6;
}

.notification .close-btn {
  margin-left: auto;
  cursor: pointer;
  color: #666;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

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

/* Responsive adjustments */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions {
    flex-direction: column;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .form-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .form-container,
  .form {
    padding: 1.5rem;
  }
}

/* Custom styles for specific elements */
#stock_ml_explain,
#stock_ml_dif {
  font-size: 0.575rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

.stock-heredado-contenido {
  background-color: #f8f9fa;
  padding: 0.75rem;
  border-radius: var(--border-radius);
  margin-top: 0.5rem;
  border: 1px solid #e0e0e0;
}

.stock-heredado-scrollable {
  max-height: 90px; /* Altura máxima antes de aparecer el scroll */
  overflow-y: auto; /* Habilitar scroll vertical */
  padding-right: 5px; /* Espacio para el scroll */
}

/* Estilizar el scrollbar para mejor apariencia */
.stock-heredado-scrollable::-webkit-scrollbar {
  width: 6px;
}

.stock-heredado-scrollable::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.stock-heredado-scrollable::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.stock-heredado-scrollable::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Estilos para los spans de contenido */
#stock_ml_explain,
#stock_ml_dif {
  display: block;
  margin-bottom: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid #eee;
}

#stock_ml_explain {
  font-weight: 500;
  color: #555;
}

#stock_ml_dif {
  font-weight: 600;
  color: var(--primary-color);
}

.hidden {
  display: none;
}

/* NUEVOS ESTILOS PARA COMBOS */
.combo-section {
  background-color: #f0f8ff;
  border: 2px solid #4895ef;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-top: 1rem;
}

.combo-info {
  background-color: #e8f4f8;
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-top: 1rem;
  border-left: 4px solid var(--accent-color);
}

.combo-components-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}

.combo-component-item {
  background: white;
  border-radius: var(--border-radius);
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.component-info {
  flex: 1;
}

.component-quantity {
  font-weight: 600;
  color: var(--primary-color);
  margin-right: 1rem;
}

.section-combo {
  border-left: 4px solid #4895ef;
}
