/*
Theme Name: Flatsome Child
Description: This is a child theme for Flatsome Theme
Author: UX Themes
Template: flatsome
Version: 3.0.6
*/

/*************** ADD CUSTOM CSS HERE.   ***************/

/*
 * Sticky add-to-cart：桌面只隐藏底部固定条，不能隐藏 wrapper（Flatsome 把数量/按钮包在里面）。
 */
@media (min-width: 850px) {
  .product-summary .sticky-add-to-cart-wrapper,
  .entry-summary .sticky-add-to-cart-wrapper {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .product-summary .sticky-add-to-cart,
  .entry-summary .sticky-add-to-cart {
    position: static !important;
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    width: 100%;
    box-shadow: none !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
  }

  .product-summary .sticky-add-to-cart__product,
  .entry-summary .sticky-add-to-cart__product {
    display: none !important;
  }

  .product-summary .sticky-add-to-cart .single_add_to_cart_button,
  .entry-summary .sticky-add-to-cart .single_add_to_cart_button {
    display: inline-block !important;
    height: auto !important;
    min-height: 2.5em;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .product-summary .sticky-add-to-cart.sticky-add-to-cart--active,
  .entry-summary .sticky-add-to-cart.sticky-add-to-cart--active {
    position: static !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    z-index: auto !important;
  }
}

/* Product grid: keep cards visually consistent (home + catalog + Related). */
.home .products .product-small .box-image,
body.lc-product-grid-align-active .products .product-small .box-image,
body.single-product .related-products-wrapper .product-small .box-image {
  height: 320px !important;
  overflow: hidden;
  background: #f4f4f4;
  position: relative;
}

.home .products .product-small .box-image .image-fade_in_back,
body.lc-product-grid-align-active .products .product-small .box-image .image-fade_in_back,
body.single-product .related-products-wrapper .product-small .box-image .image-fade_in_back {
  position: absolute !important;
  inset: 0;
  width: 100%;
  height: 100%;
  padding-top: 0 !important;
}

.home .products .product-small .box-image .image-fade_in_back > a,
body.lc-product-grid-align-active .products .product-small .box-image .image-fade_in_back > a,
body.single-product .related-products-wrapper .product-small .box-image .image-fade_in_back > a {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home .products .product-small .box-image img:not(.back-image),
body.lc-product-grid-align-active .products .product-small .box-image img:not(.back-image),
body.single-product .related-products-wrapper .product-small .box-image img:not(.back-image) {
  position: relative !important;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
}

/* Ensure hover back-image uses the same contain + center behavior. */
.home .products .product-small .box-image img.back-image,
body.lc-product-grid-align-active .products .product-small .box-image img.back-image,
body.single-product .related-products-wrapper .product-small .box-image img.back-image {
  position: absolute !important;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
}

@media only screen and (max-width: 48em) {
  .home .products .product-small .box-image,
  body.lc-product-grid-align-active .products .product-small .box-image,
  body.single-product .related-products-wrapper .product-small .box-image {
    height: 220px !important;
  }
}

/* 列表商品卡：标题、价格居中（首页 + 类目/商店 + Related） */
body.home .product-small.col .box-text,
.home .products .product-small .box-text,
body.lc-product-grid-align-active .products .product-small .box-text,
body.single-product .related-products-wrapper .product-small .box-text {
  min-height: 72px;
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  justify-content: flex-start;
  align-items: center !important;
  text-align: center !important;
  width: 100%;
}

body.home .product-small.col .box-text.flex-row,
body.home .product-small.col .box-text.grid-style-3,
body.lc-product-grid-align-active .products .product-small .box-text.flex-row,
body.lc-product-grid-align-active .products .product-small .box-text.grid-style-3,
body.single-product .related-products-wrapper .product-small .box-text.flex-row,
body.single-product .related-products-wrapper .product-small .box-text.grid-style-3 {
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
}

body.home .product-small.col .title-wrapper,
body.home .product-small.col .price-wrapper,
.home .products .product-small .title-wrapper,
.home .products .product-small .price-wrapper,
body.lc-product-grid-align-active .products .product-small .title-wrapper,
body.lc-product-grid-align-active .products .product-small .price-wrapper,
body.single-product .related-products-wrapper .product-small .title-wrapper,
body.single-product .related-products-wrapper .product-small .price-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  text-align: center !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
}

body.home .product-small.col .name.product-title,
body.home .product-small.col .woocommerce-loop-product__title,
.home .products .product-small .name.product-title,
body.lc-product-grid-align-active .products .product-small .name.product-title,
body.lc-product-grid-align-active .products .product-small .woocommerce-loop-product__title,
body.single-product .related-products-wrapper .product-small .name.product-title,
body.single-product .related-products-wrapper .product-small .woocommerce-loop-product__title {
  min-height: 36px;
  line-height: 1.25;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-align: center !important;
  width: 100% !important;
  -webkit-box-pack: center;
}

body.home .product-small.col .name.product-title a,
body.home .product-small.col .woocommerce-loop-product__title a,
.home .products .product-small .name.product-title a,
body.lc-product-grid-align-active .products .product-small .name.product-title a,
body.lc-product-grid-align-active .products .product-small .woocommerce-loop-product__title a,
body.single-product .related-products-wrapper .product-small .name.product-title a,
body.single-product .related-products-wrapper .product-small .woocommerce-loop-product__title a {
  display: inline !important;
  text-align: center !important;
  width: auto !important;
  max-width: 100%;
}

body.home .product-small.col .price-wrapper,
.home .products .product-small .price-wrapper,
body.lc-product-grid-align-active .products .product-small .price-wrapper,
body.single-product .related-products-wrapper .product-small .price-wrapper {
  min-height: 22px;
}

body.home .product-small.col .price-wrapper .price,
.home .products .product-small .price-wrapper .price,
body.lc-product-grid-align-active .products .product-small .price-wrapper .price,
body.single-product .related-products-wrapper .product-small .price-wrapper .price {
  display: block !important;
  text-align: center !important;
  width: 100% !important;
  margin: 0 auto !important;
}


/* 首页已删除的 hidden 区块：防止 Flickity 滑块在浏览器中仍占位留白 */
.home #content .hidden.row-slider,
.home #content .section-title-container.hidden {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}

.home #content .hidden.row-slider .flickity-viewport {
  height: 0 !important;
}

/* 隐藏变体切换时的 blockUI 白色遮罩闪烁 */
form.variations_form .blockUI.blockOverlay {
    background: transparent !important;
    opacity: 0 !important;
}

@media only screen and (max-width: 48em) {
/*************** ADD MOBILE ONLY CSS HERE  ***************/
}