.main_wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px;
  gap: 6px;
}

.asnaf_wrap {
  display: flex;
  padding: 4px;
  flex-wrap: wrap;
  margin: 0 0 60px;
  /* gap: 8px;*/
  column-gap: 7px;
  row-gap: 2px;
  justify-content: space-evenly;
}

/* -------------------------------------------------------------------- */
/* no wrap or overflow for wide text - just respect its width */
/* .sanf .sanf_name {
  font-size: 14px;
  font-family: "Cairo";
  color: var(--MAIN-MASTARD);
  user-select: none;
}
.sanf {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  width: max-content;
  border-radius: 4px;
  padding: 4px;
  color: black;
  min-width: 160px;
} */
/* -------------------------------------------------------------------- */

.sanf {
  display: inline-flex; /* behaves like inline-block, but still flex */
  flex-direction: column;
  gap: 4px;
  align-items: center;
  border-radius: 4px;
  padding: 4px;
  color: black;
  /* min-width: 160px; */
  width: 160px;
  max-width: 100%; /* allow it to shrink when sanf_name shrinks */
}

.sanf .sanf_name {
  font-size: 13px;
  font-family: "Cairo";
  color: var(--MAIN-MASTARD);
  user-select: none;
  overflow-wrap: break-word;
  word-wrap: break-word;
  white-space: normal; /* allow wrapping */
  text-align: center; /* optional for better alignment */
  max-width: 100%; /* respect parent constraints */
}

.sanf .img_wrap {
  height: 80px;
  width: 100%;
  background-color: white;
  border-radius: 6px;
  padding: 3px;
  display: flex;
  justify-content: center;
  align-items: center;
}
/* product img */
.img_wrap > img {
  max-width: 100%;
  max-height: 100%;
  height: auto;
  width: auto;
  display: block;
  margin: auto;
  object-fit: contain;
}
/* ----------- */
.sanf .prices {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 4px;
  background-color: black;
  box-shadow: 0 0 5px white;
  border-radius: 5px;
  gap: 9px;
  user-select: none;
}
.prices .min_p,
.disp_p {
  color: var(--MAIN-MASTARD);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
}
.prices.user .min_p,
.disp_p {
  cursor: none;
  pointer-events: none;
}

.prices .prc,
.disp_p .prc {
  height: max-content;
  font-size: 13px;
  line-height: 13px;
  margin-bottom: 0;
  font-family: "Poppins";
}

.prices .crn,
.disp_p .crn {
  color: #a5a5a5;
  font-size: 13px;
  line-height: 13px;
  margin-bottom: 3px;
}
.sanf .prices img,
.disp_p img {
  width: 12px;
  height: auto;
  margin-bottom: 2px;
}

.bl {
  display: flex;
  width: 100%;
  margin-top: 1px;
  justify-content: space-between;
  background-color: transparent;
  align-items: center;
  user-select: none;
}
.bl .btn_rem_sanf {
  background: transparent;
  cursor: pointer;
  border: none;
  outline: none;
  /* align-self: flex-start; */
  background-color: maroon;
  color: white;
  border-radius: 3px;
  padding: 2px 4px;
  /* margin-top: 4px; */
}
.bl .bef_disc {
  display: inline-flex;
  justify-content: center;
  align-items: flex-end;
  gap: 3px;
  font-size: 13px;
  margin-left: auto;
  position: relative;
  /* display: inline-block; */
  font-weight: normal;
  direction: rtl;
  background-color: black;
  padding: 1px 3px;
  box-shadow: 0 0 5px #b80000 inset;
  border-radius: 4px;
  cursor: none;
  pointer-events: none;
  overflow: hidden;
  user-select: none;
}

.bl.admin .bef_disc {
  cursor: pointer;
  pointer-events: all;
}

.bef_disc .prc {
  color: #febe00c5;
  height: max-content;
  line-height: 13px;
  margin-bottom: 0;
  font-family: "Poppins";
}

.bef_disc .crn {
  color: #a5a5a5c9;
  line-height: 13px;
  margin-bottom: 3px;
}

.bef_disc::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  /* bottom: 4px; */
  width: 100%;
  height: 3px;
  background: #b8000085;
  transform: rotate(-18deg); /* angle */
  transform-origin: center;
}

.prices .unit_name {
  color: #999999;
  cursor: pointer;
  font-size: 13px;
}

.prices.user .unit_name {
  cursor: none;
  pointer-events: none;
}

/* --------- is_shown_to_user switch ---------- */
.bl.admin .switch {
  position: relative;
  /* display: inline-block; */
  width: 30px;
  height: 15px;
}

/* Hide default HTML checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider */
.switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #999999;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

.switch .slider::before {
  position: absolute;
  content: "";
  height: 10px;
  width: 10px;
  left: 2px;
  bottom: 3px;
  background-color: white;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

.switch input:checked + .slider {
  background-color: #00ff37;
  /* background-color: #2196f3; */
}

.switch input:focus + .slider {
  /* box-shadow: 0 0 1px #2196f3; */
  box-shadow: 0 0 1px #00ff37;
}

.switch input:checked + .slider::before {
  -webkit-transform: translateX(16px);
  -ms-transform: translateX(16px);
  transform: translateX(16px);
}

/* Rounded sliders */
.switch .slider.round {
  border-radius: 10px;
}

.slider.round::before {
  border-radius: 50%;
}
/* ------ was_bought_higher ------ */
.was_bought_higher {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 100%;
  margin-top: 1px;
  background-color: maroon;
  align-items: center;
  user-select: none;
  padding: 5px;
  font-size: 12px;
  border-radius: 5px;
}

.last_recorded_high_price {
  font-size: 17px;
  color: white;
  font-weight: bold;
}

.wbh_btns button {
  margin-inline: 4px;
  border: none;
  outline: none;
  padding: 2px 4px;
  border-radius: 3px;
  cursor: pointer;
  background-color: black;
}
.btn_leverage_to_high {
  color: green;
  font-weight: bold;
}
.btn_ignore_high {
  color: maroon;
}
.wbh_btns button:hover {
  box-shadow: 0 0 5px black;
}
/* ------- media ----------- */
@media (max-width: 365px) {
  .asnaf_wrap {
    column-gap: 4px;
  }
  .sanf .sanf_name {
    font-size: 12px;
  }
  .sanf {
    width: 150px;
  }
}

@media (max-width: 340px) {
  .asnaf_wrap {
    column-gap: 3px;
  }
  .sanf .sanf_name {
    font-size: 11px;
  }
  .sanf {
    width: 135px;
  }
}
