/**
 * Plantjai global laboratory product cards.
 *
 * Single source of truth for every Woodmart product loop: shop archives,
 * category pages, WPBakery product grids, curated guides, sliders and related
 * products. Supports both standard cards and Woodmart quick-hover cards.
 */

@keyframes pj-lab-scan {
  0% {
    transform: translateY(-18px);
    opacity: 0;
  }
  12%,
  84% {
    opacity: 1;
  }
  100% {
    transform: translateY(290px);
    opacity: 0;
  }
}

body .wd-product .product-wrapper {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  overflow: hidden !important;
  background: #f8faf6 !important;
  border: 1px solid #c4cec2 !important;
  border-radius: 0 !important;
  box-shadow: 2px 2px 0 rgba(42, 61, 47, 0.08) !important;
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease !important;
}

body .wd-products:not(.wd-carousel) > .wd-product {
  height: 100% !important;
}

body .wd-product:hover .product-wrapper,
body .wd-product:focus-within .product-wrapper {
  transform: translateY(-4px) !important;
  border-color: #718374 !important;
  box-shadow: 8px 8px 0 rgba(42, 61, 47, 0.1) !important;
}

body .wd-product .product-element-top {
  position: relative !important;
  overflow: hidden !important;
}

body .wd-product .product-image-link {
  position: relative !important;
  display: block !important;
  overflow: hidden !important;
}

/* Broad translucent laser with a thin white/chartreuse core. */
body .wd-product .product-element-top::after {
  content: "";
  position: absolute;
  z-index: 4;
  top: -10px;
  right: 4%;
  left: 4%;
  height: 24px;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(232, 249, 135, 0) 14%,
    rgba(232, 249, 135, 0.06) 30%,
    rgba(232, 249, 135, 0.2) 43%,
    #edf99a 48%,
    #ffffff 50%,
    #edf99a 52%,
    rgba(232, 249, 135, 0.2) 57%,
    rgba(232, 249, 135, 0.06) 70%,
    rgba(232, 249, 135, 0) 86%,
    transparent 100%
  );
  filter: drop-shadow(0 0 4px rgba(232, 249, 135, 0.72));
}

body .wd-product:hover .product-element-top::after {
  animation: pj-lab-scan 1.45s ease-in-out infinite;
}

body .wd-product .product-element-top::before {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 8px;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(#e6f67a, #e6f67a) left top / 18px 1px no-repeat,
    linear-gradient(#e6f67a, #e6f67a) left top / 1px 18px no-repeat,
    linear-gradient(#e6f67a, #e6f67a) right top / 18px 1px no-repeat,
    linear-gradient(#e6f67a, #e6f67a) right top / 1px 18px no-repeat,
    linear-gradient(#e6f67a, #e6f67a) left bottom / 18px 1px no-repeat,
    linear-gradient(#e6f67a, #e6f67a) left bottom / 1px 18px no-repeat,
    linear-gradient(#e6f67a, #e6f67a) right bottom / 18px 1px no-repeat,
    linear-gradient(#e6f67a, #e6f67a) right bottom / 1px 18px no-repeat;
  transition: opacity 0.18s ease;
}

body .wd-product:hover .product-element-top::before,
body .wd-product:focus-within .product-element-top::before {
  opacity: 0.9;
}

html body .wd-product .product-image-link img,
html body .wd-product .wd-product-img-hover img {
  opacity: 1 !important;
  transition:
    transform 0.45s ease,
    opacity 0.3s ease !important;
}

html body .wd-product:hover .product-image-link img,
html body .wd-product:hover .wd-product-img-hover img {
  opacity: 1 !important;
  transform: scale(1.025) !important;
}

body .wd-product .product-labels {
  gap: 4px !important;
}

body .wd-product .product-label.featured,
body .wd-product .product-label.onsale {
  width: auto !important;
  min-width: 42px !important;
  height: 25px !important;
  min-height: 25px !important;
  padding: 0 9px !important;
  border-radius: 0 !important;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%) !important;
  box-shadow: none !important;
  font-family: "IBM Plex Mono", Menlo, monospace !important;
  font-size: 8px !important;
  font-weight: 700 !important;
  line-height: 25px !important;
  letter-spacing: 0.08em !important;
}

body .wd-product .product-label.featured {
  color: #172318 !important;
  background: #ddeb68 !important;
}

body .wd-product .product-label.onsale {
  color: #fff !important;
  background: #31495f !important;
}

body .wd-product .product-label.label-term-pet-friendly {
  position: relative !important;
  display: grid !important;
  place-items: center !important;
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  border-radius: 0 !important;
  clip-path: polygon(28% 0, 72% 0, 100% 28%, 100% 72%, 72% 100%, 28% 100%, 0 72%, 0 28%) !important;
  background: #fff !important;
  box-shadow:
    inset 0 0 0 1px #52645a,
    0 2px 7px rgba(0, 0, 0, 0.22) !important;
}

body .wd-product .product-label.label-term-pet-friendly img {
  display: none !important;
}

body .wd-product .product-label.label-term-pet-friendly::before {
  content: "" !important;
  display: block !important;
  width: 22px !important;
  height: 22px !important;
  background: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='%231a2e1a'%3E%3Cellipse cx='6.1' cy='8.1' rx='2.2' ry='2.8' transform='rotate(-25 6.1 8.1)'/%3E%3Cellipse cx='10.2' cy='5.8' rx='2.1' ry='2.8' transform='rotate(-7 10.2 5.8)'/%3E%3Cellipse cx='14.5' cy='6.1' rx='2.1' ry='2.8' transform='rotate(10 14.5 6.1)'/%3E%3Cellipse cx='18' cy='8.8' rx='2.1' ry='2.7' transform='rotate(27 18 8.8)'/%3E%3Cpath d='M12 10.2c-2.2 0-2.8 1.5-4.4 3.2-1.3 1.4-1.7 3.3-.5 4.7 1.1 1.3 2.9.7 4.9.7s3.8.6 4.9-.7c1.2-1.4.8-3.3-.5-4.7-1.6-1.7-2.2-3.2-4.4-3.2Z'/%3E%3C/g%3E%3C/svg%3E") !important;
}

/* Standard Woodmart cards. */
body .wd-product .product-element-bottom {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  gap: 6px !important;
  padding: 11px 12px 12px !important;
  text-align: left !important;
}

body .wd-product .product-element-bottom::before {
  content: "SPECIMEN DATA";
  display: block;
  margin-bottom: 2px;
  padding-bottom: 6px;
  border-bottom: 1px solid #cbd4c9;
  color: #718074;
  font-family: "IBM Plex Mono", Menlo, monospace;
  font-size: 7px;
  line-height: 1;
  letter-spacing: 0.16em;
}

/* Quick-hover cards place data directly under .product-wrapper. */
body .wd-product .product-wrapper:not(:has(.product-element-bottom)) {
  padding-bottom: 12px !important;
}

body .wd-product .product-wrapper:not(:has(.product-element-bottom)) > .wd-entities-title,
body .wd-product .product-wrapper:not(:has(.product-element-bottom)) > .woocommerce-loop-product__title {
  margin: 0 12px !important;
}

body .wd-product .product-wrapper:not(:has(.product-element-bottom)) > .wd-entities-title::before,
body .wd-product .product-wrapper:not(:has(.product-element-bottom)) > .woocommerce-loop-product__title::before {
  content: "SPECIMEN DATA";
  display: block;
  margin: 10px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #cbd4c9;
  color: #718074;
  font-family: "IBM Plex Mono", Menlo, monospace;
  font-size: 7px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.16em;
}

body .wd-product .product-wrapper:not(:has(.product-element-bottom)) > .pj-latin-name,
body .wd-product .product-wrapper:not(:has(.product-element-bottom)) > .pj-spec-pills,
body .wd-product .product-wrapper:not(:has(.product-element-bottom)) > .price {
  width: calc(100% - 24px) !important;
  margin-right: 12px !important;
  margin-left: 12px !important;
}

body .wd-product .wd-entities-title,
body .wd-product .wd-entities-title a,
body .wd-product .woocommerce-loop-product__title,
body .wd-product .woocommerce-loop-product__title a {
  color: #1f2c22 !important;
  font-family: Montserrat, "Noto Sans TC", sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  letter-spacing: 0.04em !important;
  text-align: left !important;
}

body .wd-product .pj-latin-name {
  margin-top: 0 !important;
  margin-bottom: 2px !important;
  color: #657268 !important;
  font-family: "IBM Plex Mono", Menlo, monospace !important;
  font-size: 8px !important;
  line-height: 1.4 !important;
  text-align: left !important;
}

body .wd-product .pj-spec-pills--loop {
  gap: 3px !important;
}

body .wd-product .pj-spec-pill {
  height: 20px !important;
  min-height: 20px !important;
  max-height: 20px !important;
  padding: 0 5px !important;
  overflow: hidden !important;
  border-color: #cbd4c9 !important;
  border-radius: 0 !important;
  background: rgba(255, 255, 252, 0.65) !important;
  color: #3d4a40 !important;
  font-size: 8px !important;
  white-space: nowrap !important;
}

body .wd-product .price {
  display: flex !important;
  align-items: baseline !important;
  justify-content: space-between !important;
  gap: 8px !important;
  order: 10 !important;
  margin-top: 4px !important;
  margin-bottom: 0 !important;
  padding-top: 8px !important;
  border-top: 1px solid #cbd4c9 !important;
  color: #1a2e1a !important;
  font-family: "IBM Plex Mono", Menlo, monospace !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  text-align: right !important;
}

body .wd-product .price::before {
  content: "PRICE";
  flex: 0 0 auto;
  color: #748278;
  font-size: 7px;
  font-weight: 500;
  letter-spacing: 0.14em;
}

body .wd-product .product-wrapper:not(:has(.product-element-bottom)) > .price {
  margin-top: auto !important;
}

body .wd-product .product-element-bottom > .wd-add-btn {
  order: 20 !important;
  display: flex !important;
  width: 100% !important;
  margin-top: auto !important;
}

/* Woo wraps the loop button in <p> — stretch so the + sits on the full card width. */
body .wd-product .wd-add-btn > p {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

body .wd-product .product-wrapper .wd-add-btn a.add-to-cart-loop {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid #1a2e1a !important;
  border-radius: 0 !important;
  background: linear-gradient(90deg, #1a2e1a 0 calc(100% - 36px), #fff calc(100% - 36px)) !important;
  color: #fff !important;
  font-family: "IBM Plex Mono", Menlo, monospace !important;
  font-size: 9px !important;
  letter-spacing: 0.1em !important;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease !important;
}

body .wd-product .product-wrapper .wd-add-btn a.add-to-cart-loop .wd-action-text {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 36px 0 8px !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
  text-align: center !important;
}

/* + glyph centered in the white 36px end-cap */
body .wd-product .product-wrapper .wd-add-btn a.add-to-cart-loop .wd-action-text::after {
  content: "" !important;
  position: absolute !important;
  top: 50% !important;
  right: 0 !important;
  display: block !important;
  width: 36px !important;
  height: 40px !important;
  margin: 0 !important;
  transform: translateY(-50%) !important;
  background:
    linear-gradient(#1a2e1a, #1a2e1a) center / 10px 1px no-repeat,
    linear-gradient(#1a2e1a, #1a2e1a) center / 1px 10px no-repeat !important;
}

body .wd-product .product-wrapper .wd-add-btn a.add-to-cart-loop:hover,
body .wd-product .product-wrapper .wd-add-btn a.add-to-cart-loop:focus-visible {
  border-color: #718374 !important;
  outline: 2px solid rgba(113, 131, 116, 0.28) !important;
  outline-offset: 2px !important;
  background: linear-gradient(90deg, #718374 0 calc(100% - 36px), #fff calc(100% - 36px)) !important;
  color: #fff !important;
}

@media (max-width: 767px) {
  body .wd-product .product-element-bottom {
    padding: 9px 8px 10px !important;
  }

  body .wd-product .product-element-bottom::before,
  body .wd-product .product-wrapper:not(:has(.product-element-bottom)) > .wd-entities-title::before,
  body .wd-product .product-wrapper:not(:has(.product-element-bottom)) > .woocommerce-loop-product__title::before {
    font-size: 6px !important;
  }

  body .wd-product .product-wrapper:not(:has(.product-element-bottom)) {
    padding-bottom: 8px !important;
  }

  body .wd-product .product-wrapper:not(:has(.product-element-bottom)) > .wd-entities-title,
  body .wd-product .product-wrapper:not(:has(.product-element-bottom)) > .woocommerce-loop-product__title,
  body .wd-product .product-wrapper:not(:has(.product-element-bottom)) > .pj-latin-name,
  body .wd-product .product-wrapper:not(:has(.product-element-bottom)) > .pj-spec-pills,
  body .wd-product .product-wrapper:not(:has(.product-element-bottom)) > .price {
    width: calc(100% - 16px) !important;
    margin-right: 8px !important;
    margin-left: 8px !important;
  }

  body .wd-product:hover .product-wrapper {
    transform: none !important;
    box-shadow: 2px 2px 0 rgba(42, 61, 47, 0.08) !important;
  }

  body .wd-product .price {
    font-size: 11px !important;
  }

  body .wd-product .price::before {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body .wd-product *,
  body .wd-product *::before,
  body .wd-product *::after {
    animation: none !important;
    transition: none !important;
  }
}
