.nmd-related-products {
  --nmd-related-blue: var(--wd-primary-color, #062a78);
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 18px 0 26px;
  padding: 23px 24px 19px;
  overflow: hidden;
  border: 1px solid #dce6f4;
  border-top: 3px solid var(--nmd-related-blue);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(6, 42, 120, .05);
  direction: rtl;
  display: none;
  font-family: iranyekanwebregular_FaNum, Arial, Helvetica, sans-serif;
}

body.nmd-related-active .nmd-related-products { display: block; }
body.nmd-related-active .related-and-upsells .related-products { display: none; }

.nmd-related-products__head,
.nmd-related-products__controls {
  display: flex;
  align-items: center;
}

.nmd-related-products__head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 17px;
}

body.single-product .nmd-related-products h2 {
  margin: 0;
  color: #17253c;
  font-family: iranyekanwebregular_FaNum, Arial, Helvetica, sans-serif;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.6;
}

.nmd-related-products__controls { gap: 7px; }

body.single-product .nmd-related-products button.nmd-related-products__arrow {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid #d8e5f7;
  border-radius: 9px;
  background: #f6f9ff;
  color: #0b4fb2;
  font-family: inherit;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

body.single-product .nmd-related-products button.nmd-related-products__arrow:hover {
  background: var(--nmd-related-blue);
  color: #fff;
}

.nmd-related-products__track {
  display: flex;
  gap: 13px;
  width: 100%;
  min-width: 0;
  padding: 2px 1px 9px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.nmd-related-products__track::-webkit-scrollbar { display: none; }

.nmd-related-products__card {
  box-sizing: border-box;
  display: flex;
  flex: 0 0 218px;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  scroll-snap-align: start;
  border: 1px solid #e5ebf4;
  border-radius: 12px;
  background: #fff;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}

.nmd-related-products__card:hover {
  transform: translateY(-2px);
  border-color: #b8cdea;
  box-shadow: 0 8px 20px rgba(6, 42, 120, .09);
}

.nmd-related-products__image {
  box-sizing: border-box;
  display: flex;
  flex: 0 0 160px;
  align-items: center;
  justify-content: center;
  height: 160px;
  padding: 9px;
  overflow: hidden;
  background: #fff;
}

.nmd-related-products__image img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.nmd-related-products__details {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 12px 12px 13px;
  border-top: 1px solid #e9eef5;
}

body.single-product .nmd-related-products a.nmd-related-products__name {
  display: -webkit-box;
  min-height: 66px;
  overflow: hidden;
  color: #17253c;
  font-family: iranyekanwebregular_FaNum, Arial, Helvetica, sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.85;
  text-decoration: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

body.single-product .nmd-related-products a.nmd-related-products__name:hover { color: #0b4fb2; }

.nmd-related-products__price {
  min-height: 24px;
  color: #0b4fb2;
  font-family: iranyekanwebregular_FaNum, Arial, Helvetica, sans-serif;
  font-size: 12px;
  line-height: 1.8;
}

.nmd-related-products__price del {
  display: block;
  color: #94a3b8;
  font-family: iranyekanwebregular_FaNum, Arial, Helvetica, sans-serif;
  font-size: 10px;
}

.nmd-related-products__price ins { text-decoration: none; }

body.single-product .nmd-related-products button.nmd-related-products__add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 37px;
  margin-top: auto;
  padding: 7px 8px;
  border: 0;
  border-radius: 9px;
  background: var(--nmd-related-blue);
  color: #fff;
  font-family: iranyekanwebregular_FaNum, Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  cursor: pointer;
}

body.single-product .nmd-related-products button.nmd-related-products__add:hover { background: #0a4aab; }
body.single-product .nmd-related-products button.nmd-related-products__add:disabled { opacity: .68; cursor: wait; }
.nmd-related-products__add span { font-family: sans-serif; font-size: 19px; line-height: 0; }

.nmd-related-products__arrow:focus-visible,
.nmd-related-products__add:focus-visible,
.nmd-related-products__name:focus-visible,
.nmd-related-products__track:focus-visible {
  outline: 2px solid #0b4fb2;
  outline-offset: 2px;
}

@media (max-width: 767px) {
  .nmd-related-products { padding: 17px 12px 13px; border-radius: 12px; }
  .nmd-related-products__head { margin-bottom: 13px; }
  body.single-product .nmd-related-products h2 { font-size: 16px; }
  body.single-product .nmd-related-products button.nmd-related-products__arrow {
    flex-basis: 29px;
    width: 29px;
    min-width: 29px;
    height: 29px;
    font-size: 16px;
  }
  .nmd-related-products__track { gap: 10px; }
  .nmd-related-products__card { flex-basis: clamp(150px, 44vw, 178px); }
  .nmd-related-products__image { flex-basis: 124px; height: 124px; }
  .nmd-related-products__details { gap: 7px; padding: 9px 9px 10px; }
  body.single-product .nmd-related-products a.nmd-related-products__name { font-size: 12px; min-height: 64px; }
  .nmd-related-products__price { font-size: 12px; }
  body.single-product .nmd-related-products button.nmd-related-products__add { min-height: 40px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .nmd-related-products__track { scroll-behavior: auto; }
  .nmd-related-products__card { transition: none; }
}
