/* =========================================================
   RJY Display - Global WooCommerce Product Cards
   Applies to WooCommerce archives, Elementor product widgets,
   related products, and standard product loops.
   ========================================================= */

body {
  --rjy-card-blue: #2c58ab;
  --rjy-card-blue-dark: #113163;
  --rjy-card-text: #24324a;
  --rjy-card-muted: #66758f;
  --rjy-card-border: rgba(44, 88, 171, 0.16);
  --rjy-card-border-strong: rgba(44, 88, 171, 0.28);
  --rjy-card-bg: #ffffff;
  --rjy-card-bg-soft: #f6f9ff;
  --rjy-card-shadow: 0 14px 34px rgba(17, 49, 99, 0.07);
  --rjy-card-shadow-hover: 0 22px 48px rgba(17, 49, 99, 0.12);
}

/* =========================================================
   Product grid layout
   Override overly dense 5-column product grids.
   ========================================================= */

body .woocommerce ul.products,
body .woocommerce-page ul.products,
body .elementor-widget-woocommerce-products .woocommerce ul.products,
body .elementor-products-grid ul.products,
body ul.products.elementor-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 24px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

/* Keep product lists from inheriting Woo column widths */
body .woocommerce ul.products::before,
body .woocommerce ul.products::after {
  display: none !important;
  content: none !important;
}

/* =========================================================
   Product card base
   ========================================================= */

body .woocommerce ul.products li.product,
body .woocommerce-page ul.products li.product,
body .elementor-widget-woocommerce-products ul.products li.product,
body ul.products.elementor-grid li.product {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  float: none !important;
  clear: none !important;
  width: auto !important;
  min-width: 0 !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 16px !important;
  border: 1px solid var(--rjy-card-border) !important;
  border-radius: 20px !important;
  background:
    radial-gradient(circle at top right, rgba(44, 88, 171, 0.06), transparent 34%),
    var(--rjy-card-bg) !important;
  box-shadow: var(--rjy-card-shadow) !important;
  overflow: hidden !important;
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease !important;
}

body .woocommerce ul.products li.product:hover,
body .woocommerce-page ul.products li.product:hover,
body .elementor-widget-woocommerce-products ul.products li.product:hover,
body ul.products.elementor-grid li.product:hover {
  transform: translateY(-4px);
  border-color: var(--rjy-card-border-strong) !important;
  box-shadow: var(--rjy-card-shadow-hover) !important;
}

/* =========================================================
   Image area
   ========================================================= */

body .woocommerce ul.products li.product figure,
body .woocommerce-page ul.products li.product figure,
body .elementor-widget-woocommerce-products ul.products li.product figure,
body ul.products.elementor-grid li.product figure {
  display: block !important;
  width: 100% !important;
  margin: 0 0 14px !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 16px !important;
  background:
    linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%) !important;
}

body .woocommerce ul.products li.product .ct-media-container,
body .woocommerce-page ul.products li.product .ct-media-container,
body .elementor-widget-woocommerce-products ul.products li.product .ct-media-container,
body ul.products.elementor-grid li.product .ct-media-container {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  aspect-ratio: 4 / 3 !important;
  padding: 12px !important;
  background:
    linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%) !important;
  overflow: hidden !important;
}

body .woocommerce ul.products li.product img,
body .woocommerce-page ul.products li.product img,
body .elementor-widget-woocommerce-products ul.products li.product img,
body ul.products.elementor-grid li.product img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  object-fit: contain !important;
  transition: transform 0.26s ease !important;
}

body .woocommerce ul.products li.product:hover img,
body .woocommerce-page ul.products li.product:hover img,
body .elementor-widget-woocommerce-products ul.products li.product:hover img,
body ul.products.elementor-grid li.product:hover img {
  transform: scale(1.035);
}

/* =========================================================
   Product category pill
   ========================================================= */

body .rjy-loop-product-category {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 9px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(44, 88, 171, 0.10);
  color: var(--rjy-card-blue);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================================
   Product title
   ========================================================= */

body .woocommerce ul.products li.product .woocommerce-loop-product__title,
body .woocommerce-page ul.products li.product .woocommerce-loop-product__title,
body .elementor-widget-woocommerce-products ul.products li.product .woocommerce-loop-product__title,
body ul.products.elementor-grid li.product .woocommerce-loop-product__title {
  margin: 0 0 12px !important;
  padding: 0 !important;
  color: var(--rjy-card-blue-dark) !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  line-height: 1.38 !important;
  letter-spacing: -0.012em !important;
}

body .woocommerce ul.products li.product .woocommerce-loop-product__title a,
body .woocommerce-page ul.products li.product .woocommerce-loop-product__title a,
body .elementor-widget-woocommerce-products ul.products li.product .woocommerce-loop-product__title a,
body ul.products.elementor-grid li.product .woocommerce-loop-product__title a {
  display: -webkit-box !important;
  color: var(--rjy-card-blue-dark) !important;
  text-decoration: none !important;
  overflow: hidden !important;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

body .woocommerce ul.products li.product .woocommerce-loop-product__title a:hover,
body .woocommerce-page ul.products li.product .woocommerce-loop-product__title a:hover,
body .elementor-widget-woocommerce-products ul.products li.product .woocommerce-loop-product__title a:hover,
body ul.products.elementor-grid li.product .woocommerce-loop-product__title a:hover {
  color: var(--rjy-card-blue) !important;
}

/* =========================================================
   Product meta: SKU + attributes
   ========================================================= */

body .rjy-loop-product-meta {
  display: grid;
  gap: 10px;
  margin: 0 0 15px;
}

body .rjy-loop-product-sku {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(44, 88, 171, 0.12);
  border-radius: 11px;
  background: #f8fbff;
}

body .rjy-loop-product-sku span {
  color: var(--rjy-card-muted);
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

body .rjy-loop-product-sku strong {
  color: var(--rjy-card-text);
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body .rjy-loop-product-specs {
  display: grid;
  gap: 7px;
}

body .rjy-loop-product-spec {
  display: grid;
  grid-template-columns: minmax(70px, 0.85fr) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
  padding: 0 0 7px;
  border-bottom: 1px solid rgba(44, 88, 171, 0.10);
}

body .rjy-loop-product-spec:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

body .rjy-loop-product-spec span {
  color: var(--rjy-card-muted);
  font-size: 12px;
  line-height: 1.35;
}

body .rjy-loop-product-spec strong {
  color: var(--rjy-card-text);
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* =========================================================
   Hide default price/rating if present
   RJY product cards should behave as B2B inquiry cards.
   ========================================================= */

body .woocommerce ul.products li.product .price,
body .woocommerce-page ul.products li.product .price,
body .elementor-widget-woocommerce-products ul.products li.product .price,
body ul.products.elementor-grid li.product .price,
body .woocommerce ul.products li.product .star-rating,
body .woocommerce-page ul.products li.product .star-rating,
body .elementor-widget-woocommerce-products ul.products li.product .star-rating,
body ul.products.elementor-grid li.product .star-rating {
  display: none !important;
}

/* =========================================================
   Card actions
   ========================================================= */

body .woocommerce ul.products li.product .ct-woo-card-actions,
body .woocommerce-page ul.products li.product .ct-woo-card-actions,
body .elementor-widget-woocommerce-products ul.products li.product .ct-woo-card-actions,
body ul.products.elementor-grid li.product .ct-woo-card-actions {
  display: block !important;
  width: 100% !important;
  margin-top: auto !important;
  padding-top: 14px !important;
}

body .woocommerce ul.products li.product .ct-woo-card-actions::before,
body .woocommerce-page ul.products li.product .ct-woo-card-actions::before,
body .elementor-widget-woocommerce-products ul.products li.product .ct-woo-card-actions::before,
body ul.products.elementor-grid li.product .ct-woo-card-actions::before {
  content: "Engineering review available";
  display: block;
  margin-bottom: 10px;
  color: var(--rjy-card-muted);
  font-size: 12.5px;
  line-height: 1.35;
}

body .woocommerce ul.products li.product .button,
body .woocommerce-page ul.products li.product .button,
body .elementor-widget-woocommerce-products ul.products li.product .button,
body ul.products.elementor-grid li.product .button,
body .woocommerce ul.products li.product .rjy-loop-product-button,
body .woocommerce-page ul.products li.product .rjy-loop-product-button,
body .elementor-widget-woocommerce-products ul.products li.product .rjy-loop-product-button,
body ul.products.elementor-grid li.product .rjy-loop-product-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 11px 14px !important;
  border: 1px solid var(--rjy-card-blue) !important;
  border-radius: 12px !important;
  background: var(--rjy-card-blue) !important;
  color: #ffffff !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  text-align: center !important;
  text-decoration: none !important;
  box-shadow: 0 10px 20px rgba(44, 88, 171, 0.18) !important;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease !important;
}

body .woocommerce ul.products li.product .button:hover,
body .woocommerce-page ul.products li.product .button:hover,
body .elementor-widget-woocommerce-products ul.products li.product .button:hover,
body ul.products.elementor-grid li.product .button:hover {
  background: var(--rjy-card-blue-dark) !important;
  border-color: var(--rjy-card-blue-dark) !important;
  transform: translateY(-1px);
}

/* =========================================================
   Product badges / sale labels cleanup
   ========================================================= */

body .woocommerce ul.products li.product .onsale,
body .woocommerce-page ul.products li.product .onsale,
body .elementor-widget-woocommerce-products ul.products li.product .onsale,
body ul.products.elementor-grid li.product .onsale {
  top: 14px !important;
  left: 14px !important;
  right: auto !important;
  min-height: auto !important;
  min-width: auto !important;
  padding: 6px 10px !important;
  border-radius: 999px !important;
  background: var(--rjy-card-blue) !important;
  color: #ffffff !important;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}

/* =========================================================
   Elementor-specific cleanup
   ========================================================= */

body .elementor-widget-woocommerce-products .woocommerce {
  width: 100% !important;
}

body .elementor-widget-woocommerce-products .elementor-widget-container {
  width: 100% !important;
}

body .elementor-widget-woocommerce-products .woocommerce.columns-5,
body .elementor-widget-woocommerce-products .woocommerce.columns-4,
body .elementor-widget-woocommerce-products .woocommerce.columns-3 {
  width: 100% !important;
}

/* =========================================================
   Responsive layout
   ========================================================= */

@media (max-width: 1180px) {
  body .woocommerce ul.products,
  body .woocommerce-page ul.products,
  body .elementor-widget-woocommerce-products .woocommerce ul.products,
  body .elementor-products-grid ul.products,
  body ul.products.elementor-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 22px !important;
  }
}

@media (max-width: 900px) {
  body .woocommerce ul.products,
  body .woocommerce-page ul.products,
  body .elementor-widget-woocommerce-products .woocommerce ul.products,
  body .elementor-products-grid ul.products,
  body ul.products.elementor-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 18px !important;
  }

  body .woocommerce ul.products li.product,
  body .woocommerce-page ul.products li.product,
  body .elementor-widget-woocommerce-products ul.products li.product,
  body ul.products.elementor-grid li.product {
    padding: 14px !important;
    border-radius: 18px !important;
  }

  body .woocommerce ul.products li.product .woocommerce-loop-product__title,
  body .woocommerce-page ul.products li.product .woocommerce-loop-product__title,
  body .elementor-widget-woocommerce-products ul.products li.product .woocommerce-loop-product__title,
  body ul.products.elementor-grid li.product .woocommerce-loop-product__title {
    font-size: 15px !important;
  }
}

@media (max-width: 560px) {
  body .woocommerce ul.products,
  body .woocommerce-page ul.products,
  body .elementor-widget-woocommerce-products .woocommerce ul.products,
  body .elementor-products-grid ul.products,
  body ul.products.elementor-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  body .woocommerce ul.products li.product,
  body .woocommerce-page ul.products li.product,
  body .elementor-widget-woocommerce-products ul.products li.product,
  body ul.products.elementor-grid li.product {
    padding: 14px !important;
  }

  body .woocommerce ul.products li.product .ct-media-container,
  body .woocommerce-page ul.products li.product .ct-media-container,
  body .elementor-widget-woocommerce-products ul.products li.product .ct-media-container,
  body ul.products.elementor-grid li.product .ct-media-container {
    padding: 10px !important;
  }

  body .rjy-loop-product-spec {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}