.margen-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background-color: #000;
  color: white;
  padding: 10px 15px;
  border-radius: 6px;
  cursor: pointer;
  z-index: 1000;
  font-weight: bold;
  transition: background 0.3s ease;
}
.margen-btn:hover {
  background-color: #7A7A7A;
  color: #fff;
}

.margen-popup {
  position: fixed;
  bottom: 70px;
  left: 20px;
  background-color: white;
  border: 2px solid black;
  padding: 15px;
  z-index: 1001;
  border-radius: 6px;
  box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
  width: 220px;
}
.margen-popup input[type="number"] {
  width: 80px;
  margin-bottom: 10px;
}
.margenApply {
  background-color: #E8363C;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 5px;
  border: none;
  min-height: 2.4rem;
  transition: all 0.4s;
}
.margenApply:hover {
  background-color: white;
  color: #E8363C;
}
.margenClose {
  background-color: #7A7A7A;
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 5px;
  border: none;
  min-height: 2.4rem;
   transition: all 0.4s;
}
.margenClose:hover {
  background-color: white;
  color: #7A7A7A;
}

/* Resaltar precio calculado, sin ocultar descuentos nativos */
.mto-contador-precio-con-ganancia { font-weight: 600; color: #000; }

/* Leyenda bajo el precio calculado */
.mto-precio-leyenda {
  display: block !important;
  font-size: 12px;
  color: #555;
  margin-top: 4px;
}

/* Asegurar visibilidad dentro del contenedor de precio del producto */
.current-price .mto-precio-leyenda {
  display: block !important;
}

/* Estilos para la vista de list */
.mto-contador-resultado.final .mto-contador-precio-con-ganancia {
  font-weight: 700;
  color: #000;
  display: block;
}

.mto-contador-resultado.final .mto-precio-leyenda {
  display: block !important;
  font-size: 11px;
  color: #666;
  margin-top: 2px;
}

/* Leyenda inline para precios de vista list */
.mto-precio-leyenda-inline {
  display: inline-block !important;
  font-size: 11px !important;
  color: #666 !important;
  margin-top: 2px;
  font-weight: normal !important;
}

body[data-margen-show-legend="0"] .mto-precio-leyenda-inline {
  display: none !important;
}

/* Contenedor de leyenda debajo del .mto-contador */
.mto-margen-leyenda-container {
  font-size: 11px;
  color: #666;
  margin-top: 6px;
  text-align: center;
  font-weight: normal;
}

body[data-margen-show-legend="0"] .mto-margen-leyenda-container {
  display: none !important;
}

/* Ocultar leyendas dentro del .mto-contador (solo debe aparecer debajo) */
.mto-contador .mto-precio-leyenda,
.mto-contador .mto-precio-leyenda-inline {
  display: none !important;
}

/* Asegurar que el precio calculado se vea correctamente */
.mto-precio-calculado {
  display: inline-block !important;
  font-weight: 600;
  color: #000;
}

/* Asegurar que el contenedor de precio mantenga el layout inline */
.mto-contador-precio-container {
  display: inline-flex;
  align-items: center;
}

/* Asegurar que todos los elementos dentro mantengan el espaciado */
.mto-contador-precio .current-price,
.mto-contador-precio .mto-precio-calculado {
  display: inline-block;
}

/* Ocultar leyenda según flags del backoffice */
/* Un único flag global */
body[data-margen-show-legend="0"] .mto-precio-leyenda {
  display: none !important;
}