/*
 * Recently viewed products
 *
 * Owns the site-wide, browser-local product history section rendered before
 * the public footer. Product-card/listing styles remain independent.
 */

.recently-viewed-products {
  --recently-viewed-visible:1;
  width:100%;
  max-width:100%;
  min-width:0;
  margin:46px 0 0;
  padding:38px 0 42px;
  background:#f7f7f7;
  box-sizing:border-box;
}

.recently-viewed-products[hidden] {
  display:none;
}

.recently-viewed-products__header {
  margin:0 0 25px;
  text-align:center;
}

.recently-viewed-products__header h2 {
  display:inline-block;
  margin:0;
  padding:0 0 9px;
  border-bottom:2px solid #e3262e;
  color:#202020;
  font-size:22px;
  font-weight:700;
  line-height:1.3;
}

.recently-viewed-products__collection {
  position:relative;
  width:100%;
  max-width:100%;
  min-width:0;
  padding:0 20px;
  box-sizing:border-box;
}

.recently-viewed-products__viewport {
  display:block;
  width:100%;
  max-width:100%;
  min-width:0;
  margin:0;
  overflow-x:auto;
  overflow-y:hidden;
  padding:10px 0;
  scrollbar-width:none;
  scroll-behavior:smooth;
  scroll-snap-type:x mandatory;
  box-sizing:border-box;
}

.recently-viewed-products__viewport::-webkit-scrollbar {
  display:none;
}

.recently-viewed-products__track {
  display:flex;
  width:100%;
  min-width:100%;
  gap:20px;
  box-sizing:border-box;
}

.recently-viewed-products__card {
  display:grid;
  grid-template-columns:112px minmax(0, 1fr);
  flex:0 0 calc((100% - (20px * (var(--recently-viewed-visible) - 1))) / var(--recently-viewed-visible));
  width:calc((100% - (20px * (var(--recently-viewed-visible) - 1))) / var(--recently-viewed-visible));
  max-width:none;
  min-width:0;
  min-height:128px;
  margin:0;
  overflow:hidden;
  border:1px solid #dedede;
  border-radius:8px;
  background:#ffffff;
  color:#202020;
  text-decoration:none;
  box-shadow:0 2px 7px rgba(0, 0, 0, 0.08);
  box-sizing:border-box;
  scroll-snap-align:start;
  transition:border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.recently-viewed-products__image-wrap {
  display:flex;
  align-items:center;
  justify-content:center;
  min-width:0;
  min-height:0;
  padding:10px;
  border-right:1px solid #eeeeee;
  background:#ffffff;
}

.recently-viewed-products__image {
  display:block;
  width:100%;
  height:100%;
  max-width:92px;
  max-height:92px;
  object-fit:contain;
}

.recently-viewed-products__content {
  display:flex;
  min-width:0;
  flex-direction:column;
  align-items:flex-start;
  padding:16px 15px 14px;
}

.recently-viewed-products__name {
  display:-webkit-box;
  overflow:hidden;
  color:#202020;
  font-size:14px;
  font-weight:600;
  line-height:1.38;
  text-overflow:ellipsis;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
}

.recently-viewed-products__prices {
  display:flex;
  min-height:22px;
  margin-top:auto;
  padding-top:10px;
  gap:7px;
  align-items:baseline;
  flex-wrap:wrap;
}

.recently-viewed-products__price {
  color:#000000;
  font-size:16px;
  font-weight:700;
  line-height:1.2;
}

.recently-viewed-products__regular-price {
  color:#aa0000;
  font-size:16px;
  font-weight:700; 
  line-height:1.2;
  text-decoration:line-through;
}

.recently-viewed-products__controls {
  position:static;
  z-index:4;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:40px;
  margin:15px 0 0;
  pointer-events:none;
  transform:none;
}

.recently-viewed-products__arrow {
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  width:38px;
  height:38px;
  padding:0;
  border:1px solid #cccccc;
  border-radius:50%;
  background:#ffffff;
  color:#e3262e;
  font-size:38px;
  font-weight:500;
  line-height:1;
  cursor:pointer;
  pointer-events:auto;
  user-select:none;
  -webkit-tap-highlight-color:transparent;
  box-shadow:0 2px 6px rgba(0,0,0,0.16);
  transition:background-color .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.recently-viewed-products__arrow::after {
  position:absolute;
  inset:-4px;
  content:"";
}

.recently-viewed-products__arrow:disabled {
  opacity:1;
  cursor:pointer;
}

.recently-viewed-products__arrow span {
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  height:100%;
  transform:translateY(-2px);
}

.recently-viewed-products__arrow span i {
  display:block;
  font-style:normal;
  line-height:1;
}

.recently-viewed-products__arrow span i + i {
  display:none;
}

.recently-viewed-products__arrow--prev span {
  transform:translate(-1px,-2px);
}

.recently-viewed-products__arrow--next span {
  transform:translate(1px,-2px);
}

@media (hover:hover) and (pointer:fine) {
  .recently-viewed-products__card:hover {
    border-color:#c9c9c9;
    box-shadow:0 4px 11px rgba(0, 0, 0, 0.12);
    transform:translateY(-1px);
  }

  .recently-viewed-products__arrow:hover {
    border-color:#d61f26;
    background:#d61f26;
    color:#fff;
  }
}

.recently-viewed-products__arrow:active {
  border-color:#d61f26;
  background:#d61f26;
  color:#fff;
}

.recently-viewed-products__arrow:focus {
  outline:0;
}

@media (min-width:601px) {
  .recently-viewed-products {
    --recently-viewed-visible:2;
  }
}

@media (min-width:901px) {
  .recently-viewed-products {
    --recently-viewed-visible:2;
  }
}

@media (min-width:1280px) {
  .recently-viewed-products {
    --recently-viewed-visible:3;
  }
}

@media (min-width:1600px) {
  .recently-viewed-products {
    --recently-viewed-visible:4;
  }
}

@media (max-width:1279px) {
  .recently-viewed-products {
    margin-top:34px;
    padding:32px 0 36px;
  }
}

@media (max-width:600px) {
  .recently-viewed-products {
    margin-top:60px;
    padding:26px 0 30px;
  }

  .recently-viewed-products__header {
    margin-bottom:19px;
  }

  .recently-viewed-products__header h2 {
    font-size:18px;
  }

  .recently-viewed-products__card {
    grid-template-columns:102px minmax(0, 1fr);
    min-height:120px;
  }

  .recently-viewed-products__image-wrap {
    padding:9px;
  }

  .recently-viewed-products__image {
    max-width:84px;
    max-height:84px;
  }

  .recently-viewed-products__content {
    padding:14px 13px 12px;
  }
}
