/* Aloonak archive card base */
body.alc-archive .woocommerce ul.products,
body.alc-archive ul.products{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:16px!important;
  align-items:stretch;
  margin:0 0 24px!important;
  padding:0!important;
  list-style:none!important;
}
body.alc-archive .woocommerce ul.products::before,
body.alc-archive .woocommerce ul.products::after{display:none!important;}
body.alc-archive ul.products > li.alc-item,
body.alc-archive .woocommerce ul.products > li.alc-item{
  width:auto!important; max-width:none!important; min-width:0!important;
  margin:0!important; padding:0!important; float:none!important;
  clear:none!important; list-style:none!important; background:transparent!important;
}
body.alc-archive .alc-item *{box-sizing:border-box;}

body.alc-archive .alc-card{
  position:relative;
  display:flex;
  flex-direction:column;
  height:100%;
  padding:12px;
  border:1px solid #e7ecec;
  border-radius:16px;
  background:#fff;
  text-align:right;
  direction:rtl;
  box-shadow:0 2px 10px rgba(17,24,39,.03);
  transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  cursor:pointer;
}
body.alc-archive .alc-card:hover{
  border-color:#d8e4e3;
  box-shadow:0 12px 28px rgba(17,24,39,.06);
  transform:translateY(-1px);
}

body.alc-archive .alc-picture{
  display:flex;
  align-items:center;
  justify-content:center;
  aspect-ratio:1/1;
  overflow:hidden;
  text-decoration:none!important;
  position:relative;
  border-radius:12px;
}
body.alc-archive .alc-picture img{
  display:block!important;
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  object-fit:contain!important;
  margin:0!important;
}
body.alc-archive .alc-picture .fe-thumb-wrap{display:block;position:relative;width:100%;height:100%;}
body.alc-archive .alc-discount{
  position:absolute;
  top:6px;
  left:6px;
  background:#FF6B6B;
  color:#fff;
  border-radius:999px;
  padding:3px 8px;
  font-size:10px;
  font-weight:800;
  line-height:1.45;
  z-index:2;
  box-shadow:0 6px 12px rgba(255,107,107,.18);
}

/* smaller bestseller badge from existing snippet */
body.alc-archive .fe-badge--bestseller{
  top:8px!important;
  right:8px!important;
  left:auto!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:4px!important;
  padding:3px 8px!important;
  min-height:20px!important;
  border-radius:999px!important;
  font-size:9px!important;
  line-height:1.2!important;
  font-weight:800!important;
  color:#345B63!important;
  background:linear-gradient(180deg,#eef8f1 0%,#dcefe3 100%)!important;
  border:1px solid #c5e2cf!important;
  box-shadow:0 6px 14px rgba(52,91,99,.08)!important;
  letter-spacing:0!important;
}
body.alc-archive .fe-badge--bestseller::before{
  content:'';
  width:6px;
  height:6px;
  border-radius:50%;
  background:#78bf8c;
  box-shadow:0 0 0 2px rgba(120,191,140,.18);
  flex:0 0 6px;
}

body.alc-archive .alc-body{
  display:flex;
  flex-direction:column;
  gap:6px;
  min-width:0;
  flex:1;
  padding-top:10px;
}
body.alc-archive .alc-meta-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  min-height:20px;
}
body.alc-archive .alc-brand{
  font-size:10.5px;
  line-height:1.4;
  color:#7f9094;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
body.alc-archive .alc-rating{
  display:inline-flex;
  align-items:center;
  gap:4px;
  color:#345B63;
  font-size:11px;
  font-weight:700;
  flex:0 0 auto;
}
body.alc-archive .alc-rating-badge{
  width:16px;
  height:16px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  background:#FFC857;
  box-shadow:inset 0 0 0 1px rgba(140,104,10,.12);
  color:#fff;
  font-size:9px;
  line-height:1;
}
body.alc-archive .alc-rating-num{line-height:1;color:#345B63;}
body.alc-archive .alc-title-link{color:#20393f!important;text-decoration:none!important;}
body.alc-archive .alc-title-link::after{content:"";position:absolute;inset:0;z-index:1;}
body.alc-archive .alc-title-link:focus-visible{outline:2px solid #345b63;outline-offset:3px;}
body.alc-archive .alc-title{
  font-size:14.5px!important;
  font-weight:700!important;
  line-height:1.78!important;
  color:inherit!important;
  margin:0!important;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;
  min-height:0;
}
body.alc-archive .alc-colors{
  display:flex;
  gap:5px;
  align-items:center;
  min-height:12px;
}
body.alc-archive .alc-swatch{
  width:10px;
  height:10px;
  border-radius:50%;
  border:1px solid rgba(0,0,0,.12);
  flex:0 0 10px;
}
body.alc-archive .alc-specs{
  display:flex;
  flex-wrap:wrap;
  gap:4px 8px;
  color:#839092;
  font-size:10px;
  line-height:1.5;
}
body.alc-archive .alc-spec{white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis;}
body.alc-archive .alc-spec + .alc-spec::before{content:'·';margin-left:6px;color:#c7d1d0;}
body.alc-archive .alc-lowstock{
  font-size:10px;
  color:#a5722d;
  font-weight:600;
  line-height:1.4;
  opacity:.82;
}
body.alc-archive .alc-bottom{
  margin-top:auto;
  padding-top:4px;
  display:flex;
  flex-direction:column;
  gap:0;
}
body.alc-archive .alc-price-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
body.alc-archive .alc-price{
  font-weight:800;
  font-size:17px;
  line-height:1.7;
  color:#18393f;
  min-width:0;
}
body.alc-archive .alc-price .amount{font-weight:800;}
body.alc-archive .alc-price del{
  font-weight:400;
  color:#9ca8ac;
  font-size:11px;
  margin-left:4px;
}
body.alc-archive .alc-price ins{text-decoration:none;background:transparent;}
body.alc-archive .alc-soldout{color:#859296;font-size:13px;}
body.alc-archive .alc-points{
  position:relative;
  z-index:3;
  display:inline-flex;
  align-items:center;
  gap:4px;
  text-decoration:none!important;
  color:#8f7d44!important;
  font-size:9px;
  font-weight:700;
  opacity:.68;
  white-space:nowrap;
  flex:0 0 auto;
}
body.alc-archive .alc-points-icon{
  width:13px;
  height:13px;
  display:inline-block;
  background-repeat:no-repeat;
  background-size:contain;
  background-position:center;
  filter:saturate(.92);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 36'%3E%3Ccircle cx='18' cy='18' r='18' fill='%23f4c84d'/%3E%3Ccircle cx='18' cy='18' r='13.3' fill='%23f8a92d'/%3E%3Cpath fill='%23f5deac' d='M11.2 14.6 18 11l6.8 3.6a1.5 1.5 0 0 1 .8 1.3v8.7a1.5 1.5 0 0 1-1.5 1.5h-12a1.5 1.5 0 0 1-1.5-1.5V16a1.5 1.5 0 0 1 .6-1.4Zm6.8-1.5-4.2 2.2H22.2L18 13.1Zm-5.1 4v7.3h2.5V17h-2.5Zm3.8 0v7.3h2.5V17h-2.5Zm3.8 0v7.3H23V17h-2.5Z'/%3E%3C/svg%3E");
}

/* Remove any residual action area/buttons from older versions */
body.alc-archive .alc-actions{display:none!important;}

/* Category pages: mobile = single-column compact list */
@media(max-width:767px){
  body.alc-archive.tax-product_cat .woocommerce ul.products,
  body.alc-archive.tax-product_cat ul.products{
    grid-template-columns:minmax(0,1fr)!important;
    gap:10px!important;
  }
  body.alc-archive.tax-product_cat .alc-card{
    display:grid;
    grid-template-columns:94px minmax(0,1fr);
    gap:10px;
    padding:10px;
    border-radius:14px;
    min-height:116px;
  }
  body.alc-archive.tax-product_cat .alc-picture{
    aspect-ratio:1/1;
    align-self:start;
  }
  body.alc-archive.tax-product_cat .alc-body{
    padding-top:0;
    gap:4px;
  }
  body.alc-archive.tax-product_cat .alc-meta-top{min-height:18px;}
  body.alc-archive.tax-product_cat .alc-title{
    font-size:12.8px!important;
    line-height:1.68!important;
  }
  body.alc-archive.tax-product_cat .alc-specs{font-size:9px;line-height:1.4;}
  body.alc-archive.tax-product_cat .alc-price{font-size:14px;}
  body.alc-archive.tax-product_cat .alc-rating{font-size:10px;gap:3px;}
  body.alc-archive.tax-product_cat .alc-rating-badge{width:14px;height:14px;font-size:8px;}
  body.alc-archive.tax-product_cat .alc-points{font-size:8.5px;gap:3px;}
  body.alc-archive.tax-product_cat .alc-points-icon{width:12px;height:12px;}
  body.alc-archive.tax-product_cat .alc-discount{top:5px;left:5px;padding:2px 7px;font-size:9.5px;}
  body.alc-archive.tax-product_cat .fe-badge--bestseller{top:6px!important;right:6px!important;padding:2px 7px!important;font-size:8.5px!important;min-height:18px!important;}

  /* Shop page: mobile = compact 2-col grid */
  body.alc-archive.post-type-archive-product:not(.tax-product_cat) .woocommerce ul.products,
  body.alc-archive.post-type-archive-product:not(.tax-product_cat) ul.products{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:10px!important;
  }
  body.alc-archive.post-type-archive-product:not(.tax-product_cat) .alc-card{
    padding:10px;
    border-radius:14px;
  }
  body.alc-archive.post-type-archive-product:not(.tax-product_cat) .alc-title{
    font-size:12.3px!important;
    line-height:1.65!important;
  }
  body.alc-archive.post-type-archive-product:not(.tax-product_cat) .alc-price{font-size:13.5px;}
  body.alc-archive.post-type-archive-product:not(.tax-product_cat) .alc-rating{font-size:10px;}
  body.alc-archive.post-type-archive-product:not(.tax-product_cat) .alc-points{font-size:8px;}
}

@media(max-width:370px){
  body.alc-archive.tax-product_cat .alc-card{grid-template-columns:88px minmax(0,1fr);gap:9px;padding:9px;}
}

/* V5: branding is selective; muted text and low-stock styles retain V4 colors. */
body.alc-archive .alc-picture .fe-thumb-wrap .fe-badge--bestseller,
body.alc-archive .alc-picture .fe-badge--bestseller{
  background:#9DCDAF!important;
  color:#345B63!important;
  border:1px solid rgba(52,91,99,.13)!important;
  font-size:9px!important;
  font-weight:700!important;
  line-height:1.25!important;
  padding:3px 6px!important;
  min-height:0!important;
  width:auto!important;
  max-width:calc(100% - 10px)!important;
  border-radius:7px!important;
}
/* WooCommerce and theme can assign grid positions to first/last items. */
@media (min-width:1024px){
  body.alc-archive :is(.woocommerce ul.products,ul.products):has(> li.alc-item){
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-auto-flow:row dense!important;
  }
  body.alc-archive :is(.woocommerce ul.products,ul.products) > li.alc-item{
    grid-column:auto / span 1!important;
    grid-row:auto!important;
    order:0!important;
    clear:none!important;
  }
}
@media (min-width:768px) and (max-width:1023px){
  body.alc-archive :is(.woocommerce ul.products,ul.products):has(> li.alc-item){
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-auto-flow:row dense!important;
  }
  body.alc-archive :is(.woocommerce ul.products,ul.products) > li.alc-item{
    grid-column:auto / span 1!important;
    grid-row:auto!important;
    clear:none!important;
  }
}
/* Keep original neutral hierarchy: brand, unavailable, and low stock. */
body.alc-archive .alc-brand{color:#7f9094!important;}
body.alc-archive .alc-soldout{color:#859296!important;}
body.alc-archive .alc-lowstock{color:#a5722d!important;}

/* V6: WooCommerce's legacy clearfix pseudo-elements were occupying grid cells.
 * This applies only to the active archive product loop, not the Shop landing sections. */
body.alc-archive ul.products:has(> li.alc-item)::before,
body.alc-archive ul.products:has(> li.alc-item)::after,
body.alc-archive .woocommerce ul.products:has(> li.alc-item)::before,
body.alc-archive .woocommerce ul.products:has(> li.alc-item)::after{
  content:none!important;
  display:none!important;
  visibility:hidden!important;
}

/* V8: final restrained bestseller label; override both theme and earlier badge styles. */
body.alc-archive .alc-picture .fe-badge--bestseller,
body.alc-archive .alc-picture .fe-thumb-wrap .fe-badge--bestseller {
  position:absolute!important;
  top:8px!important;
  right:8px!important;
  left:auto!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:auto!important;
  max-width:calc(100% - 16px)!important;
  min-height:0!important;
  padding:3px 7px!important;
  font-size:9px!important;
  font-weight:700!important;
  line-height:1.5!important;
  letter-spacing:0!important;
  border-radius:6px!important;
  background:#EFF8F2!important;
  color:#345B63!important;
  border:1px solid #C5E2CF!important;
  box-shadow:none!important;
  gap:0!important;
  white-space:nowrap!important;
  z-index:3!important;
}
body.alc-archive .alc-picture .fe-badge--bestseller::before,
body.alc-archive .alc-picture .fe-badge--bestseller::after,
body.alc-archive .alc-picture .fe-thumb-wrap .fe-badge--bestseller::before,
body.alc-archive .alc-picture .fe-thumb-wrap .fe-badge--bestseller::after {
  content:none!important;
  display:none!important;
}
@media (max-width:767px) {
  body.alc-archive .alc-picture .fe-badge--bestseller,
  body.alc-archive .alc-picture .fe-thumb-wrap .fe-badge--bestseller {
    top:6px!important;
    right:6px!important;
    padding:2px 6px!important;
    font-size:8.5px!important;
  }
}
