/* WM Recently Viewed Products 1.0.1 — uses the same wm-card vocabulary as the category template. */
.wm-recently-viewed {
  width: 100%;
  margin: 28px auto;
  position: relative;
}

.wm-recently-viewed__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.wm-recently-viewed .wm-recently-viewed__title,
.wm-recently-viewed .wm-module__title {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  font-weight: 700;
}

.wm-recently-viewed .wm-recently-viewed__products {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 12px;
}

.wm-recently-viewed .wm-card {
  width: 100%;
  max-width: none;
  min-width: 0;
  padding: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 12px;
  transition: box-shadow .3s ease;
}

.wm-recently-viewed .wm-card:hover {
  z-index: 10;
  box-shadow: 0 10px 25px rgba(0,0,0,.1);
}

.wm-recently-viewed .wm-card__top {
  margin-bottom: 15px;
  position: relative;
}

.wm-recently-viewed .wm-card__img-wrap {
  display: block;
  text-align: center;
}

.wm-recently-viewed .wm-card__img {
  width: 100%;
  max-width: 100%;
  height: var(--wm-rv-image-height, 200px);
  object-fit: contain;
}

.wm-recently-viewed .wm-card__badges {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 2;
}

.wm-recently-viewed .wm-badge {
  display: inline-block;
  width: max-content;
  margin-bottom: 2px;
  padding: 0 6px;
  color: #fff;
  background: #f44336;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.wm-recently-viewed .wm-card__actions {
  position: absolute;
  top: 40px;
  right: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity .3s, transform .3s;
}

.wm-recently-viewed .wm-card:hover .wm-card__actions {
  opacity: 1;
  transform: translateX(0);
}

.wm-recently-viewed .wm-icon-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f8f9fa;
  color: #555;
  cursor: pointer;
}

.wm-recently-viewed .wm-icon-btn:hover {
  background: var(--wm-brand, #1e3a8a);
  color: #fff;
}

.wm-recently-viewed .wm-card__meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #888;
  font-size: 12px;
}

.wm-recently-viewed .wm-card__meta-statuses {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.wm-recently-viewed .wm-card__status {
  padding: 2px 6px;
  border-radius: 4px;
}

.wm-recently-viewed .wm-card__status--instock {
  color: #4caf50;
  background: #e8f5e9;
}

.wm-recently-viewed .wm-card__status--outofstock {
  color: #b45309;
  background: #fff7ed;
}

.wm-recently-viewed .wm-card__consultation {
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border-radius: 4px;
  background: #fff3bf;
  color: #7a5200;
  line-height: 1.2;
  white-space: nowrap;
}

.wm-recently-viewed .wm-card__title {
  min-height: 63px;
  margin: 0 0 10px;
  overflow: hidden;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.wm-recently-viewed .wm-card__title a {
  color: #222;
  font-weight: 600;
  text-decoration: none;
}

.wm-recently-viewed .wm-card__title a:hover { color: var(--wm-brand, #1e3a8a); }

.wm-recently-viewed .wm-card__installations {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 4px;
  color: #777;
  font-size: 12px;
  line-height: 1.3;
}

.wm-recently-viewed .wm-card__rating {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
  color: #ffc107;
  font-size: 12px;
}

.wm-recently-viewed .wm-card__reviews-count { color: #888; }

.wm-recently-viewed .wm-card__bottom {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.wm-recently-viewed .wm-price-old {
  color: #999;
  font-size: 13px;
  text-decoration: line-through;
}

.wm-recently-viewed .wm-price-new,
.wm-recently-viewed .wm-price-main {
  color: #d32f2f;
  font-size: 20px;
  font-weight: 700;
}

.wm-recently-viewed .wm-price-main { color: #222; }
.wm-recently-viewed .wm-card__buy-block { display: flex; align-items: center; }

.wm-recently-viewed .wm-qty-selector {
  display: none;
  height: 40px;
  overflow: hidden;
  background: #f1f1f1;
  border-radius: 6px 0 0 6px;
}

.wm-recently-viewed .wm-card:hover .wm-qty-selector { display: flex; }

.wm-recently-viewed .wm-qty-btn {
  width: 25px;
  padding: 0;
  border: 0;
  background: none;
  font-weight: 700;
  cursor: pointer;
}

.wm-recently-viewed .wm-qty-input {
  width: 30px;
  padding: 0;
  border: 0;
  outline: 0;
  background: none;
  text-align: center;
  font-size: 14px;
}

.wm-recently-viewed .wm-btn--cart {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: #0c7bdf;
  color: #fff;
  cursor: pointer;
}

.wm-recently-viewed .wm-card:hover .wm-btn--cart { border-radius: 0 6px 6px 0; }
.wm-recently-viewed .wm-icon-svg { display: block; width: 18px; height: 18px; }
.wm-recently-viewed .wm-icon-svg svg { display: block; width: 100%; height: 100%; }

.wm-recently-viewed .wm-card__hover-attrs {
  position: absolute;
  top: 100%;
  right: -1px;
  left: -1px;
  z-index: 9;
  padding: 0 16px 16px;
  visibility: hidden;
  opacity: 0;
  background: #fff;
  border: 1px solid #f0f0f0;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 15px 25px rgba(0,0,0,.1);
  transition: opacity .2s;
}

.wm-recently-viewed .wm-card:hover .wm-card__hover-attrs { visibility: visible; opacity: 1; }

.wm-recently-viewed .wm-attr-list {
  margin: 0;
  padding: 0;
  list-style: none;
  color: #555;
  font-size: 12px;
}

.wm-recently-viewed .wm-attr-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px dotted #ddd;
}

.wm-recently-viewed__nav { display: none; gap: 6px; }
.wm-recently-viewed__arrow {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  background: #fff;
  color: #0c7bdf;
}

.wm-recently-viewed__footer {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.wm-recently-viewed__view-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 22px;
  border: 1px solid #0c7bdf;
  border-radius: 10px;
  background: #fff;
  color: #0c7bdf;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.wm-recently-viewed__view-all:hover,
.wm-recently-viewed__view-all:focus {
  background: #0c7bdf;
  color: #fff;
  transform: translateY(-1px);
}

.wm-recently-viewed-page { padding-bottom: 36px; }
.wm-recently-viewed-page__title { margin: 10px 0 24px; font-weight: 800; }
.wm-recently-viewed-page__empty { padding: 24px 0 40px; }
#wm-recently-viewed-all { margin-top: 0; }

@media (min-width: 768px) and (max-width: 1199px) {
  .wm-recently-viewed .wm-recently-viewed__products {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 767px) {
  .wm-recently-viewed { margin: 22px auto; overflow: hidden; }
  .wm-recently-viewed__header { margin-bottom: 14px; }
  .wm-recently-viewed .wm-recently-viewed__title { font-size: 20px; }
  .wm-recently-viewed .wm-card__actions,
  .wm-recently-viewed .wm-card__hover-attrs,
  .wm-recently-viewed .wm-qty-selector,
  .wm-recently-viewed .wm-card:hover .wm-qty-selector { display: none; }
  .wm-recently-viewed .wm-card:hover .wm-btn--cart { border-radius: 9px; }

  .wm-recently-viewed--mobile-default .wm-recently-viewed__products,
  .wm-recently-viewed--mobile-two .wm-recently-viewed__products {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .wm-recently-viewed--mobile-full .wm-recently-viewed__products { grid-template-columns: 1fr !important; }
  .wm-recently-viewed--mobile-full .wm-card { max-width: none; }

  .wm-recently-viewed--mobile-default .wm-card,
  .wm-recently-viewed--mobile-two .wm-card { max-width: none; padding: 10px; border-radius: 14px; }
  .wm-recently-viewed--mobile-default .wm-card__top,
  .wm-recently-viewed--mobile-two .wm-card__top { margin-bottom: 10px; }
  .wm-recently-viewed--mobile-default .wm-card__img,
  .wm-recently-viewed--mobile-two .wm-card__img { height: 125px; }
  .wm-recently-viewed--mobile-default .wm-card__meta,
  .wm-recently-viewed--mobile-two .wm-card__meta { font-size: 10px; }
  .wm-recently-viewed--mobile-default .wm-card__meta-statuses,
  .wm-recently-viewed--mobile-two .wm-card__meta-statuses { gap: 4px; flex-wrap: wrap; }
  .wm-recently-viewed--mobile-default .wm-card__consultation,
  .wm-recently-viewed--mobile-two .wm-card__consultation { padding: 4px; font-size: 9px; }
  .wm-recently-viewed--mobile-default .wm-card__title,
  .wm-recently-viewed--mobile-two .wm-card__title { height: 52px; min-height: 52px; margin-bottom: 8px; font-size: 13px; line-height: 1.35; }
  .wm-recently-viewed--mobile-default .wm-card__rating,
  .wm-recently-viewed--mobile-two .wm-card__rating { gap: 5px; margin-bottom: 10px; font-size: 10px; flex-wrap: wrap; }
  .wm-recently-viewed--mobile-default .wm-price-old,
  .wm-recently-viewed--mobile-two .wm-price-old { font-size: 11px; }
  .wm-recently-viewed--mobile-default .wm-price-new,
  .wm-recently-viewed--mobile-default .wm-price-main,
  .wm-recently-viewed--mobile-two .wm-price-new,
  .wm-recently-viewed--mobile-two .wm-price-main { font-size: 15px; line-height: 1.1; white-space: nowrap; }
  .wm-recently-viewed--mobile-default .wm-btn--cart,
  .wm-recently-viewed--mobile-two .wm-btn--cart { width: 40px; min-width: 40px; height: 34px; padding: 0; border-radius: 9px; }

  .wm-recently-viewed--mobile-slider .wm-recently-viewed__nav { display: flex; }
  .wm-recently-viewed--mobile-slider .wm-recently-viewed__products {
    display: flex !important;
    gap: 10px;
    overflow-x: auto;
    padding: 2px 18vw 12px 0;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .wm-recently-viewed--mobile-slider .wm-recently-viewed__products::-webkit-scrollbar { display: none; }
  .wm-recently-viewed--mobile-slider .wm-card {
    flex: 0 0 min(78vw, 300px);
    max-width: min(78vw, 300px);
    scroll-snap-align: start;
  }
}
