/* Vizualizate recent: banda de carduri mici deasupra footerului (recently-viewed.js). */
.ema-recent {
  padding: 32px 0 40px;
  border-top: 1px solid #efeae5;
}

.ema-recent__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.ema-recent__title {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.ema-recent__list {
  display: flex;
  gap: 14px;
  margin: 0;
  padding: 0 0 6px;
  list-style: none;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.ema-recent__list::-webkit-scrollbar { display: none; }

/* Fade pe marginea unde mai sunt produse. */
.ema-recent__track { --fade-l: 0px; --fade-r: 0px; }
.ema-recent__track.has-prev { --fade-l: 48px; }
.ema-recent__track.has-next { --fade-r: 48px; }
.ema-recent__track .ema-recent__list {
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 var(--fade-l), #000 calc(100% - var(--fade-r)), transparent 100%);
}

.ema-recent__nav { display: flex; gap: 8px; }
.ema-recent__nav[hidden] { display: none; }

.ema-recent__arrow {
  display: flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px !important;
  height: 44px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  color: #fff !important;
  background: var(--brand, #05161f) !important;
  border: 0 !important;
  border-radius: var(--btn-brd-radius, 8px) !important;
  box-shadow: 0 4px 12px rgb(5 22 31 / 22%) !important;
  font-size: 0 !important;
  line-height: 0 !important;
  text-align: center;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease, opacity .2s ease;
}

.ema-recent__arrow:hover:not(:disabled) {
  color: #fff !important;
  background: var(--accent, #ee6d14) !important;
  border-color: var(--accent, #ee6d14) !important;
}

.ema-recent__arrow:disabled { opacity: .3; box-shadow: none !important; cursor: default; }

.ema-recent__arrow svg {
  display: block !important;
  flex: 0 0 22px;
  margin: 0 !important;
  width: 22px !important;
  height: 22px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ema-recent__item {
  flex: 0 0 150px;
  margin: 0;
  scroll-snap-align: start;
}

.ema-recent__link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}

.ema-recent__image {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f7f5f2;
  border-radius: var(--radius-card, 12px);
}

.ema-recent__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.ema-recent__link:hover .ema-recent__image img { transform: scale(1.04); }

.ema-recent__name {
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ema-recent__link:hover .ema-recent__name { color: var(--accent, #ee6d14); }

.ema-recent__price {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
}

.ema-recent__price del { color: #8a8f92; font-weight: 400; }
.ema-recent__price ins { text-decoration: none; }

@media (max-width: 600px) {
  .ema-recent { padding: 24px 0 32px; }
  .ema-recent__title { font-size: 18px; }
  .ema-recent__item { flex-basis: 120px; }
  /* Mobil: swipe, fara sageti; produsul urmator se vede partial. */
  .ema-recent__nav { display: none !important; }
  .ema-recent__track .ema-recent__list { margin-right: -15px; padding-right: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  .ema-recent__image img { transition: none; }
  .ema-recent__list { scroll-behavior: auto; }
}

/* Tema adauga pseudo-elemente pe butoane; aici ar impinge sageata din centru. */
.ema-recent__arrow::before,
.ema-recent__arrow::after { content: none !important; display: none !important; }
