/* ---------- Root ---------- */
section.rvpw-recently-view.products{
  --rv-image-h: 240px;
  position:relative; isolation:isolate; box-sizing:border-box;
  margin:0 0 30px; max-width:100%; overflow-x:hidden; contain: layout paint;
}

/* Helper class applied to the HOST Kadence column */
.kv-rv-host-col{
  margin-left:0 !important; margin-right:0 !important;
  max-width:none !important; width:100% !important;
}

/* ---------- Header ---------- */
section.rvpw-recently-view .kv-rv-header{
  position: relative;
  display:flex; align-items:center; justify-content:flex-start;
  width:100%; text-align:left;
  margin:0 0 20px; z-index:1; min-height: 30px;
}
section.rvpw-recently-view .kv-rv-header h2{
  margin:0;
  color: var(--global-palette4);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.5;
  text-align:left;
}
section.rvpw-recently-view .kv-rv-header h2 a{
  color: var(--global-palette4);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.5;
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* Clear Button Styles */
section.rvpw-recently-view .kv-rv-clear{
  position: static;
  display:block;
  margin: 8px auto 0;
  border:0; background:none; padding:0;
  font-size:13px; text-decoration:underline; cursor:pointer; color:#888;
}
section.rvpw-recently-view .kv-rv-clear:hover{ color:#000; }

/* ---------- Slider shell ---------- */
section.rvpw-recently-view .kv-rv-slider{
  position:relative; width:100%; max-width:100%; margin:0 auto; overflow-x:hidden; z-index:1;
  padding:0 40px; box-sizing:border-box;
}
section.rvpw-recently-view .kv-rv-track-wrap{
  position:relative; width:100%; max-width:100%; margin:0 auto; overflow:hidden; cursor:grab;
  touch-action: pan-y; box-sizing:border-box;
}
section.rvpw-recently-view .kv-rv-track-wrap.kv-rv-grabbing{ cursor:grabbing; user-select:none; }

/* ---------- Track & cards ---------- */
section.rvpw-recently-view .kv-rv-track-wrap>ul.products{
  display:flex !important; flex-wrap:nowrap !important; align-items:flex-start;
  gap:2px !important; column-gap:2px !important; row-gap:0 !important;
  padding:0; margin:0; list-style:none; transition:transform .35s ease;
  width:auto; max-width:none; justify-content:flex-start;
}

/* Static Mode (Few Items) */
section.rvpw-recently-view.kv-static-mode .kv-rv-slider{ padding: 0; }
section.rvpw-recently-view.kv-static-mode .kv-rv-track-wrap{ overflow: visible; cursor: default; }
section.rvpw-recently-view.kv-static-mode ul.products{ justify-content: center; transform: none !important; }

/* Clamp card */
section.rvpw-recently-view .kv-rv-track-wrap>ul.products>li.product{
  box-sizing:border-box; flex:0 0 220px !important; max-width:220px !important;
  margin:0 !important; float:none !important; text-align:left !important; padding:0 !important;
  display:flex; flex-direction:column;
  height: calc(var(--rv-image-h) + 48px);
  overflow:hidden;
}

/* Image */
section.rvpw-recently-view .kv-rv-track-wrap>ul.products>li.product .kwt-image-wrap,
section.rvpw-recently-view .kv-rv-track-wrap>ul.products>li.product a.woocommerce-loop-image-link{
  display:flex; align-items:center; justify-content:flex-start !important;
  height:var(--rv-image-h); min-height:var(--rv-image-h); overflow:hidden; width:100%;
}
section.rvpw-recently-view .kv-rv-track-wrap>ul.products>li.product img{
  display:block; max-width:100%; max-height:100%; width:auto; height:auto; object-fit:contain; margin:0 !important;
}

/* Title */
section.rvpw-recently-view .woocommerce-loop-product__title,
section.rvpw-recently-view .woocommerce-loop-product__title a{
  font-size:14px; line-height:1.3; margin:0px 0 0 !important; padding:0 !important;
  padding-top:0 !important; padding-bottom:0 !important;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; text-overflow:ellipsis;
  min-height:calc(1.3em * 2); text-align:left !important;
}

/* Hide Meta */
section.rvpw-recently-view ul.products li.product .button,
section.rvpw-recently-view ul.products li.product .price,
section.rvpw-recently-view ul.products li.product .star-rating{ display:none !important; }

/* Arrows */
section.rvpw-recently-view .kv-rv-arrow{
  position:absolute; top:calc(var(--rv-image-h) / 2); transform:translateY(-50%);
  width:34px; height:34px; border-radius:50%; border:1px solid #ccc; background:#fff;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  font-size:18px !important; color:#000 !important; padding:0; z-index:2;
}
section.rvpw-recently-view .kv-rv-prev{left:8px;}
section.rvpw-recently-view .kv-rv-next{right:8px;}

/* Dots */
section.rvpw-recently-view .kv-rv-dots{
  display:flex;
  justify-content:center;
  margin:8px 0 0;
  width:100%;
  overflow:hidden;
}
section.rvpw-recently-view .kv-rv-dots-track{
  display:flex;
  gap:8px;
  transition: transform 0.25s ease;
}
section.rvpw-recently-view .kv-rv-dot{
  width:8px;
  height:8px;
  border-radius:999px;
  border:0;
  padding:0;
  background:#cfcfcf;
  opacity:.5;
  cursor:pointer;
  transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.25s ease;
}
section.rvpw-recently-view .kv-rv-dot.is-overflow{
  width:5px;
  height:5px;
  opacity:.6;
}
section.rvpw-recently-view .kv-rv-dot.is-active{
  background:#333;
  opacity:1;
}

/* Responsive */
@media (min-width:759px) and (max-width:1024px){
  section.rvpw-recently-view.products{ --rv-image-h: 210px; }
  section.rvpw-recently-view .kv-rv-slider{padding:0 34px;}
  section.rvpw-recently-view .kv-rv-track-wrap>ul.products{ gap:8px !important; }
  section.rvpw-recently-view .kv-rv-track-wrap>ul.products>li.product{ flex:0 0 190px !important; max-width:190px !important; }
}
@media (max-width:758px){
  section.rvpw-recently-view.products{ --rv-image-h: 160px; }
  section.rvpw-recently-view .kv-rv-slider{padding:0 34px;}
  section.rvpw-recently-view .kv-rv-track-wrap>ul.products{ gap:8px !important; }
  section.rvpw-recently-view .kv-rv-track-wrap>ul.products>li.product{ flex:0 0 160px !important; max-width:160px !important; }
}
@media (max-width:768px){
  section.rvpw-recently-view .kv-rv-arrow{ display:none !important; }
  section.rvpw-recently-view .kv-rv-slider{ padding:0 !important; }
  section.rvpw-recently-view .kv-rv-track-wrap>ul.products{ gap:6px !important; }
  section.rvpw-recently-view .kv-rv-track-wrap>ul.products>li.product{ flex:0 0 160px !important; max-width:160px !important; }
  section.rvpw-recently-view .loop-entry .entry-content-wrap{ padding-top:0 !important; padding-bottom:0 !important; }
  
  /* Allow native scroll on mobile if we have duplicates or static mode */
  section.rvpw-recently-view.kv-static-mode ul.products { 
      justify-content: flex-start; overflow-x: auto; padding-bottom: 10px !important;
  }
  /* Clear button tweak for mobile */
  section.rvpw-recently-view .kv-rv-clear{ margin: 6px auto 0; font-size:11px; }
  section.rvpw-recently-view .kv-rv-header{ flex-direction:column; align-items:flex-start; gap:5px; }
}

@media (min-width:981px){
  section.rvpw-recently-view .kv-rv-dots{
    display:none;
  }
}

.single-product .kb-row-layout-wrap > .kt-row-column-wrap{ padding-top:0 !important; }
