/* ==========================================================================
   HerbaShape.ch — shop & homepage visual tweaks
   Scoped CSS overrides only. No Elementor/PHP/plugin edits.
   Accent: Herbalife green. Goal: clean, airy, premium wellness.
   ========================================================================== */

:root {
  --hs-green: #4A9D3F;
  --hs-green-deep: #2E6B27;
  --hs-green-soft: rgba(74, 157, 63, .10);
  --hs-ink: #20302A;
  --hs-muted: #7C8A83;
  --hs-line: #E9EDE9;
  --hs-panel: #F3F7F3;
  --hs-radius: 16px;
  --hs-radius-lg: 18px;
  --hs-shadow: 0 1px 3px rgba(20, 45, 28, .06), 0 8px 24px rgba(20, 45, 28, .05);
  --hs-shadow-hover: 0 6px 16px rgba(20, 45, 28, .10), 0 18px 40px rgba(20, 45, 28, .14);
  --hs-ease: cubic-bezier(.4, 0, .2, 1);
}

/* ==========================================================================
   1. TOP SELLING — rebalance the "featured + list" masonry into a clean grid
   The theme makes the first card span 2 rows, leaving a lone orphan card.
   Convert to a uniform grid of equal vertical cards (3 -> 2 -> 1 columns).
   Scoped to the .woocommerce-product-list widget only.
   ========================================================================== */

.woocommerce-product-list ul.products {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important; /* mobile default */
  gap: 16px !important;
  margin: 0 !important;
}

.woocommerce-product-list ul.products .product-item {
  grid-row: auto !important;
  grid-column: auto !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none;
  float: none !important;
}

.woocommerce-product-list .product-list-inner {
  display: flex !important;
  flex-direction: column !important;
  height: 100%;
  background: #fff;
  border: 1px solid var(--hs-line);
  border-radius: var(--hs-radius);
  overflow: hidden;
  box-shadow: var(--hs-shadow);
  transition: transform .25s var(--hs-ease), box-shadow .25s var(--hs-ease), border-color .25s var(--hs-ease);
}

.woocommerce-product-list .product-item .product-list-inner,
.woocommerce-product-list .product-item:hover .product-list-inner {
  background: #fff !important;
}

.woocommerce-product-list .product-item:hover .product-list-inner {
  transform: translateY(-4px);
  box-shadow: var(--hs-shadow-hover);
  border-color: rgba(74, 157, 63, .35);
}

/* image sits on a soft panel, product-shot framing */
.woocommerce-product-list .product-list-inner > a:first-of-type {
  display: block;
  padding: 14px;
  background: linear-gradient(180deg, #FBFDFB, var(--hs-panel)) !important;
  line-height: 0;
}

.woocommerce-product-list .product-item img {
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  aspect-ratio: 1 / 1;
  object-fit: contain !important;
  mix-blend-mode: multiply;
  transition: transform .4s var(--hs-ease);
}

.woocommerce-product-list .product-item:hover img {
  transform: scale(1.04);
}

.woocommerce-product-list .product-content {
  display: flex !important;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  padding: 12px 14px 14px !important;
  text-align: left;
}

.woocommerce-product-list .product-content .product-title {
  color: var(--hs-ink) !important;
  font-weight: 600 !important;
  font-size: 15px;
  line-height: 1.35;
}

.woocommerce-product-list .product-content .product-title:hover { color: var(--hs-green) !important; }

/* compact responsive grid: 2 (mobile) -> 3 (>=768) -> 4 (>=1200) */
@media (min-width: 768px) {
  .woocommerce-product-list ul.products { grid-template-columns: repeat(3, 1fr) !important; gap: 18px !important; }
}
@media (min-width: 1200px) {
  .woocommerce-product-list ul.products { grid-template-columns: repeat(4, 1fr) !important; gap: 20px !important; }
}

/* ==========================================================================
   2. SHOP BY CATEGORY — cohesive image cards + elegant empty state
   Cards with no image collapsed to a thin strip; unify every card into a
   fixed-ratio tile with a herbal-green gradient fallback + scrim + title.
   ========================================================================== */

.product-cat .product-cart-single {
  position: relative !important;
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: var(--hs-radius-lg);
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .30);
}

/* gradient fallback (shows through when a category has no image) */
.product-cat .product-cart-single::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 90% at 80% -10%, rgba(255, 255, 255, .20), transparent 55%),
    linear-gradient(150deg, #57AD4B 0%, var(--hs-green-deep) 92%);
}

.product-cat .link_category_product {
  position: absolute !important;
  inset: 0;
  z-index: 2;
  display: block;
}

.product-cat .link_category_product img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover !important;
  z-index: 1;
  transition: transform .6s var(--hs-ease);
}

.product-cat .product-cart-single:hover .link_category_product img { transform: scale(1.07); }

/* legibility scrim */
.product-cat .product-cart-single::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(to top, rgba(10, 22, 13, .80) 0%, rgba(10, 22, 13, .18) 45%, transparent 68%);
}

.product-cat .product-cart-caption {
  position: absolute !important;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  padding: 18px 20px !important;
  margin: 0 !important;
  background: transparent !important;
  text-align: left !important;
}

.product-cat .cart-title,
.product-cat .cart-title a {
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.product-cat .cart-title-text {
  color: #fff !important;
  font-weight: 700 !important;
  font-size: 17px !important;
  letter-spacing: .2px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .40);
}

.product-cat .cart-title a::after {
  content: "\2192";
  color: #BFF0B3;
  font-weight: 600;
  transition: transform .25s var(--hs-ease);
}

.product-cat .product-cart-single:hover .cart-title a::after { transform: translateX(5px); }

/* ==========================================================================
   3 & 4. PRODUCT CARDS (New Arrivals carousel + Shop archive)
   Modernize framing/typography, sleek add-to-cart, refined sale badge.
   ========================================================================== */

.woocommerce ul.products li.product .product-block {
  background: #fff;
  border: 1px solid var(--hs-line);
  border-radius: var(--hs-radius);
  overflow: hidden;
  box-shadow: var(--hs-shadow);
  transition: transform .25s var(--hs-ease), box-shadow .25s var(--hs-ease), border-color .25s var(--hs-ease);
}

.woocommerce ul.products li.product:hover .product-block {
  transform: translateY(-4px);
  box-shadow: var(--hs-shadow-hover);
  border-color: rgba(74, 157, 63, .35);
}

.woocommerce ul.products li.product .product-image {
  padding: 16px;
  background: linear-gradient(180deg, #FBFDFB, var(--hs-panel));
}

.woocommerce ul.products li.product .product-image img {
  aspect-ratio: 1 / 1;
  object-fit: contain !important;
  mix-blend-mode: multiply;
  transition: transform .4s var(--hs-ease);
}

.woocommerce ul.products li.product:hover .product-image img { transform: scale(1.05); }

.woocommerce ul.products li.product .product-caption { padding: 14px 16px 8px; }

.woocommerce ul.products li.product .posted-in,
.woocommerce ul.products li.product .posted-in a {
  font-size: 11px !important;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--hs-muted) !important;
  font-weight: 500;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .woocommerce-loop-product__title a {
  color: var(--hs-ink) !important;
  font-weight: 600 !important;
}

/* Sale badge — compact green pill, top-left */
.woocommerce span.onsale {
  min-width: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  line-height: 1.4 !important;
  padding: 5px 12px !important;
  border-radius: 999px !important;
  background: var(--hs-green) !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: .4px;
  top: 12px !important;
  left: 12px !important;
  right: auto !important;
  margin: 0 !important;
  box-shadow: 0 4px 12px rgba(74, 157, 63, .38);
}

/* Prices — unify to brand green (both card styles) */
.woocommerce ul.products li.product .price,
.woocommerce-product-list .price {
  color: var(--hs-green-deep) !important;
  font-weight: 700 !important;
}
.woocommerce ul.products li.product .price ins,
.woocommerce-product-list .price ins {
  text-decoration: none !important;
  color: var(--hs-green-deep) !important;
  font-weight: 700 !important;
}
.woocommerce ul.products li.product .price del,
.woocommerce-product-list .price del {
  color: #A7B0AA !important;
  font-weight: 400 !important;
  opacity: 1 !important;
}
.woocommerce .woocommerce-Price-currencySymbol { font-weight: 600; }

/* Bottom action row */
.woocommerce ul.products li.product .product-caption-bottom {
  align-items: center !important;
  border-top: 1px solid var(--hs-line) !important;
  padding: 12px 16px !important;
}

/* Add-to-cart trigger: chunky grey square -> sleek green circle
   (covers both New Arrivals li.product cards and Top Selling .product-item) */
.woocommerce .shop-action,
.woocommerce .shop-action-button {
  background: transparent !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  flex: 0 0 auto !important;
  line-height: normal !important;
  overflow: visible !important;
}

.woocommerce .shop-action-button > i.supplero-icon-plus {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  background: var(--hs-green) !important;
  color: #fff !important;
  font-size: 15px !important;
  line-height: 1 !important;
  margin: 0 !important;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(74, 157, 63, .40);
  transition: transform .2s var(--hs-ease), background .2s var(--hs-ease), box-shadow .2s var(--hs-ease);
}

.woocommerce .shop-action-button:hover > i.supplero-icon-plus {
  background: var(--hs-green-deep) !important;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 20px rgba(46, 107, 39, .50);
}

/* Hover reveal panel — round it, give it an intentional look */
.woocommerce .shop-action-button .shop-content {
  border-radius: 12px !important;
  overflow: hidden;
  background: rgba(28, 33, 39, .96) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .28);
}
.woocommerce .shop-content .add_to_cart_button,
.woocommerce .shop-content .added_to_cart {
  background: var(--hs-green) !important;
  color: #fff !important;
}
.woocommerce .shop-content .add_to_cart_button:hover { background: var(--hs-green-deep) !important; }

/* Top Selling / list-widget add-to-cart button -> green circle */
.woocommerce-product-list .product-item a.add_to_cart_button,
.woocommerce-product-list .product-item a.added_to_cart {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  padding: 0 !important;
  border-radius: 50% !important;
  background: var(--hs-green) !important;
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(74, 157, 63, .40);
  transition: transform .2s var(--hs-ease), background .2s var(--hs-ease), box-shadow .2s var(--hs-ease);
}
.woocommerce-product-list .product-item a.add_to_cart_button:hover {
  background: var(--hs-green-deep) !important;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 20px rgba(46, 107, 39, .50);
}
.woocommerce-product-list .product-item a.add_to_cart_button::after { color: #fff !important; }

/* ==========================================================================
   REFINEMENTS — uniform card heights, zoom-in hover, zero yellow
   (a) remove Supplero's yellow image-hover overlay everywhere
   (b) contained zoom-in on the image instead
   (c) featured "Top Selling" card identical to the rest
   (d) equal card heights with aligned prices (2-line title reserve)
   ========================================================================== */

/* (a) kill the yellow image-hover tint (.product-image::before) */
.woocommerce .product-image::before,
.woocommerce li.product .product-image::before {
  display: none !important;
  background: transparent !important;
  opacity: 0 !important;
}

/* no yellow fill on any card hover / featured state */
.woocommerce li.product:hover .product-block,
.woocommerce-product-list li.product-item .product-list-inner,
.woocommerce-product-list li.product-item:hover .product-list-inner {
  background: #fff !important;
}

/* (b) contained zoom-in hover */
.woocommerce li.product .product-image,
.woocommerce-product-list li.product-item .product-list-inner > a:first-of-type {
  overflow: hidden !important;
  position: relative;
}
.woocommerce li.product:hover .product-image img,
.woocommerce-product-list li.product-item:hover .product-list-inner > a:first-of-type img {
  transform: scale(1.06) !important;
}

/* (c) TOP SELLING — force the first/featured card to match the others */
.woocommerce-product-list ul.products li.product-item .product-list-inner {
  flex-direction: column !important;
  justify-content: flex-start !important;
}
.woocommerce-product-list ul.products li.product-item .product-list-inner > a:first-of-type {
  order: 0 !important;
  width: 100% !important;
  display: block !important;
  position: relative !important;
  height: auto !important;
  flex: 0 0 auto !important;
  align-self: stretch !important;
  line-height: 0;
}
.woocommerce-product-list ul.products li.product-item .product-list-inner img,
.woocommerce-product-list ul.products li.product-item .product-list-inner > a:first-of-type img {
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  aspect-ratio: 1 / 1;
  object-fit: contain !important;
  float: none !important;
}
.woocommerce-product-list ul.products li.product-item .product-content {
  order: 1 !important;
  position: static !important;
  top: auto !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  text-align: left !important;
}

/* (d) equal heights + aligned prices — reserve ~2 lines for the title */
.woocommerce-product-list li.product-item .product-content .product-title {
  display: block;
  min-height: 2.7em;
}
.woocommerce-product-list li.product-item .product-content .price {
  margin-top: auto !important;
}

/* ==========================================================================
   5. TOP SELLING — kill the yellow featured-card hover fill + compact framing
   Theme source: assets/css/base/elementor.css (~L1026-1040) gives the
   FIRST/featured card a `.product-list-inner > a:before` pseudo-element with
   `background-color: var(--primary)` (yellow #F2CB1F) that animates to
   height:100% on hover, painting yellow behind the image. Also the featured
   img gets max-width:480px + fat padding. Neutralize both here.
   ========================================================================== */

/* (a) remove the yellow primary-color hover overlay on the featured card */
.woocommerce-product-list.products-list-3 ul.products li.product-item:first-child .product-list-inner > a:before,
.woocommerce-product-list.products-list-3 ul.products li.product-item:first-child .product-list-inner:hover > a:before {
  content: none !important;
  display: none !important;
  background-color: transparent !important;
  background: transparent !important;
  height: 0 !important;
  opacity: 0 !important;
  animation: none !important;
  z-index: -1 !important;
}

/* keep the featured card's image link background white/soft like the others */
.woocommerce-product-list.products-list-3 ul.products li.product-item:first-child .product-list-inner,
.woocommerce-product-list.products-list-3 ul.products li.product-item:first-child .product-list-inner:hover,
.woocommerce-product-list.products-list-3 ul.products li.product-item:first-child .product-list-inner > a:first-of-type {
  background: linear-gradient(180deg, #FBFDFB, var(--hs-panel)) !important;
}
.woocommerce-product-list.products-list-3 ul.products li.product-item:first-child .product-list-inner {
  background: #fff !important;
}

/* (b) tame the oversized featured image + fat padding -> match the grid */
.woocommerce-product-list.products-list-3 ul.products li.product-item:first-child .product-list-inner img {
  max-width: 100% !important;
  padding: 0 !important;
  aspect-ratio: 1 / 1;
  object-fit: contain !important;
}
.woocommerce-product-list.products-list-3 ul.products li.product-item:first-child .product-list-inner > a:first-of-type {
  padding: 14px !important;
}

/* New Arrivals / archive: equal-height slides */
.woocommerce-carousel .slick-track { display: flex !important; }
.woocommerce-carousel .slick-slide { height: auto !important; }
.woocommerce-carousel .slick-slide > div { height: 100%; }

.woocommerce ul.products li.product { height: 100%; }
.woocommerce ul.products li.product .product-block {
  display: flex !important;
  flex-direction: column !important;
  height: 100%;
}
.woocommerce ul.products li.product .product-caption {
  display: flex !important;
  flex-direction: column;
  flex: 1 1 auto !important;
}
.woocommerce ul.products li.product .woocommerce-loop-product__title {
  display: block;
  min-height: 2.7em;
}
.woocommerce ul.products li.product .product-caption-bottom {
  margin-top: auto !important;
}
