/* =========================================================
   🧩 PRODUCT & RELATED PRODUCTS SLIDER — UNIFIED STYLE
========================================================= */

.product-slider-section {
  background-image: url(../../images/section-bg-1.svg);
  background-position-y: top;
  background-position-x: center;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  background-size: contain;
  background-repeat: no-repeat;
}

/* Sve klase primeni i na related sekciju */
.product-slider-section,
.related-products-slider {
  padding: 40px 0;
  max-width: var(--page-width);
  margin: 0 auto;
  overflow: hidden;
}

.product-slider,
.related-swiper {
  position: relative;
  width: 100%;
  overflow: visible;
}

.product-slider .swiper-wrapper,
.related-swiper .swiper-wrapper {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.product-slider .swiper-slide,
.related-swiper .swiper-slide {
  flex-shrink: 0;
  width: calc((100% - (3 * 24px)) / 4);
  margin-right: 24px;
  display: flex;
  justify-content: center;
  box-sizing: border-box;
}

.product-slider .swiper-slide:last-child,
.related-swiper .swiper-slide:last-child {
  margin-right: 0 !important;
}

/* Responsive grid */
@media (max-width: 1024px) {
  .product-slider .swiper-slide,
  .related-swiper .swiper-slide {
    width: calc((100% - (2 * 24px)) / 3);
  }
}
@media (max-width: 768px) {
  .product-slider .swiper-slide,
  .related-swiper .swiper-slide {
    width: calc((100% - 24px) / 2);
  }
}
@media (max-width: 640px) {
  .product-slider .swiper-slide,
  .related-swiper .swiper-slide {
    width: 100%;
    margin-right: 0;
  }
}

/* -----------------------------
🔹 Product Card
----------------------------- */
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  width: 100%;
  max-width: 320px;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  padding: 15px;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.1);
}

/* Klikabilan overlay (ispod dugmadi i wishlist-a) */
.product-overlay-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
}

/* Wishlist dugme */
.product-card .wishlist-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  transition: all 0.25s ease;
  pointer-events: auto;
}

.product-card .wishlist-btn:hover {
  background: #ffe6ed;
  transform: scale(1.1);
}

.product-card .wishlist-btn * {
  position: relative;
  z-index: 26;
}

/* Tinv Wishlist */
.product-thumb .tinvwl_add_to_wishlist_button {
  background: none;
  border: none;
  padding: 0;
  line-height: 1;
}

.product-thumb .tinvwl-icon {
  font-size: 18px;
  color: #c03060;
  transition: color 0.3s;
}

.product-thumb .tinvwl-icon:hover {
  color: #a91c4d;
}

/* Thumbnail wrapper */
.product-slider .product-thumb,
.related-swiper .product-thumb {
  width: 100%;
  height: 320px;
  overflow: hidden;
  border-radius: 12px;
  position: relative;
}

/* =========================================================
   🖼 HOVER SISTEM ZA DVE SLIKE
========================================================= */

.product-thumb {
  position: relative;
  overflow: hidden;
  z-index: 20;
}

/* Osnovna pravila za obe slike */
.product-thumb .img-main,
.product-thumb .img-hover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.35s ease;
}

/* Start stanja */
.product-thumb .img-main {
  opacity: 1;
}
.product-thumb .img-hover {
  opacity: 0;
  pointer-events: none;
}

/* Hover radi samo ako postoji klasa .has-hover */
.product-thumb.has-hover:hover .img-main {
  opacity: 0;
}
.product-thumb.has-hover:hover .img-hover {
  opacity: 1;
}

/* Badge */
.discount-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent-berry);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  z-index: 20;
}

/* Info */
.product-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 12px 0 6px;
  text-align: center;
  color: var(--color-dark);
}

.product-price {
  text-align: center;
}

.product-price del {
  color: #999;
  text-decoration: line-through;
  margin-right: 5px;
}

.product-price ins {
  color: var(--accent-berry);
  font-weight: 700;
  text-decoration: none;
}

/* =========================================================
   🔧 UNIFIED TYPOGRAPHY — TITLE & PRICE
========================================================= */

.product-title {
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  color: var(--color-dark);
  margin: 14px 0 6px;
  line-height: 1.4;
}

.product-price,
.product-card .price {
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 12px;
  color: var(--color-dark);
}

.product-price ins,
.product-card .price ins {
  color: var(--accent-berry);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
}

.product-price del,
.product-card .price del {
  color: #999;
  font-size: 0.9rem;
  margin-right: 6px;
  text-decoration: line-through;
}

.product-price .woocommerce-Price-amount,
.product-card .price .woocommerce-Price-amount {
  font-weight: inherit;
  font-size: inherit;
}

.product-price .woocommerce-Price-currencySymbol {
  font-size: 0.9em;
  opacity: 0.9;
}

/* Rating */
.product-rating {
  text-align: center;
  margin-top: 4px;
  margin-bottom: 6px;
  margin-left: auto;
  margin-right: auto;
}

/* CTA dugmad */
.product-buttons {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  position: relative;
  z-index: 20;
}

.btn-details {
  flex: 1;
  background: #fff;
  border: 1px solid #7e4e62;
  padding: 10px;
  text-align: center;
  border-radius: 12px;
  font-size: 13px;
}

.btn-details:hover {
  background: #7a3451;
  color: #fff;
}

.btn-add-to-cart {
  flex: 1;
  background: #7e4e62;
  color: #fff;
  border-radius: 12px;
  padding: 10px;
  border: none;
  cursor: pointer;
  text-align: center;
  font-size: 13px;
}

.btn-add-to-cart:hover {
  background: #7a3451;
}

/* Hide Woo "View cart" mini link */
.added_to_cart.wc-forward {
  display: none !important;
}

/* Navigation */
.swiper-button-prev,
.swiper-button-next {
  color: #333;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  pointer-events: all;
  transition: background 0.3s, color 0.3s;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
  background: #fff;
  color: #c72b77;
}

.swiper-button-prev::after,
.swiper-button-next::after {
  font-size: 18px;
}

/* Pagination */
.swiper-pagination {
  margin-top: 20px;
  position: relative;
  text-align: center;
}

.swiper-pagination-bullet {
  background: #ccc;
  opacity: 1;
}

.swiper-pagination-bullet-active {
  background: #c72b77;
}

/* Recently viewed naslov */
.recently-viewed .section-title {
  text-align: center;
  margin-bottom: 40px;
}

@media (max-width: 768px) {
  .product-slider-section,
  .related-products-slider {
    padding: 0;
  }
}

/*  ------------------------------- */

.product-thumb .img-main,
.product-thumb .img-hover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease, opacity 0.3s ease;
}

.product-thumb .img-main {
  transform: translateX(0);
  opacity: 1;
}

.product-thumb .img-hover {
  transform: translateX(20%);
  opacity: 0;
}

.product-card:hover .product-thumb.has-hover .img-main {
  transform: translateX(-20%);
  opacity: 0;
}

.product-card:hover .product-thumb.has-hover .img-hover {
  transform: translateX(0);
  opacity: 1;
}

/* =========================================================
   📱 MOBILNI SWIPE — unutar kartice proizvoda
========================================================= */

.thumb-swiper {
  width: 100%;
  height: 100%;
}

.thumb-swiper .swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 12px;
}

/* pagination za mobilni slider — suptilna tačkica */
.thumb-swiper .swiper-pagination {
  position: absolute;
  bottom: 6px;
  z-index: 10;
}

.thumb-swiper .swiper-pagination-bullet {
  background: rgba(255, 255, 255, 0.7);
  opacity: 1;
  width: 6px;
  height: 6px;
}

.thumb-swiper .swiper-pagination-bullet-active {
  background: var(--accent-berry);
}

/* ----------------------------------*/

/* =========================================================
   🎥 YOUTUBE-STYLE PRODUCT CARD HOVER
   ========================================================= */

.product-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Zoom slike na hover */
.product-card:hover .product-thumb img {
  transform: scale(1.07);
}

/* Dodaj lagani dark overlay */
.product-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.35s ease;
  z-index: 5;
  pointer-events: none;
}

.product-card:hover::after {
  background: rgba(243, 226, 219, 0.7); /* YouTube efekt */
}

/* Animacija slike */
.product-thumb img {
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.35s ease;
}

/* Fade-in dodatnog sadržaja (kao YouTube tekst) */
.product-card .product-buttons,
.product-card .wishlist-btn {
  transition: transform 0.35s ease, opacity 0.35s ease;
  transform: translateY(6px);
  opacity: 0;
}

.product-card:hover .product-buttons,
.product-card:hover .wishlist-btn {
  transform: translateY(0);
  opacity: 1;
}
