/**
 * RannaBati homepage product cards.
 * Scoped to the shortcode output so Elementor and other homepage sections
 * remain untouched.
 */

.rb-home-products-loop {
  --rbs-green-950:#07340e;
  --rbs-green-900:#0a4b1a;
  --rbs-green-800:#12602b;
  --rbs-green-100:#edf7ef;
  --rbs-orange-strong:#ff7a00;
  --rbs-gold:#f4a000;
  --rbs-line:#eadfd1;
  --rbs-radius:14px;
  --rbs-cols-desktop:3;
  --rbs-cols-tablet:2;
  --rbs-cols-mobile:2;
  --rbs-image-ratio:1 / 1;
  width:100%;
  min-width:0;
  color:#251a12;
  font-family:Poppins,"Hind Siliguri",Inter,system-ui,-apple-system,"Segoe UI",sans-serif;
}

.rb-home-products-loop,
.rb-home-products-loop *,
.rb-home-products-loop *::before,
.rb-home-products-loop *::after { box-sizing:border-box; }

.rb-home-products-loop ul.products {
  display:grid!important;
  grid-template-columns:repeat(var(--rbs-cols-desktop),minmax(0,1fr))!important;
  gap:16px!important;
  width:100%!important;
  margin:0!important;
  padding:0!important;
  clear:both!important;
  list-style:none!important;
}

.rb-home-products-loop ul.products::before,
.rb-home-products-loop ul.products::after { display:none!important; }

.rb-home-products-loop ul.products li.product {
  position:relative!important;
  display:flex!important;
  flex-direction:column!important;
  float:none!important;
  width:auto!important;
  min-width:0!important;
  margin:0!important;
  overflow:hidden!important;
  border:1px solid var(--rbs-line)!important;
  border-radius:var(--rbs-radius)!important;
  background:#fff!important;
  box-shadow:0 7px 20px rgba(36,25,15,.065)!important;
  transition:transform .17s ease,box-shadow .17s ease,border-color .17s ease!important;
}

.rb-home-products-loop ul.products li.product:hover {
  border-color:rgba(18,96,43,.24)!important;
  box-shadow:0 13px 30px rgba(36,25,15,.11)!important;
  transform:translateY(-3px);
}

.rb-home-products-loop ul.products li.product > a.woocommerce-LoopProduct-link {
  display:flex!important;
  flex:1 1 auto!important;
  flex-direction:column!important;
  min-width:0!important;
  color:inherit!important;
  text-decoration:none!important;
}

.rb-home-products-loop ul.products li.product a img {
  display:block!important;
  width:100%!important;
  height:auto!important;
  aspect-ratio:var(--rbs-image-ratio)!important;
  margin:0!important;
  object-fit:cover!important;
  object-position:center!important;
  background:#f7efe4!important;
  transition:transform .28s ease!important;
}

.rb-home-products-loop ul.products li.product:hover a img { transform:scale(1.018); }

.rb-home-products-loop ul.products li.product .onsale,
.rb-home-products-loop .rb-stock-badge {
  position:absolute!important;
  z-index:3!important;
  top:9px!important;
  min-width:48px!important;
  min-height:28px!important;
  margin:0!important;
  border:0!important;
  border-radius:8px!important;
  padding:6px 9px!important;
  color:#fff!important;
  font-size:11px!important;
  font-weight:850!important;
  line-height:16px!important;
  box-shadow:0 6px 15px rgba(255,122,0,.22)!important;
}

.rb-home-products-loop ul.products li.product .onsale {
  right:auto!important;
  left:9px!important;
  background:linear-gradient(135deg,var(--rbs-orange-strong),var(--rbs-gold))!important;
}

.rb-home-products-loop .rb-stock-badge {
  right:9px!important;
  background:#8f1d1d!important;
}

.rb-home-products-loop .rb-product-card__content {
  display:flex!important;
  flex:1 1 auto!important;
  flex-direction:column!important;
  min-width:0!important;
  padding:12px 12px 10px!important;
}

.rb-home-products-loop ul.products li.product .woocommerce-loop-product__title {
  display:-webkit-box!important;
  min-height:2.65em!important;
  margin:0!important;
  overflow:hidden!important;
  padding:0!important;
  color:var(--rbs-green-950)!important;
  font-family:"Hind Siliguri",Poppins,sans-serif!important;
  font-size:17px!important;
  font-weight:800!important;
  line-height:1.32!important;
  letter-spacing:0!important;
  overflow-wrap:anywhere!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:2!important;
}

.rb-home-products-loop .rb-product-card__category {
  display:block!important;
  margin-top:4px!important;
  overflow:hidden!important;
  color:#8c7f72!important;
  font-size:10px!important;
  font-weight:600!important;
  line-height:1.35!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}

.rb-home-products-loop ul.products li.product .star-rating {
  width:5.4em!important;
  margin:6px 0 0!important;
  color:var(--rbs-gold)!important;
  font-size:9px!important;
}

.rb-home-products-loop .rb-product-card__excerpt { display:none!important; }

.rb-home-products-loop .rb-product-card__serving {
  display:flex!important;
  align-items:center!important;
  gap:6px!important;
  min-height:30px!important;
  margin:7px 0 9px!important;
  padding:6px 9px!important;
  border:1px solid #d9e7d6!important;
  border-radius:9px!important;
  background:#f8fbf7!important;
  color:#5d6d60!important;
  font-size:11px!important;
  line-height:1.35!important;
}

.rb-home-products-loop .rb-product-card__serving span {
  display:grid!important;
  place-items:center!important;
  flex:0 0 17px!important;
  width:17px!important;
  height:17px!important;
  border-radius:50%!important;
  background:var(--rbs-green-800)!important;
  color:#fff!important;
  font-size:8px!important;
  box-shadow:none!important;
}

.rb-home-products-loop .rb-product-card__serving b {
  color:#536657!important;
  font-weight:700!important;
}

.rb-home-products-loop .rb-product-card__serving strong {
  margin-left:auto!important;
  color:var(--rbs-green-900)!important;
  font-size:11.5px!important;
  font-weight:800!important;
}

.rb-home-products-loop ul.products li.product .price {
  display:flex!important;
  flex-wrap:wrap!important;
  align-items:baseline!important;
  gap:3px 6px!important;
  margin:auto 0 0!important;
  padding:8px 0 0!important;
  color:var(--rbs-green-900)!important;
  font-size:18px!important;
  font-weight:900!important;
  line-height:1.3!important;
}

.rb-home-products-loop ul.products li.product .price del {
  color:#7d776f!important;
  font-size:.78em!important;
  font-weight:500!important;
  opacity:1!important;
}

.rb-home-products-loop ul.products li.product .price ins {
  color:var(--rbs-green-900)!important;
  font-weight:900!important;
  text-decoration:none!important;
}

.rb-home-products-loop ul.products li.product .button,
.rb-home-products-loop ul.products li.product .added_to_cart {
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:calc(100% - 24px)!important;
  min-height:42px!important;
  margin:0 12px 12px!important;
  border:1px solid var(--rbs-green-800)!important;
  border-radius:9px!important;
  padding:8px 10px!important;
  color:#fff!important;
  background:linear-gradient(135deg,#176b31,var(--rbs-green-950))!important;
  font-size:12px!important;
  font-weight:800!important;
  line-height:1.3!important;
  text-align:center!important;
  text-decoration:none!important;
  white-space:normal!important;
  box-shadow:none!important;
  transition:transform .15s ease,background .15s ease,opacity .15s ease!important;
}

.rb-home-products-loop ul.products li.product .button:hover,
.rb-home-products-loop ul.products li.product .button:focus-visible {
  color:#fff!important;
  background:linear-gradient(135deg,var(--rbs-green-800),#052b0c)!important;
  transform:translateY(-1px);
}

.rb-home-products-loop ul.products li.product .button.loading,
.rb-home-products-loop ul.products li.product .button.rb-is-adding {
  padding-right:10px!important;
  opacity:.78!important;
  pointer-events:none!important;
}

.rb-home-products-loop ul.products li.product .button.rb-is-added {
  border-color:#178b3a!important;
  background:#178b3a!important;
}

.rb-home-products-loop ul.products li.product .added_to_cart {
  min-height:34px!important;
  margin-top:-5px!important;
  border-color:rgba(18,96,43,.18)!important;
  color:var(--rbs-green-900)!important;
  background:var(--rbs-green-100)!important;
  font-size:11px!important;
}

.rb-home-products-loop :focus-visible {
  outline:3px solid rgba(255,138,53,.45)!important;
  outline-offset:2px!important;
}

.rb-home-products-empty {
  margin:0;
  padding:14px 16px;
  border:1px solid #eadfd1;
  border-radius:10px;
  background:#fffaf3;
  color:#654f3c;
  font-size:13px;
  line-height:1.6;
}

@media (max-width:980px) {
  .rb-home-products-loop ul.products {
    grid-template-columns:repeat(var(--rbs-cols-tablet),minmax(0,1fr))!important;
    gap:13px!important;
  }
}

@media (max-width:680px) {
  .rb-home-products-loop ul.products {
    grid-template-columns:repeat(var(--rbs-cols-mobile),minmax(0,1fr))!important;
    gap:9px!important;
  }

  .rb-home-products-loop ul.products li.product:hover { transform:none; }

  .rb-home-products-loop .rb-product-card__content { padding:8px 8px 7px!important; }

  .rb-home-products-loop ul.products li.product .woocommerce-loop-product__title {
    min-height:2.62em!important;
    font-size:14px!important;
    line-height:1.31!important;
  }

  .rb-home-products-loop .rb-product-card__category {
    margin-top:3px!important;
    font-size:8.5px!important;
  }

  .rb-home-products-loop .rb-product-card__serving {
    min-height:27px!important;
    margin:6px 0 7px!important;
    padding:5px 7px!important;
    font-size:9.8px!important;
  }

  .rb-home-products-loop .rb-product-card__serving span {
    flex-basis:15px!important;
    width:15px!important;
    height:15px!important;
    font-size:7px!important;
  }

  .rb-home-products-loop .rb-product-card__serving strong { font-size:10px!important; }

  .rb-home-products-loop ul.products li.product .price {
    gap:3px 4px!important;
    padding-top:5px!important;
    font-size:15px!important;
  }

  .rb-home-products-loop ul.products li.product .button,
  .rb-home-products-loop ul.products li.product .added_to_cart {
    width:calc(100% - 16px)!important;
    min-height:38px!important;
    margin:0 8px 8px!important;
    padding:7px 5px!important;
    font-size:10.5px!important;
  }

  .rb-home-products-loop ul.products li.product .onsale,
  .rb-home-products-loop .rb-stock-badge {
    top:6px!important;
    min-width:42px!important;
    min-height:24px!important;
    padding:4px 6px!important;
    font-size:9.5px!important;
  }

  .rb-home-products-loop ul.products li.product .onsale { left:6px!important; }
  .rb-home-products-loop .rb-stock-badge { right:6px!important; }
}

@media (hover:none) {
  .rb-home-products-loop ul.products li.product:hover,
  .rb-home-products-loop ul.products li.product:hover a img { transform:none!important; }
}

@media (prefers-reduced-motion:reduce) {
  .rb-home-products-loop ul.products li.product,
  .rb-home-products-loop ul.products li.product a img,
  .rb-home-products-loop ul.products li.product .button { transition:none!important; }
}
