/* =========================================
   Product Loop Card (SuntechMall-VPro) — FINAL (clean + stable)
   Location: /assets/css/product-loop.css
   Purpose:
   - Shop + home loop card UI (shadow, spacing, actions, quick view overlay)
   - ✅ Removes duplicate/conflicting hover rules
   - ✅ Fixes wishlist icon path (uses /assets/icons/ not /assets/css/icons/)
   - ✅ Makes hover shadow reliable without breaking layout
   - ✅ Keeps your current look (same sizes/colors), but cleaner + safer
========================================= */

/* Keep Woo list clean */
.woocommerce ul.products,
.woocommerce ul.products li.product{
  overflow: visible !important; /* allow shadow */
}

.woocommerce ul.products{
  gap: 2px !important; /* your requirement */
}

/* Ensure hover can come above neighbors */
.woocommerce ul.products li.product{
  position: relative;
  z-index: 1;
}
.woocommerce ul.products li.product:hover{
  z-index: 20;
}

/* If your theme uses .stm-product-card wrapper, keep it harmless */
.stm-product-card{
  list-style: none;
  border: none !important;
  border-radius: 0 !important;
}

/* Card shell */
.stm-pl{
  padding: 6px 15px 0;
  background: #fff;
  border: none !important;
  border-radius: 0 !important;

  /* Hover shadow anchor */
  transition: box-shadow .18s ease, transform .18s ease;
}

/* Hover shadow (single source of truth) */
.woocommerce ul.products li.product:hover .stm-pl{
  box-shadow: 0 0px 8px rgba(0,0,0,.3);
}

/* Category */
.stm-pl__cat{
  font-size: 14px;
  text-transform: uppercase;
  color: rgba(0,0,0,.65);
  text-decoration: none;
}
.stm-pl__cat:hover{
  color: rgba(0,0,0,.92);
  text-decoration: underline;
}

/* Feature image */
.stm-pl__media{
  position: relative; /* for Quick View overlay */
  padding: 0;
  border-radius: 10px;
  background: #fff;
  border: none !important;
  overflow: hidden;
}
.stm-pl__media img{
  width: 100%;
  height: auto;
  display: block;
}

/* Title + spacing */
.stm-pl__row--meta{ margin-top: 10px !important; }

.stm-pl__title{
  margin-top: 0 !important;
  margin-bottom: 6px;
  transform: translateY(-20px);

  font-size: 16px;
  line-height: 1.35;
  color: #0e5aa7;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;

  max-height: calc(1.35em * 2 + 6px);
  overflow: hidden;
}

.stm-pl__link{
  text-decoration: none;
  color: inherit;
  display: block;
}
.stm-pl__link:hover .stm-pl__title{
  color: #0b3a6f;
  text-decoration: underline;
}

/* Rows */
.stm-pl__row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}

/* Price */
.stm-pl__price,
.stm-pl__price .amount{
  font-size: 16px !important;
  font-weight: 400 !important;
  color: #000 !important;
}
.stm-pl__price del{ opacity:.55; }
.stm-pl__price ins{ text-decoration:none; }

/* Stars */
.stm-stars{
  position: relative;
  display: inline-block;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 1px;
}
.stm-stars__base{ color: rgba(0,0,0,.22); }
.stm-stars__fill{
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  white-space: nowrap;
  color: #f5a623;
}

/* Actions */
.stm-pl__row--actions{
  margin-top: 0 !important;
}

/* Your upward pull (kept) */
.stm-pl__row--meta,
.stm-pl__row--actions{
  transform: translateY(-15px);
}

/* =========================
   Wishlist fallback link (only if hook outputs nothing)
   FIX: correct icon path => ../icons/ (NOT ../css/icons/)
========================= */
.stm-pl__wish{
  width: 38px;
  height: 38px;
  border: none !important;
  background: transparent !important;
  border-radius: 50%;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  padding: 0;
}
.stm-pl__icon--wish{
  width: 28px;
  height: 28px;
  display:block;
  background: url("../icons/wishlist.svg") center/28px 28px no-repeat;
}

/* =========================
   Add to cart (icon button)
========================= */
.stm-pl__atc{
  width: 36px;
  height: 36px;
  border-radius: 999px !important;
  background: #ff7a00 !important;

  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  text-decoration: none !important;
  border: none !important;
  padding: 0 !important;

  line-height: 0 !important;
  font-size: 0 !important;
  vertical-align: middle;
}

.stm-pl__icon--atc{
  width: 18px;
  height: 18px;
  display: block;

  background: url("../icons/add-to-cart.svg") center center / 18px 18px no-repeat;

  filter: brightness(0) invert(1);
  margin: 0 !important;
  padding: 0 !important;
}

.stm-pl__atc.is-added .stm-pl__icon--atc{
  background-image: url("../icons/tick.svg");
}

/* ======================================================
   WISHLIST ICON — SINGLE SVG + CSS MASK (PREMIUM)
   Uses: assets/icons/wishlist.svg
====================================================== */
.stm-pl-action--wishlist{
  position: relative;
  width: 38px;
  height: 38px;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0;
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  -webkit-tap-highlight-color: transparent;
}

.stm-pl-action--wishlist::before{
  content: "" !important;
  width: 20px;
  height: 20px;
  display: block;

  background-image: var(--stm-wish-ico) !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: contain !important;

  -webkit-mask: none !important;
  mask: none !important;
  background-color: transparent !important;
}

.stm-pl-action--wishlist.is-added::before{
  background-image: none !important;
  background-color: #000 !important;

  -webkit-mask-image: var(--stm-wish-ico) !important;
  mask-image: var(--stm-wish-ico) !important;

  -webkit-mask-repeat: no-repeat !important;
  mask-repeat: no-repeat !important;

  -webkit-mask-position: center !important;
  mask-position: center !important;

  -webkit-mask-size: contain !important;
  mask-size: contain !important;
}

.stm-pl-action--wishlist:hover{ opacity: 0.9; }

.stm-pl-action--wishlist.is-loading{
  pointer-events: none;
  opacity: 0.6;
}

.stm-pl-action--wishlist:focus-visible{
  outline: 2px solid rgba(0,0,0,.25);
  outline-offset: 2px;
}

/* =========================================
   Wishlist Page — Force 6 columns
========================================= */
.stm-wishlist-page ul.products{
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 1200px){
  .stm-wishlist-page ul.products{ grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px){
  .stm-wishlist-page ul.products{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px){
  .stm-wishlist-page ul.products{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* =========================================
   QUICK VIEW — overlay button in media center (desktop hover only)
========================================= */
.stm-qv-btn{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%) scale(.98);
  z-index:6;

  display:inline-flex;
  align-items:center;
  justify-content:center;

  min-width:92px;
  height:36px;
  padding:0 14px;

  font-weight:800;
  font-size:12px;
  border-radius:10px;

  border:1px solid rgba(0,0,0,.55);
  background:#111;
  color:#fff;

  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease, transform .18s ease, background .18s ease, border-color .18s ease;
}

@media (hover:hover) and (pointer:fine){
  .stm-qv-btn:hover{
    background:#000;
    border-color:#000;
  }
  .stm-qv-btn:active{
    transform:translate(-50%,-50%) scale(.98);
  }

  .stm-pl__media:hover .stm-qv-btn{
    opacity:1;
    pointer-events:auto;
    transform:translate(-50%,-50%) scale(1);
  }
}

/* touch devices => hide */
@media (hover:none){
  .stm-qv-btn{ display:none !important; }
}
