/* Gando 9.7.16 — Narrow product-card corrections only.
 * Scope: homepage product cards, product-category grids (shoe + care), shop, product search results,
 * and the "انتخاب‌های مرتبط" rail on shoe PDPs.
 * No search popup, PDP gallery, cart, header or other UI is changed.
 */

/* 1) Restore the pre-9.7.14 desktop image-hover motion/swap while keeping
 *    the 9.7.14 centered/contained default image geometry. */
@media (min-width:701px) and (hover:hover) and (pointer:fine) {
  /* Shoe cards — exact pre-9.7.14 hover rhythm used by the card system. */
  .home-product-zone .product-card-v62--shoe.has-alt:hover .product-card__img--primary,
  .tax-product_cat .catalog-grid .product-card-v62--shoe.has-alt:hover .product-card__img--primary,
  .post-type-archive-product .catalog-grid .product-card-v62--shoe.has-alt:hover .product-card__img--primary,
  .search-results-main.gando-catalog-main .catalog-grid .product-card-v62--shoe.has-alt:hover .product-card__img--primary,
  .single-product .pdp-related .product-card-v62--shoe.has-alt:hover .product-card__img--primary {
    opacity:0!important;
    transform:translateY(-38px) scale(.84)!important;
  }

  .home-product-zone .product-card-v62--shoe.has-alt:hover .product-card__img--alt,
  .tax-product_cat .catalog-grid .product-card-v62--shoe.has-alt:hover .product-card__img--alt,
  .post-type-archive-product .catalog-grid .product-card-v62--shoe.has-alt:hover .product-card__img--alt,
  .search-results-main.gando-catalog-main .catalog-grid .product-card-v62--shoe.has-alt:hover .product-card__img--alt,
  .single-product .pdp-related .product-card-v62--shoe.has-alt:hover .product-card__img--alt {
    opacity:1!important;
    transform:translateY(-38px) scale(.84)!important;
  }

  /* Care/accessory cards — restore the original restrained image motion. */
  .home-product-zone .product-card-v62--care:hover .care-product-card__image,
  .tax-product_cat .catalog-grid .product-card-v62--care:hover .care-product-card__image,
  .post-type-archive-product .catalog-grid .product-card-v62--care:hover .care-product-card__image,
  .search-results-main.gando-catalog-main .catalog-grid .product-card-v62--care:hover .care-product-card__image {
    transform:scale(1.025) translateY(-2px)!important;
  }
  .home-product-zone .product-card-v62--care.has-alt:hover .product-card__img--primary,
  .tax-product_cat .catalog-grid .product-card-v62--care.has-alt:hover .product-card__img--primary,
  .post-type-archive-product .catalog-grid .product-card-v62--care.has-alt:hover .product-card__img--primary,
  .search-results-main.gando-catalog-main .catalog-grid .product-card-v62--care.has-alt:hover .product-card__img--primary {
    opacity:0!important;
  }
  .home-product-zone .product-card-v62--care.has-alt:hover .product-card__img--alt,
  .tax-product_cat .catalog-grid .product-card-v62--care.has-alt:hover .product-card__img--alt,
  .post-type-archive-product .catalog-grid .product-card-v62--care.has-alt:hover .product-card__img--alt,
  .search-results-main.gando-catalog-main .catalog-grid .product-card-v62--care.has-alt:hover .product-card__img--alt {
    opacity:1!important;
    transform:scale(1.04)!important;
  }

  /* Before 9.7.14, keyboard focus never swapped to the alternate image. */
  .home-product-zone .product-card-v62--shoe.has-alt:focus-within:not(:hover) .product-card__img--primary,
  .tax-product_cat .catalog-grid .product-card-v62--shoe.has-alt:focus-within:not(:hover) .product-card__img--primary,
  .post-type-archive-product .catalog-grid .product-card-v62--shoe.has-alt:focus-within:not(:hover) .product-card__img--primary,
  .search-results-main.gando-catalog-main .catalog-grid .product-card-v62--shoe.has-alt:focus-within:not(:hover) .product-card__img--primary,
  .single-product .pdp-related .product-card-v62--shoe.has-alt:focus-within:not(:hover) .product-card__img--primary {
    opacity:1!important;
    transform:translateY(-38px) scale(.84)!important;
  }
  .home-product-zone .product-card-v62--shoe.has-alt:focus-within:not(:hover) .product-card__img--alt,
  .tax-product_cat .catalog-grid .product-card-v62--shoe.has-alt:focus-within:not(:hover) .product-card__img--alt,
  .post-type-archive-product .catalog-grid .product-card-v62--shoe.has-alt:focus-within:not(:hover) .product-card__img--alt,
  .search-results-main.gando-catalog-main .catalog-grid .product-card-v62--shoe.has-alt:focus-within:not(:hover) .product-card__img--alt,
  .single-product .pdp-related .product-card-v62--shoe.has-alt:focus-within:not(:hover) .product-card__img--alt {
    opacity:0!important;
    transform:translateY(-38px) scale(.84)!important;
  }
  .home-product-zone .product-card-v62--care.has-alt:focus-within:not(:hover) .product-card__img--primary,
  .tax-product_cat .catalog-grid .product-card-v62--care.has-alt:focus-within:not(:hover) .product-card__img--primary,
  .post-type-archive-product .catalog-grid .product-card-v62--care.has-alt:focus-within:not(:hover) .product-card__img--primary,
  .search-results-main.gando-catalog-main .catalog-grid .product-card-v62--care.has-alt:focus-within:not(:hover) .product-card__img--primary {
    opacity:1!important;
    transform:none!important;
  }
  .home-product-zone .product-card-v62--care.has-alt:focus-within:not(:hover) .product-card__img--alt,
  .tax-product_cat .catalog-grid .product-card-v62--care.has-alt:focus-within:not(:hover) .product-card__img--alt,
  .post-type-archive-product .catalog-grid .product-card-v62--care.has-alt:focus-within:not(:hover) .product-card__img--alt,
  .search-results-main.gando-catalog-main .catalog-grid .product-card-v62--care.has-alt:focus-within:not(:hover) .product-card__img--alt {
    opacity:0!important;
    transform:none!important;
  }
}

/* 2) Variable products that render a real min–max price range need a slightly
 *    smaller card price so the full range stays inside the card. */
.home-product-zone .product-card-v62.has-price-range .product-card-v63__purchase,
.tax-product_cat .catalog-grid .product-card-v62.has-price-range .product-card-v63__purchase,
.single-product .pdp-related .product-card-v62.has-price-range .product-card-v63__purchase {
  min-width:0!important;
  gap:6px!important;
}
.home-product-zone .product-card-v62--shoe.has-price-range .product-card-v63__purchase>div,
.tax-product_cat .catalog-grid .product-card-v62--shoe.has-price-range .product-card-v63__purchase>div,
.single-product .pdp-related .product-card-v62--shoe.has-price-range .product-card-v63__purchase>div {
  min-width:0!important;
  max-width:calc(100% - 20px)!important;
}

.home-product-zone .product-card-v62.has-price-range .product-card-v62__price,
.tax-product_cat .catalog-grid .product-card-v62.has-price-range .product-card-v62__price,
.single-product .pdp-related .product-card-v62.has-price-range .product-card-v62__price {
  min-width:0!important;
  max-width:100%!important;
  display:flex!important;
  align-items:baseline!important;
  flex-wrap:nowrap!important;
  white-space:nowrap!important;
  gap:2px!important;
  line-height:1.2!important;
  letter-spacing:-.02em!important;
}
.home-product-zone .product-card-v62.has-price-range .product-card-v62__price .woocommerce-Price-amount,
.home-product-zone .product-card-v62.has-price-range .product-card-v62__price .amount,
.tax-product_cat .catalog-grid .product-card-v62.has-price-range .product-card-v62__price .woocommerce-Price-amount,
.tax-product_cat .catalog-grid .product-card-v62.has-price-range .product-card-v62__price .amount,
.single-product .pdp-related .product-card-v62.has-price-range .product-card-v62__price .woocommerce-Price-amount,
.single-product .pdp-related .product-card-v62.has-price-range .product-card-v62__price .amount {
  font-size:13px!important;
  line-height:1.2!important;
  font-weight:800!important;
  white-space:nowrap!important;
}
.home-product-zone .product-card-v62.has-price-range .product-card-v62__price .woocommerce-Price-currencySymbol,
.tax-product_cat .catalog-grid .product-card-v62.has-price-range .product-card-v62__price .woocommerce-Price-currencySymbol,
.single-product .pdp-related .product-card-v62.has-price-range .product-card-v62__price .woocommerce-Price-currencySymbol {
  font-size:7px!important;
  margin-inline-start:2px!important;
}

/* 3) Color tooltip arrow must sit behind/below the label, never on top of text. */
.home-product-zone .product-card-v62__color::after,
.tax-product_cat .catalog-grid .product-card-v62__color::after,
.single-product .pdp-related .product-card-v62__color::after {
  z-index:82!important;
  bottom:calc(100% + 12px)!important;
}
.home-product-zone .product-card-v62__color::before,
.tax-product_cat .catalog-grid .product-card-v62__color::before,
.single-product .pdp-related .product-card-v62__color::before {
  z-index:81!important;
  bottom:calc(100% + 5px)!important;
  border-width:5px!important;
}

@media (max-width:700px) {
  .home-product-zone .product-card-v62.has-price-range .product-card-v62__price,
  .tax-product_cat .catalog-grid .product-card-v62.has-price-range .product-card-v62__price,
  .single-product .pdp-related .product-card-v62.has-price-range .product-card-v62__price {
    gap:1px!important;
    letter-spacing:-.035em!important;
  }
  .home-product-zone .product-card-v62.has-price-range .product-card-v62__price .woocommerce-Price-amount,
  .home-product-zone .product-card-v62.has-price-range .product-card-v62__price .amount,
  .tax-product_cat .catalog-grid .product-card-v62.has-price-range .product-card-v62__price .woocommerce-Price-amount,
  .tax-product_cat .catalog-grid .product-card-v62.has-price-range .product-card-v62__price .amount,
  .single-product .pdp-related .product-card-v62.has-price-range .product-card-v62__price .woocommerce-Price-amount,
  .single-product .pdp-related .product-card-v62.has-price-range .product-card-v62__price .amount {
    font-size:10.5px!important;
  }
  .home-product-zone .product-card-v62.has-price-range .product-card-v62__price .woocommerce-Price-currencySymbol,
  .tax-product_cat .catalog-grid .product-card-v62.has-price-range .product-card-v62__price .woocommerce-Price-currencySymbol,
  .single-product .pdp-related .product-card-v62.has-price-range .product-card-v62__price .woocommerce-Price-currencySymbol {
    font-size:5.8px!important;
    margin-inline-start:1px!important;
  }
}
