/* Saintngelic Product Card — scoped widget styles */

.elementor-widget-sng_product_card {
  width: 100%;
  max-width: 100%;
}

.elementor-widget-sng_product_card .elementor-widget-container {
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

.elementor-column .elementor-widget-sng_product_card,
.elementor-col .elementor-widget-sng_product_card {
  width: 100%;
}

/* Kartu — aspect-ratio (andalan di tablet/mobile) */
.sng-product-card {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  aspect-ratio: 2 / 3;
  height: auto;
  min-height: 200px;
  background: #000;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Fallback browser lama tanpa aspect-ratio */
@supports not (aspect-ratio: 2 / 3) {
  .sng-product-card {
    height: 0;
    min-height: 0;
    padding-bottom: 150%;
  }
}

.sng-product-card__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.sng-product-card__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  line-height: 0;
  font-size: 0;
}

.sng-product-card__image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  max-width: 100%;
  max-height: 100%;
  transition: opacity 0.6s cubic-bezier(0.12, 0.06, 0.3, 1) 0.05s;
}

.sng-product-card__image--primary {
  opacity: 1;
  z-index: 1;
}

.sng-product-card__image--hover {
  opacity: 0;
  z-index: 2;
}

/* Hover hanya di perangkat dengan mouse (desktop) */
@media (hover: hover) and (pointer: fine) {
  .sng-product-card:hover .sng-product-card__image--primary,
  .sng-product-card__link:hover .sng-product-card__image--primary {
    opacity: 0;
  }

  .sng-product-card:hover .sng-product-card__image--hover,
  .sng-product-card__link:hover .sng-product-card__image--hover {
    opacity: 1;
  }
}

.sng-product-card__badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  background: #250903;
  color: #fff;
  font-family: "Cormorant Garamond", Sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.sng-product-card__wa {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: #250903;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.sng-product-card__wa:hover,
.sng-product-card__wa:focus {
  background: #3d1209;
  color: #fff;
}

.sng-product-card__wa-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Tablet */
@media screen and (max-width: 1024px) {
  .sng-product-card {
    width: 100% !important;
    max-width: 100%;
    height: auto;
    padding-bottom: 0;
    aspect-ratio: 2 / 3;
    min-height: 180px;
  }

  .sng-product-card__badge {
    top: 12px;
    left: 12px;
    font-size: 14px;
    padding: 4px 8px;
  }

  .sng-product-card__wa {
    right: 12px;
    bottom: 12px;
    width: 38px;
    height: 38px;
  }

  .sng-product-card__wa-icon {
    width: 17px;
    height: 17px;
  }
}

/* Mobile */
@media screen and (max-width: 767px) {
  .elementor-widget-sng_product_card .elementor-widget-container {
    padding-left: 0;
    padding-right: 0;
  }

  .sng-product-card {
    width: 100% !important;
    max-width: 100%;
    height: auto;
    padding-bottom: 0;
    aspect-ratio: 2 / 3;
    min-height: 160px;
  }

  .sng-product-card__media,
  .sng-product-card__link {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .sng-product-card__image {
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
  }

  .sng-product-card__badge {
    top: 10px;
    left: 10px;
    font-size: 13px;
  }

  .sng-product-card__wa {
    right: 10px;
    bottom: 10px;
    width: 36px;
    height: 36px;
  }

  .sng-product-card__wa-icon {
    width: 16px;
    height: 16px;
  }
}

/* Mobile kecil */
@media screen and (max-width: 480px) {
  .sng-product-card {
    min-height: 140px;
  }

  .sng-product-card__badge {
    font-size: 12px;
    padding: 4px 7px;
  }
}

/* Loop Grid — kartu produk di e-loop-item (tanpa kaitan ke filter) */
.elementor-loop-container:has(.elementor-widget-sng_product_card),
.elementor-widget-loop-grid:has(.elementor-widget-sng_product_card) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.elementor-loop-container:has(.elementor-widget-sng_product_card) .e-loop-item,
.elementor-widget-loop-grid:has(.elementor-widget-sng_product_card) .e-loop-item {
  min-width: 0;
  max-width: 100%;
}

.elementor-loop-container:has(.elementor-widget-sng_product_card) .elementor-grid-1,
.elementor-widget-loop-grid:has(.elementor-widget-sng_product_card) .elementor-grid-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
}

.elementor-loop-container:has(.elementor-widget-sng_product_card) .elementor-grid-2,
.elementor-widget-loop-grid:has(.elementor-widget-sng_product_card) .elementor-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.elementor-loop-container:has(.elementor-widget-sng_product_card) .elementor-grid-3,
.elementor-widget-loop-grid:has(.elementor-widget-sng_product_card) .elementor-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.elementor-loop-container:has(.elementor-widget-sng_product_card) .elementor-grid-4,
.elementor-widget-loop-grid:has(.elementor-widget-sng_product_card) .elementor-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.elementor-loop-container:has(.elementor-widget-sng_product_card) .elementor-grid-5,
.elementor-widget-loop-grid:has(.elementor-widget-sng_product_card) .elementor-grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
}

.elementor-loop-container:has(.elementor-widget-sng_product_card) .elementor-grid-6,
.elementor-widget-loop-grid:has(.elementor-widget-sng_product_card) .elementor-grid-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
}
