/**
 * EM Similar Products v1.4.2 - desktop grid, two-row mobile auto-carousel.
 * Ten columns on desktop; two tracks of five products per group on phones.
 */
.emsp {
  --emsp-ink: #13354b;
  --emsp-brand: #0877a4;
  --emsp-tint: #eef8fc;
  --emsp-gutter: 22px;
  --emsp-gap: 11px;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: min(1580px, calc(100vw - (var(--emsp-gutter) * 2)));
  max-width: none;
  min-width: 0;
  margin: 32px 0 44px;
  padding: 21px 22px 24px;
  box-sizing: border-box;
  border: 1px solid #dfe8ed;
  border-radius: 19px;
  background: linear-gradient(160deg, #f5fbfe 0%, #fff 24%, #fff 82%, #f9fbfc 100%);
  color: var(--emsp-ink);
  box-shadow: 0 12px 36px rgba(14, 53, 76, .06);
  isolation: isolate;
}
.emsp, .emsp * { box-sizing: border-box; }
.emsp::before {
  content: '';
  position: absolute;
  inset: 0 18px auto;
  height: 3px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, var(--emsp-brand), #45bad5 48%, transparent 78%);
  opacity: .9;
}
.emsp__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 2px 0 20px;
}
.emsp__heading-wrap { min-width: 0; }
.emsp__heading {
  margin: 0 !important;
  font-size: 22px !important;
  line-height: 1.18 !important;
  font-weight: 780 !important;
  letter-spacing: -.55px;
  color: var(--emsp-ink) !important;
  text-transform: none !important;
}
.emsp__subtitle { margin: 6px 0 0; font-size: 12px; line-height: 1.4; color: #708594; }
.emsp__count {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid #d7e9f2;
  border-radius: 999px;
  background: #eef8fc;
  color: #25728f;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 750;
  white-space: nowrap;
}
.emsp__count::before { content: '✦'; font-size: 11px; color: #0698bb; }
.emsp__viewport {
  width: 100%;
  min-width: 0;
}
.emsp__grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: var(--emsp-gap);
  align-items: stretch;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow: visible;
}
.emsp__card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 1px solid #e3ebf1;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(18, 55, 79, .02);
  transition: transform .24s cubic-bezier(.2,.8,.2,1), border-color .24s ease, box-shadow .24s ease;
}
.emsp__card:hover, .emsp__card:focus-within {
  transform: translateY(-5px);
  border-color: #9fcde1;
  box-shadow: 0 11px 22px rgba(14, 63, 92, .12);
  z-index: 1;
}
.emsp__image {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 8px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 36%, #fff 43%, #f3f8fa 100%);
  text-decoration: none !important;
}
.emsp__image::after {
  content: '';
  position: absolute;
  inset: auto 14% 0;
  height: 2px;
  background: #c9e9f5;
  border-radius: 2px;
  transform: scaleX(0);
  transition: transform .3s ease;
}
.emsp__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform .42s cubic-bezier(.2,.8,.2,1);
}
.emsp__card:hover .emsp__image img, .emsp__card:focus-within .emsp__image img { transform: scale(1.075); }
.emsp__card:hover .emsp__image::after, .emsp__card:focus-within .emsp__image::after { transform: scaleX(1); }
.emsp__no-image { font-size: 27px; color: #b3c4d0; }
.emsp__discount {
  position: absolute;
  z-index: 1;
  top: 7px;
  left: 7px;
  padding: 4px 6px;
  border-radius: 6px;
  background: #cd3d50;
  color: #fff;
  font-size: 10px;
  font-weight: 750;
  box-shadow: 0 2px 5px rgba(133, 23, 43, .14);
}
.emsp__details {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 10px 9px 11px;
}
.emsp__category {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #6690a2;
  font-size: 10px;
  line-height: 1.35;
  font-weight: 710;
}
.emsp__name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  width: 100%;
  min-height: 47px;
  margin: 0 !important;
  color: var(--emsp-ink) !important;
  font-size: 11px !important;
  line-height: 1.43 !important;
  font-weight: 740 !important;
  text-transform: none !important;
  overflow-wrap: anywhere;
}
.emsp__name a { color: inherit !important; text-decoration: none !important; }
.emsp__name a:hover, .emsp__name a:focus { color: var(--emsp-brand) !important; }
.emsp__prices {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px;
  min-width: 0;
  margin: auto 0 0;
}
.emsp__price {
  color: #103a56;
  font-size: 13px;
  font-weight: 830;
  line-height: 1.2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.emsp__old-price { color: #98a6b1; font-size: 10px; white-space: nowrap; }
.emsp__link {
  display: inline-flex;
  justify-content: space-between;
  align-items: center;
  gap: 3px;
  width: 100%;
  margin-top: 5px;
  color: var(--emsp-brand) !important;
  font-size: 10px;
  font-weight: 760;
  line-height: 1.25;
  text-decoration: none !important;
}
.emsp__link-arrow {
  display: inline-block;
  font-size: 14px;
  line-height: 1;
  transition: transform .25s ease;
}
.emsp__card:hover .emsp__link-arrow, .emsp__link:focus .emsp__link-arrow { transform: translateX(4px); }

/* Mobile-only controls remain hidden on desktops and tablets. */
.emsp__mobile-toolbar { display: none; }
.emsp__autoplay { appearance: none; }

/* Progressive enhancement only: cards remain visible when JS is blocked. */
.emsp--enhanced .emsp__card {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity .5s ease var(--emsp-delay, 0ms),
    transform .5s cubic-bezier(.21,.82,.25,1) var(--emsp-delay, 0ms),
    border-color .24s ease, box-shadow .24s ease;
}
.emsp--enhanced.emsp--visible .emsp__card { opacity: 1; transform: translateY(0); }
.emsp--enhanced.emsp--visible .emsp__card:hover,
.emsp--enhanced.emsp--visible .emsp__card:focus-within { transform: translateY(-5px); }

@media (max-width: 1199px) {
  .emsp { --emsp-gutter: 16px; --emsp-gap: 12px; }
  .emsp__grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .emsp__name { font-size: 12px !important; }
  .emsp__price { font-size: 14px; }
}
@media (max-width: 760px) {
  .emsp { --emsp-gutter: 12px; --emsp-gap: 10px; padding: 16px 13px 18px; margin: 24px 0 28px; border-radius: 14px; }
  .emsp__top { margin-bottom: 15px; }
  .emsp__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .emsp__heading { font-size: 19px !important; }
  .emsp__subtitle { font-size: 11px; }
  .emsp__count { font-size: 10px; padding: 6px 9px; }
  .emsp__details { padding: 9px 8px 10px; }
}
@media (max-width: 480px) {
  .emsp { --emsp-gutter: 9px; --emsp-gap: 9px; padding: 14px 11px 16px; }
  .emsp__heading { font-size: 18px !important; }
  .emsp__subtitle { margin-top: 4px; }
  .emsp__count { display: none; }
  .emsp__image { padding: 10px; }
  .emsp__name { font-size: 12px !important; }
  .emsp__price { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .emsp__card, .emsp__image img, .emsp__image::after, .emsp__link-arrow,
  .emsp--enhanced .emsp__card { transition: none !important; animation: none !important; }
  .emsp--enhanced .emsp__card { opacity: 1 !important; transform: none !important; }
}

/* 1.4.2: smartphone carousel shows ALL 5 products of a row simultaneously.
   The carousel advances by a complete 2x5 page (10 products), not by one card.
   Five compact columns are fitted precisely to the available viewport width. */
@media (max-width: 640px) {
  .emsp { --emsp-gap: 5px; --emsp-four-gaps: 20px; }
  .emsp__top { margin-bottom: 9px; }
  .emsp__mobile-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin: 0 0 9px;
  }
  .emsp__mobile-controls {
    display: inline-flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
  }
  .emsp__sequence { font-size: 11px; color: #376f88; font-variant-numeric: tabular-nums; }
  .emsp__autoplay {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 30px;
    min-width: 67px;
    padding: 4px 9px;
    border: 1px solid #cce4ee;
    border-radius: 999px;
    background: #eef8fc;
    color: #166386;
    cursor: pointer;
    font-size: 10px;
    font-weight: 750;
    line-height: 1.2;
  }
  .emsp__autoplay:disabled { opacity: .75; cursor: default; }
  .emsp__autoplay:focus-visible { outline: 2px solid #006c9b; outline-offset: 2px; }
  .emsp__viewport {
    position: relative;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline-start: 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
  }
  .emsp__viewport::-webkit-scrollbar { display: none; }
  .emsp__grid {
    display: grid;
    grid-template-columns: none;
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
    /* Precisely 5 full columns in the viewport, accounting for 4 gaps. */
    grid-auto-columns: calc((100% - var(--emsp-four-gaps)) / 5);
    column-gap: var(--emsp-gap);
    row-gap: 8px;
    align-items: stretch;
    width: 100%;
    min-width: 0;
    overflow: visible;
  }
  .emsp__card {
    align-self: stretch;
    min-width: 0;
    min-height: 0;
    height: 100%;
    border-radius: 8px;
    scroll-snap-align: none;
    box-shadow: none;
  }
  /* Snap to the start of every complete batch of 10 products (2 rows x 5). */
  .emsp__card:nth-child(10n + 1) { scroll-snap-align: start; scroll-snap-stop: always; }
  .emsp__card:hover, .emsp__card:focus-within { transform: none; }
  .emsp__image {
    aspect-ratio: 1 / 1;
    padding: 2px;
    min-width: 0;
  }
  .emsp__image img { max-width: 100%; }
  .emsp__details {
    padding: 5px 3px 6px;
    gap: 3px;
    min-width: 0;
  }
  .emsp__category { display: none; }
  .emsp__name {
    display: -webkit-box;
    width: 100%;
    height: 2.8em;
    min-height: 0;
    margin: 0 !important;
    font-size: clamp(9px, 2.55vw, 11px) !important;
    line-height: 1.4 !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
  }
  .emsp__prices {
    display: block;
    min-width: 0;
    width: 100%;
    margin: auto 0 0;
  }
  .emsp__price {
    display: block;
    font-size: clamp(9px, 2.45vw, 11px);
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: anywhere;
    font-weight: 820;
  }
  .emsp__old-price, .emsp__link { display: none; }
  .emsp__discount {
    top: 2px; left: 2px;
    padding: 2px;
    border-radius: 3px;
    font-size: 8px;
    box-shadow: none;
  }
  .emsp__no-image { font-size: 16px; }
  .emsp__hint { display: block; margin: 8px 0 0; text-align: center; color: #8095a2; font-size: 10px; }
  .emsp--enhanced .emsp__card { transition-delay: 0ms; }
}
@media (max-width: 380px) {
  .emsp { --emsp-gap: 4px; --emsp-four-gaps: 16px; padding-left: 8px; padding-right: 8px; }
  .emsp__details { padding-left: 2px; padding-right: 2px; }
}
@media (min-width: 641px) { .emsp__hint { display: none; } }
@media (prefers-reduced-motion: reduce) { .emsp__viewport { scroll-behavior: auto !important; } }
