/*
 * ZCRAVE — Mobile First-Tap Navigation Fix (site-wide + carousels)
 */

/* ——— Neutralize hover traps on touch ——— */
@media (hover: none), (pointer: coarse) {
  .hover-reveal,
  .thumb .overlay,
  .product_overlay,
  .products li.product:hover .hover-reveal,
  .products li.product:hover .thumb .overlay,
  .products li.product:hover .product_overlay,
  .products li.product:hover .product_thumbnail:after,
  .products li.product:hover .product_thumbnail:before {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .has-hover:hover,
  .hoverable:hover {
    transform: none !important;
    opacity: 1 !important;
  }
}

/* ——— Main product link should be fast & topmost ——— */
.products li.product .woocommerce-LoopProduct-link,
.products li.product .product_thumbnail > a,
a.woocommerce-LoopProduct-link {
  position: relative;
  z-index: 2;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
  touch-action: manipulation;
}

/* Decorative layers must not steal taps */
.products li.product .thumb .overlay,
.products li.product .product_overlay,
.products li.product .product_thumbnail:after,
.products li.product .product_thumbnail:before {
  pointer-events: none !important;
}

/* Keep micro-actions tappable */
.products li.product .et-quickview-btn,
.products li.product .quick-add,
.products li.product .sizing-guide-open,
.products li.product .size-guide,
.products li.product .wishlist,
.products li.product .yith-wcwl-add-button,
.products li.product .add_to_wishlist,
.products li.product .add_to_cart_button,
.products li.product button,
.products li.product [role="button"] {
  pointer-events: auto !important;
  touch-action: manipulation;
}

/* Avoid nested-link traps */
.products li.product a .inner a { pointer-events: none !important; }

/* General tap improvements */
a, button, [role="button"] { touch-action: manipulation; }

/* Prefer vertical scroll on media areas */
.products li.product .product_thumbnail,
.product-card .media { touch-action: pan-y; }

/* ——— Carousel-specific: make slide links reliably first-tap ——— */
.swiper .swiper-slide a[href],
.slick-slider .slick-slide a[href],
.flickity-enabled .carousel-cell a[href],
.owl-carousel .owl-item a[href],
.flexslider .slides li a[href] {
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Carousels: prevent accidental text selection while swiping */
.swiper .swiper-slide,
.slick-slider .slick-slide,
.flickity-enabled .carousel-cell,
.owl-carousel .owl-item,
.flexslider .slides li {
  -webkit-user-select: none;
  user-select: none;
}

/* If carousels render decorative overlays, don’t let them catch taps */
@media (hover: none), (pointer: coarse) {
  .swiper .swiper-slide .overlay,
  .slick-slider .slick-slide .overlay,
  .flickity-enabled .carousel-cell .overlay,
  .owl-carousel .owl-item .overlay,
  .flexslider .slides li .overlay {
    pointer-events: none !important;
  }
}
