/**
 * Mobile touch audit — fixes hover-stick, targets, stacking, RTL (giftstore.co.il)
 */

/* ── A: Reset sticky :hover on touch devices ── */
@media (hover: none) {
  .pc:hover,
  .cat-tile:hover,
  a.trust-chip:hover,
  .marq-track:hover,
  .co-ship-tile:hover,
  .co-pay-card:hover,
  .pp-color:hover,
  .pp-size:hover,
  .pp-tab:hover,
  .pp-thumb:hover,
  .pmi-zoom:hover,
  .blog-card:hover,
  .hero-cta:hover,
  .sec-h .more:hover,
  .editorial a:hover,
  .cart-btn:hover,
  .cart-btn.alt:hover,
  .cart-xs-add:hover,
  .search-cats a:hover,
  .mm-list > a:hover,
  .cookie .accept:hover,
  .btt:hover,
  .dr-close:hover,
  .cart-row .rm:hover,
  .cart-qty button:hover,
  .compare-bar__link:hover,
  .compare-bar__clear:hover,
  .cmp-prod-head .cmp-name:hover,
  .cmp-remove:hover,
  .qv-modal .qv-close:hover,
  .cat-filters-btn:hover,
  .pp-buynow:hover,
  .pp-wa-ask:hover,
  .pp-share a:hover,
  .ft-soc a:hover,
  .anno-arr:hover,
  .tb-view:hover,
  .filters-tab:hover,
  .hero-arrow:hover,
  .tm-arrow:hover,
  .pc-quick:hover,
  .pc-quick-add:hover,
  .pc-compare:hover,
  .gift-wrap-opt:hover {
    transform: none !important;
    box-shadow: none !important;
  }

  .pc:hover {
    border-color: var(--line) !important;
  }

  .cat-tile:hover .cat-tile-emoji,
  .cat-tile:hover h3 {
    transform: none !important;
    color: inherit !important;
    box-shadow: none !important;
  }

  .marq-track:hover {
    animation-play-state: running !important;
  }

  .co-ship-tile:hover,
  .co-pay-card:hover {
    border-color: var(--line) !important;
    background: #fff !important;
  }

  .co-ship-opt input:checked + .co-ship-tile:hover,
  .co-pay-opt input:checked + .co-pay-card:hover {
    border-color: var(--teal-2) !important;
    background: #e8f7f5 !important;
  }

  .pc:hover .pc-arr {
    opacity: 0.78 !important;
  }

  .pc:hover .pc-compare,
  .pc-compare.is-on,
  .pc-compare:focus-visible {
    opacity: 1 !important;
  }

  .pc-quick-add {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ── B: Touch targets (min 44px) ── */
@media (max-width: 980px) {
  .pc-swatch {
    width: 28px;
    height: 28px;
    min-width: 28px;
    padding: 6px;
    box-sizing: content-box;
  }

  .pc-dot {
    width: 10px;
    height: 10px;
    padding: 12px;
    box-sizing: content-box;
    background-clip: content-box;
  }

  .pc-arr {
    width: 44px;
    height: 44px;
    opacity: 0.85 !important;
  }

  .pc-compare {
    width: 44px;
    height: 44px;
    opacity: 1 !important;
  }

  .pc-quick {
    width: 44px;
    height: 44px;
    opacity: 1 !important;
  }

  .cart-row .rm {
    min-height: 44px;
    padding: 10px 14px;
  }

  .cart-qty button {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }

  .anno-arr {
    width: 44px;
    height: 44px;
  }

  .tb-view {
    width: 44px;
    height: 44px;
  }

  .dr-close {
    width: 44px;
    height: 44px;
  }

  #welcome-modal button[aria-label="סגור"] {
    width: 44px !important;
    height: 44px !important;
  }

  #cart-coupon,
  #cart-coupon + button,
  .cart-foot input[type="text"],
  .cart-foot button {
    min-height: 44px !important;
    height: 44px !important;
  }

  .co-sum-rm {
    min-height: 44px !important;
    padding: 10px 14px !important;
  }

  .filters-tab {
    min-width: 44px;
    padding: 14px 12px;
  }

  .ft-soc a {
    width: 44px;
    height: 44px;
  }

  .qv-modal .qv-close {
    width: 44px;
    height: 44px;
  }

  .compare-bar__clear {
    min-height: 44px;
    padding: 10px 16px;
  }
}

/* ── C: Scroll / drawer ── */
@media (max-width: 980px) {
  html[dir="rtl"] .cart-d {
    left: auto;
    right: 0;
    transform: translateX(100%);
    box-shadow: -6px 0 32px rgba(14, 22, 38, 0.16);
  }

  html[dir="rtl"] .cart-d.is-open {
    transform: translateX(0);
  }

  #cart-foot {
    position: sticky;
    bottom: 0;
    z-index: 4;
    box-shadow: 0 -8px 20px rgba(14, 22, 38, 0.08);
  }

  .co-grid {
    display: flex;
    flex-direction: column;
  }

  .co-grid > aside {
    order: -1;
    margin-bottom: 18px;
  }

  .cat-side .cat-filter-form {
    overflow-y: visible;
    max-height: none;
  }

  body.search-open #ovl-search {
    display: none;
  }

  .search-o.is-open {
    background: #fff;
  }
}

/* ── D: RTL ── */
@media (max-width: 980px) {
  .tb-sort-select {
    background-position: left 12px center;
    padding-inline-start: 14px;
    padding-inline-end: 36px;
  }

  .pc-swatch::after {
    inset-inline-start: 50%;
    transform: translateX(50%);
  }
}

/* ── E: Z-index / bottom stack ── */
.compare-bar {
  z-index: 68;
}

.co-mobile-bar {
  z-index: 72;
}

.pp-sticky-atc.is-visible,
.pp-mobile-bar.is-visible {
  z-index: 66;
}

.btt.is-on {
  bottom: calc(148px + env(safe-area-inset-bottom));
  z-index: 54;
}

#recent-purchase {
  bottom: calc(90px + env(safe-area-inset-bottom)) !important;
  z-index: 53;
}

body.has-compare-bar {
  padding-bottom: calc(56px + env(safe-area-inset-bottom));
}

body.has-compare-bar.pp-has-sticky-atc {
  padding-bottom: calc(128px + env(safe-area-inset-bottom));
}

body.has-compare-bar.co-mobile-checkout {
  padding-bottom: calc(132px + env(safe-area-inset-bottom));
}

body.has-compare-bar.cookie-visible {
  padding-bottom: calc(144px + env(safe-area-inset-bottom));
}

/* ── F: Tap / link polish ── */
.pc-link,
.pc-name a,
.co-ship-opt,
.co-pay-opt,
.cart-swipe-action {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.pc-name a::after {
  content: "";
  position: absolute;
  inset: -4px 0;
}

/* ── G: Gallery touch-action ── */
@media (max-width: 980px) {
  .pp-main-img {
    touch-action: pan-x pan-y pinch-zoom;
  }

  .lb-stage {
    touch-action: pan-x pan-y pinch-zoom;
  }
}
