.product_layout {
  position: relative;
  margin: 10px 5px;
  /* horizontal 5+5 = gap efektif ~10px antar kartu */
  width: fit-content;
  background-color: #fff;
  padding-bottom: 15px;
  isolation: isolate;
  /* Isolasi paint: slide kartu A tidak merepaint/kedipkan indikator kartu B */
  contain: layout paint;
}

.product_layout.dark {
  background-color: #000;
}

.product_layout .product_title {
  width: fit-content;
  font-size: 1rem;
}

.product_price {
  display: flex;
  flex-wrap: nowrap;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

/* .reg_price {
  font-family: var(--neuzeit-reg-font);
  font-variant-numeric: tabular-nums;
  font-size: var(--font-size-md);
} */

.reg_price_discount {
  margin-right: 10px;
  color: var(--font_abu);
  font-size: calc(var(--font-size-md) - 0.1em);
  font-variant-numeric: tabular-nums;
}

.sale_price,
.reg_price {
  color: var(--dark_purple);
  font-family: var(--neuzeit-reg-font);
  font-variant-numeric: tabular-nums;
  font-size: calc(var(--font-size-xl) - 0.1em);
  margin-top: 2px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
}

.product_sold {
  font-size: 0.9rem;
  color: var(--font_abu);
  display: flex;
  width: 100%;
  justify-content: space-between;
}

.product_sold.dark {
  color: #fff;
}

.discount_percentage,
.label_new,
.label_out_of_stock {
  position: absolute;
  padding: 5px 12px;
  font-size: var(--font-size-sm);
  font-family: var(--neuzeit-light-font);
  z-index: 20;
  font-weight: 600;
  pointer-events: none;
  letter-spacing: 1px;
}

.discount_percentage {
  top: 15px;
  right: 15px;
  background-color: var(--au_color);
  color: var(--dark_purple);
}

.label_new {
  top: 15px;
  left: 15px;
}

.discount_percentage.dark {
  color: #000;
}

.product_images.blur::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #00000014;
  z-index: 4;
  pointer-events: none;
}

.product_images.blur img {
  filter: grayscale(100%);
}

.label_new.dark {
  color: var(--bg_black);
}

.label_out_of_stock {
  top: 15px;
  left: 15px;
  background-color: #ffc4e3;
  padding: 5px 12px;
  pointer-events: none;
}

.product_images {
  position: relative;
  width: 500px;
  height: 500px;
  cursor: pointer;
  contain: paint;
  overflow: hidden;
}

.product_images img {
  position: absolute;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Slider Styles */
.slider_container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.slider_wrapper {
  display: flex;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  cursor: grab;
}

.slider_wrapper_catalog {
  touch-action: pan-y pinch-zoom;
}

.slider_wrapper:active {
  cursor: grabbing;
}

.slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  cursor: inherit;
  touch-action: pan-y pinch-zoom;
}

.slide_image_placeholder,
.slide_video_placeholder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: #f0f0f0;
}

.slider_wrapper_catalog .slide {
  touch-action: inherit;
}

.slide_image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}

.dots_container {
  position: absolute;
  bottom: 0px;
  left: 0;
  right: 0;
  width: 100%;
  display: flex;
  gap: 0;
  z-index: 15;
  background-color: #fff;
}

.product_layout.dark .dots_container {
  background-color: #000;
}

.dot {
  flex: 1;
  height: 5px;
  border-radius: 0;
  background-color: #d4cce8;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease;
  padding: 0;
}

.dot:hover {
  background-color: var(--bg_purple);
}

.active_dot {
  background-color: var(--bg_purple);
  border: none;
}

.coming_soon {
  color: var(--red_color);
  font-size: 1rem;
  font-family: var(--neuzeit-light-font);
  font-style: italic;
  margin-bottom: 10px;
}

video.product_video_thumbnail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 10;
}

.img_1 {
  z-index: 1;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    margin-top: 5px;
  }

  to {
    opacity: 1;
    margin-top: 0;
  }
}

.img_2 {
  display: none;
  z-index: 0;
}

.hovered {
  animation: fadeIn 0.3s ease-in-out;
}

.product_detail_section {
  padding: 0 10px;
  display: flex;
  justify-content: space-between;
}

.product_detail {
  width: 100%;
}

.product_wishlist {
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--au_color);
  background-color: transparent;
  align-self: center;
  display: flex;
  margin-top: 2px;
}

/** css for product catalog */
.product_layout.catalog {
  margin: 15px 0px 0px 0px;
  width: 100% !important;
  max-width: 100%;
  box-sizing: border-box;
}

.product_layout.catalog .product_images {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1;
  overflow: hidden;
}

/** css for product full slider — isi slide penuh seperti all-jewelries */

.product_layout.full_slider {
  margin: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.product_layout.full_slider .product_images {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1;
  overflow: hidden;
}

.product_layout.full_slider .product_detail_section {
  min-height: 4.5rem;
}

.product_layout.full_slider .product_title {
  margin-top: 0px;
  font-size: var(--font-size-md);
}

.product_layout.full_slider .product_price {
  font-size: 0.9rem;
  margin: 5px 0px;
}

.product_layout.full_slider .product_sold {
  font-size: 0.7rem;
}

.product_layout.full_slider .discount_percentage {
  top: 10px;
  right: 10px;
  padding: 5px 15px;
  font-size: var(--font-size-sm);
}

.product_layout.full_slider .label_new {
  top: 10px;
  right: 10px;
  font-size: var(--font-size-sm);
}

.product_layout.full_slider .label_out_of_stock {
  top: 5px;
  left: 5px;
  font-size: 0.8rem;
}

.list_colors {
  display: flex;
}

.color_item {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid #c1c1c1;
  margin-left: 6px;
  margin-right: 2px;
  cursor: pointer;
  position: relative;
}

.color_item.selected {
  outline: 1px solid #888888;
  outline-offset: 3px;
}

.dark .color_item.selected {
  border: 3px solid #666;
}

.product_title_content {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-top: 10px;
  align-items: center;
}

.product_price_content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  gap: 8px;
  min-width: 0;
}

.product_price_content .product_price {
  flex: 1 1 auto;
  width: auto;
  margin: 5px 0px;
}

.product_price_content .list_colors {
  flex: 0 0 auto;
}

.whislist_container {
  height: 28vw;
  width: 0;
  position: absolute;
  top: 0;
  right: 0;
  z-index: 30;
}

.product_whislist {
  display: flex;
  background-color: white;
  cursor: pointer;
  height: 15px;
}

.title_content {
  display: flex;
  justify-content: space-between;
  padding: 10px 0px 5px 0px;
}

.product_whislist.dark {
  color: #000;
}

.remove_product_whislist {
  position: absolute;
  bottom: 0;
  right: 0;
  height: 3vw;
  width: 3vw;
  background-color: rgba(221, 221, 221, 0.438);
  z-index: 2;
  cursor: pointer;
}

.remove_product_whislist_icon {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  width: 100%;
  color: white;
}

.remove_product_whislist_hover,
.remove_product_whislist_icon:hover {
  background-color: rgba(0, 0, 0, 0.555);
}

.product_images_container {
  position: relative;
  /* Stacking context: video z-index di dalamnya tidak boleh mengalahkan badge di luar */
  z-index: 1;
}

.full_slider_add_to_bag_container,
.add_to_bag_container {
  position: absolute;
  bottom: 0px;
  right: 0px;
  cursor: pointer;
  width: 50px;
  height: 50px;
  z-index: 1;
}

.add_to_bag {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: 20px;
  height: 20px;
}

.add_to_bag_image {
  width: 18px;
  height: 18px;
}

/* Customize add_to_bag ketika berada di dalam full slider dan slick-list */
:global(.slick-list) .product_layout.full_slider .add_to_bag {
  bottom: 10px;
  right: 10px;
}

:global(.slick-list) .product_layout.full_slider .add_to_bag .add_to_bag_image {
  width: 16px;
  height: 16px;
}

/** BREAKPOINT */
@media only screen and (max-width: 1300px) {
  .product_sold {
    flex-direction: column;
    width: fit-content;
  }

  .color_item.selected {
    padding: 1px;
  }

  .dark .color_item.selected {
    border: 2px solid #666;
  }
}

@media only screen and (min-width: 1600px) {
  .product_images {
    width: 550px;
    height: 550px;
  }
}

@media only screen and (min-width: 1024px) and (max-width: 1300px) {
  .product_layout.full_slider .product_title {
    font-size: 0.9rem;
  }

  .product_images {
    width: 340px !important;
    height: 340px !important;
  }

  .product_price_content {
    margin-top: 5px;
  }

  .product_count_content {
    display: block;
    position: relative;
  }

  .product_detail_section {
    padding: 0px 5px;
  }

  .list_colors {
    align-self: center;
  }

}

/* Fold / lebar 651–767: hanya samakan ukuran kartu + foto (hindari 500×500) */
@media (min-width: 651px) and (max-width: 767px) {
  .product_layout:not(.catalog) {
    width: calc(50vw - 20px) !important;
  }

  .product_layout:not(.catalog) .product_images {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1;
    overflow: hidden;
  }

  .product_layout.full_slider {
    width: 100% !important;
    max-width: 100%;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {

  .product_layout:not(.catalog) {
    width: calc(50vw - 20px) !important;
  }

  /* Samakan dengan all jewelries (.catalog): jangan pakai 500×500 fixed */
  .product_layout:not(.catalog) .product_images {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1;
    overflow: hidden;
  }

  .sale_price,
  .reg_price,
  .coming_soon {
    font-size: calc(2.8vw + 0.1em);
    margin: 3px 0px;
  }

  .product_layout.full_slider {
    width: 100% !important;
  }

  .product_layout.full_slider .product_images {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1;
  }

  .product_price_content {
    margin: 5px 0px;
  }

  .product_layout.catalog {
    width: 100% !important;
    max-width: 100%;
    margin: 15px 0px 0px 0px;
  }

  .product_layout.catalog .product_images {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1;
    overflow: hidden;
    clip-path: inset(0 1px);
  }

  .product_layout.catalog .slider_container {
    overflow: hidden;
    clip-path: inset(0 1px);
    max-width: 100%;
    height: 100%;
  }

  .product_layout.catalog .slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .product_layout.full_slider .discount_percentage {
    right: 20px;
    padding: 3px 7px;
  }

  .product_count_content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
  }

  .product_detail_section {
    width: 100%;
  }

  .list_colors {
    margin-top: 5px;
  }

  .product_price {
    margin: 5px 0px;
  }

  .discount_percentage,
  .label_new,
  .label_out_of_stock {
    top: 10px;
    right: 10px;
  }

}

@media only screen and (max-width: 650px) {
  .product_layout:not(.catalog) {
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    width: calc(50vw - 15px) !important;
  }

  .product_layout.full_slider {
    width: 100% !important;
    max-width: 100%;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
  }

  .product_layout.catalog {
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    width: 100% !important;
    max-width: 100%;
  }

  .product_layout:not(.catalog) .product_images {
    width: calc(50vw) !important;
    height: calc(50vw) !important;
  }

  .product_layout.full_slider .product_images {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1;
  }

  /* Customize add_to_bag ketika berada di dalam full slider dan slick-list */
  :global(.slick-list) .product_layout.full_slider .add_to_bag {
    bottom: 10px;
    right: 25px;
  }

  :global(.slick-list) .product_layout.full_slider .add_to_bag .add_to_bag_image {
    width: 15px;
    height: 15px;
  }

  .full_slider_add_to_bag_container {
    width: 30px;
    height: 30px;
  }

  .add_to_bag_container {
    width: 30px;
    height: 30px;
    bottom: 5px;
    right: 5px;
  }

  .product_count_content {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .add_to_bag {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .add_to_bag_image {
    width: 15px;
    height: 15px;
    margin: auto 0;
  }

  .dot,
  .active_dot {
    height: 4px;
  }

  .product_layout.catalog .product_images {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1;
  }

  .product_layout.full_slider .product_title,
  .product_layout .product_title {
    margin: 0px;
    font-size: calc(2.2vw + 0.2em);
  }


  .product_layout.full_slider .product_detail_section {
    padding: 0px 5px;
    width: 100%;
  }

  .product_layout.full_slider .product_wishlist {
    align-self: flex-start;
  }

  .product_title_content {
    margin-top: 5px;
  }

  .product_layout.full_slider .discount_percentage {
    right: 5px;
    padding: 2px 7px;
    font-size: var(--font-size-xs);
  }

  .reg_price_discount {
    font-size: calc(var(--font-size-sm) - 0.1em);
    margin-right: 5px;
  }

  .coming_soon {
    font-size: var(--font-size-md);
    margin: 5px 0px;
    font-family: var(--neuzeit-reg-font);
  }

  .product_sold {
    font-size: 0.7rem;
  }

  .discount_percentage {
    top: 5px;
    right: 5px;
    padding: 3px 5px;
    font-size: var(--font-size-xs);
    letter-spacing: 0.5px;
  }

  .label_out_of_stock {
    top: 5px;
    left: 5px;
    padding: 3px 5px;
    font-size: 0.7rem;
  }

  .product_layout.full_slider .label_new {
    top: 5px;
    left: 5px;
    font-size: var(--font-size-xs);
  }

  .label_new {
    top: 5px;
    left: 5px;
    font-size: var(--font-size-xs);
  }

  .whislist_container {
    height: 234px;
  }

  .product_detail_section {
    padding: 0px 5px;
    width: 100%;
  }

  .color_item {
    width: 10px;
    height: 10px;
    margin-left: 4px;
  }

  .list_colors {
    margin-top: unset;
  }

  .color_item.selected {
    outline-offset: 2px;
  }

  .remove_product_whislist {
    height: 6vw;
    width: 6vw;
  }

  .product_wishlist {
    align-self: flex-start;
  }
}

/* Mobile + tablet: font harga mengikuti lebar kartu (color list sudah terpisah) */
@media only screen and (max-width: 1023px) {
  .product_price {
    container-type: inline-size;
    container-name: product-price;
  }

  .product_count_content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
  }

  .sale_price,
  .reg_price {
    font-size: clamp(0.93rem, 9cqi, 1.3rem);
  }

}