/*
 * product_card.scss.css
 * Product card component (.item_product_main) for grid/listing/module contexts.
 * Restored from parent theme (buildera) - factone main.scss.css was rebuilt and
 * lost this component, causing broken listing cards (oversized font, duplicated
 * stacked images). Loaded globally via header.tpl + config.json.
 * Requires html font-size:62.5% base (1rem = 10px). Colors use --shop-color-* vars.
 * @added 2026-09-14 by Tieu
 */

.item_product_main {
  display: block;
  height: 100%;
  padding-bottom: 28px;
  position: relative
}

.item_product_main .product-action {
  background: #fff;
  border-radius: 0px;
  height: 100%;
  border: 1px solid #ddd;
  margin-bottom: 0px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: end;
  overflow: hidden;
  border-radius: 10px
}

.item_product_main .product-action .product-thumbnail {
  width: 100%;
  aspect-ratio: 1;
  position: relative;
  overflow: hidden
}

.item_product_main .product-action .product-thumbnail .image_thumb img {
  width: auto;
  max-height: 100%;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  margin: auto;
  object-fit: contain
}

.item_product_main .product-action .product-thumbnail .image_thumb img.image1 {
  transition: all 0.5s ease 0s;
  transform: translateY(0)
}

.item_product_main .product-action .product-thumbnail .image_thumb img.image2 {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: all 0.5s ease 0s;
  visibility: hidden;
  transform: translateY(-100%)
}

.item_product_main .product-action .product-thumbnail .badge {
  position: absolute;
  bottom: 5px;
  left: 5px;
  width: 100%
}

.item_product_main .product-action .product-thumbnail .badge span {
  border-radius: 5px;
  display: inline-block;
  text-align: center;
  height: 22px;
  padding: 0px 5px;
  line-height: 22px;
  font-weight: 500;
  font-size: 1.2rem
}

.item_product_main .product-action .product-thumbnail .badge span:first-child {
  margin-right: 3px
}

.item_product_main .product-action .product-thumbnail .badge .new {
  background-color: #ff650c;
  color: #fff
}

.item_product_main .product-action .product-thumbnail .badge .best {
  background-color: #af0102;
  color: #fff
}

.item_product_main .product-action .product-thumbnail .pre-order {
  justify-content: center;
  align-items: center;
  display: flex;
  position: absolute;
  width: 100%;
  top: 50%;
  left: 50%;
  text-align: center;
  z-index: 0;
  transition: all 0.3s ease-in-out;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease-in-out;
  width: 70px;
  height: 57px
}

.item_product_main .product-action .product-thumbnail .pre-order img {
  max-width: 70px;
  max-height: 57px
}

.item_product_main .product-action .product-thumbnail .flash-sale {
  background: linear-gradient(93.01deg, #d31100 15.48%, #ff2310 92.66%);
  border-radius: 5px 5px 5px 0px;
  padding: 0px 10px;
  color: #fff;
  position: absolute;
  left: 5px;
  top: 5px;
  height: 24px;
  line-height: 24px;
  text-align: center
}

.item_product_main .product-action .product-thumbnail .flash-sale:before {
  content: "";
  position: absolute;
  left: 0;
  top: 22px;
  border-right: 10px solid transparent;
  border-bottom: 0px solid transparent;
  border-top: 10px solid #d31100
}

.item_product_main .product-action .product-info {
  width: 100%;
  padding: 10px;
  position: relative;
  background: #fff;
  transition-duration: .3s;
  z-index: 3
}

.item_product_main .product-action .product-info .product-name {
  font-size: 1.6rem;
  min-height: 46px
}

.item_product_main .product-action .product-info .product-name:hover,
.item_product_main .product-action .product-info .product-name:focus {
  color: var(--shop-color-main)
}

.item_product_main .product-action .product-info .product-name:hover a,
.item_product_main .product-action .product-info .product-name:focus a {
  color: var(--shop-color-main)
}

.item_product_main .product-action .product-info .product-price-cart {
  margin-top: 4px;
  min-height: 46px
}

.item_product_main .product-action .product-info .product-price-cart .compare-price {
  display: block;
  width: auto;
  color: #9aa5b3;
  font-size: 1.4rem;
  text-decoration: line-through;
  line-height: initial
}

.item_product_main .product-action .product-info .product-price-cart .price {
  color: var(--price-color-text);
  font-weight: 700;
  display: inline-block;
  width: auto;
  font-size: 1.6rem;
  line-height: initial;
  position: relative
}

.item_product_main .product-action .product-info .product-button {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  position: absolute;
  top: 100%;
  left: 0;
  padding: 0 10px;
  padding-top: 12px;
  gap: 8px
}

.item_product_main .product-action .product-info .product-button .btn-views {
  display: block;
  width: 100%;
  background: var(--btn-color-bg);
  color: var(--btn-color-text);
  border: 0;
  font-weight: 600;
  font-size: 1.4rem;
  padding: 5px;
  border-radius: 8px;
  text-align: center
}

@media (max-width: 767px) {
  .item_product_main .product-action .product-info .product-button .btn-views {
    font-size: 14px;
    padding: 5px 5px
  }
}

.item_product_main .product-action .product-info .product-button .btn-views:hover {
  background: var(--btn-color-hover-bg)
}

.item_product_main .product-action .product-info .product-button .btn-views.disabled {
  opacity: 0.7
}

.item_product_main .product-action .product-info .product-button .btn-views.disabled:hover {
  background: var(--btn-color-hover-bg)
}

.item_product_main .product-action .product-info .product-button .btn-cart {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 40px;
  height: 34px;
  background: var(--shop-color-surface);
  color: var(--shop-color-main);
  border: 1px solid var(--shop-color-border);
  border-radius: 8px
}

.item_product_main .product-action .product-info .product-button .btn-cart:hover {
  background: var(--btn-color-hover-bg);
  color: var(--btn-color-text)
}

.item_product_main .product-action .product-info .product-button .quick-view {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  position: relative;
  z-index: 1;
  font-size: 0px;
  background-color: transparent !important;
  color: var(--shop-color-text)
}

.item_product_main .product-action .product-info .product-button .quick-view svg {
  width: 24px;
  height: 24px
}

.item_product_main .product-action .product-info .product-button .quick-view svg path {
  fill: var(--shop-color-text)
}

.item_product_main .product-action .product-info .product-button .quick-view:hover svg path {
  fill: var(--shop-color-main)
}

.item_product_main .product-action .product-info .product-button .setCompare {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  position: relative;
  z-index: 1;
  font-size: 0px;
  background-color: transparent !important;
  color: var(--shop-color-text)
}

.item_product_main .product-action .product-info .product-button .setCompare svg {
  width: 28px;
  height: 28px
}

.item_product_main .product-action .product-info .product-button .setCompare svg path {
  fill: var(--shop-color-text)
}

.item_product_main .product-action .product-info .product-button .setCompare:hover svg path {
  fill: #0d6efd
}

.item_product_main .product-action .product-info .product-button .setCompare.active svg path {
  fill: #0d6efd
}

@media (max-width: 991px) {
  .item_product_main .product-action .product-info .product-button {
    padding: 0 7px;
    display: none !important
  }

  .item_product_main .product-action .product-info .product-button button {
    font-size: 1.2rem;
    width: 100%;
    min-width: inherit;
    padding: 0 12px;
    height: 36px
  }

  .item_product_main .product-action .product-info .product-button button svg {
    width: 16px;
    height: 16px;
    display: block
  }
}

.item_product_main .product-action .video_tem {
  justify-content: center;
  align-items: center;
  display: flex;
  position: absolute;
  width: 100%;
  top: 50%;
  left: 50%;
  text-align: center;
  transition: all 0.3s ease-in-out;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease-in-out
}

.item_product_main .product-action .video_tem img {
  max-width: 46px;
  max-height: 46px
}

.item_product_main .product-action .setWishlist {
  position: absolute;
  right: 5px;
  top: 5px;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  font-size: 0px;
  color: #000;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 50%
}

.item_product_main .product-action .setWishlist img {
  width: 18px;
  height: 18px
}

.item_product_main .product-action .setWishlist:hover {
  background: var(--shop-color-main)
}

.item_product_main .product-action .setWishlist:hover:not(.active) img {
  filter: brightness(0)
}

@media (min-width: 1200px) {
  .item_product_main .product-action:hover {
    border: 1px solid var(--shop-color-main)
  }

  .item_product_main .product-action:hover .product-thumbnail .scale_hover .image1 {
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.5s ease 0s
  }

  .item_product_main .product-action:hover .product-thumbnail .scale_hover .image2 {
    opacity: 1;
    overflow: hidden;
    transition: all 0.5s ease 0s;
    visibility: visible;
    transform: translateY(0)
  }

  .item_product_main .product-action:hover .product-info {
    transform: translateY(-60px)
  }
}

@media (max-width: 991px) {
  .item_product_main .product-action .product-info .name-price .product-name {
    font-size: 1.4rem
  }

  .item_product_main .product-action .product-info .name-price .product-price-cart {
    gap: 4px
  }

  .item_product_main .product-action .product-info .name-price .product-price-cart .price {
    font-weight: 700;
    font-size: 1.6rem
  }
}

@media (max-width: 991px) and (max-width: 480px) {
  .item_product_main .product-action .product-info .name-price .product-price-cart .price {
    font-size: 1.4rem
  }
}

@media (max-width: 991px) {
  .item_product_main .product-action .product-info .name-price .product-price-cart .compare-price {
    font-size: 1.2rem
  }
}
