/* ============================================================
   CANNI V8.2.139 — mobile card/search polish
   Confirmed roots:
   - V8.2.39 has higher-specificity !important favorite sizes on Home/Shop.
   - V8.2.58 has its own !important 44px Search favorite.
   - V4 .home-product-img still enforces 4/5 on Home despite V8.2.39's "square" intent.
   - Search input can be configured below 16px, triggering iOS Safari focus zoom.
   - Reviews renderer still outputs REVIEWS / 商品評價 inside the 顧客評價 tab.
   ============================================================ */

/* 1) One compact favorite scale everywhere a catalogue card appears.
   Use stronger final selectors than the historical #homeView/#shopView rules. */
body #homeView .home-product-img-v8239 .favorite-btn,
body #homeView .home-product-img-v8238 .favorite-btn,
body #shopView .product-img .favorite-btn,
body #shopView .v5-card-image .favorite-btn,
body #shopView .v67-card-image .favorite-btn,
body #shopView .favorite-btn.v67-favorite,
body #shopView .product-card-image-v81 .product-card-favorite-v81,
body #productPageV81 .product-related-v81 .product-card-v81 .product-card-favorite-v81,
body #searchResultsV8215 .search-page-image-v8215 .search-favorite-v8258{
  width:32px!important;
  height:32px!important;
  min-width:32px!important;
  min-height:32px!important;
  top:9px!important;
  right:9px!important;
  padding:0!important;
  border-radius:50%!important;
  display:grid!important;
  place-items:center!important;
  font-size:17px!important;
  line-height:1!important;
  box-shadow:0 2px 8px rgba(0,0,0,.05)!important;
}

/* 2) 顧客評價 tab already names the section. Keep only score / count metadata. */
#productPageV81 #productReviewsPanelV827 .product-review-head-v81>div:first-child,
#productPageV81 .product-reviews-section-v81 .product-review-head-v81>div:first-child{
  display:none!important;
}
#productPageV81 #productReviewsPanelV827 .product-review-head-v81,
#productPageV81 .product-reviews-section-v81 .product-review-head-v81{
  justify-content:flex-end!important;
  min-height:0!important;
  margin-bottom:18px!important;
}

/* 3/4/5) Compact Search prompt + iPhone anti-zoom.
   Safari zooms focused form controls whose computed font-size is <16px.
   The 16px floor fixes both the viewport zoom and the apparent image/grid clipping it causes. */
@media(max-width:900px){
  #utilityPageV8215 .search-page-input-v8215{
    gap:9px!important;
    padding:2px 0 8px!important;
    margin-bottom:28px!important;
    min-height:0!important;
  }
  #utilityPageV8215 .search-page-input-v8215 svg{
    width:17px!important;
    height:17px!important;
    min-width:17px!important;
    flex:0 0 17px!important;
    stroke-width:1.7!important;
  }
  #utilityPageV8215 .search-page-input-v8215 input{
    /* User style still controls 16px and above; iOS never receives <16px. */
    font-size:max(16px,var(--canni-search-prompt-size-mobile))!important;
    line-height:1.25!important;
    min-height:0!important;
    height:auto!important;
    padding:2px 0!important;
    margin:0!important;
    -webkit-text-size-adjust:100%!important;
  }
  #utilityPageV8215 .search-page-input-v8215 input::placeholder{
    line-height:1.25!important;
  }

  /* Search cards remain true squares and cannot widen beyond their grid track. */
  #utilityPageV8215 #searchResultsV8215,
  #utilityPageV8215 .search-page-card-v8215,
  #utilityPageV8215 .search-page-image-v8215{
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  #utilityPageV8215 .search-page-image-v8215{
    aspect-ratio:1/1!important;
  }

  /* 1) Mobile heart size — close to the visual weight of the badge. */
  body #homeView .home-product-img-v8239 .favorite-btn,
  body #homeView .home-product-img-v8238 .favorite-btn,
  body #shopView .product-img .favorite-btn,
  body #shopView .v5-card-image .favorite-btn,
  body #shopView .v67-card-image .favorite-btn,
  body #shopView .favorite-btn.v67-favorite,
  body #shopView .product-card-image-v81 .product-card-favorite-v81,
  body #productPageV81 .product-related-v81 .product-card-v81 .product-card-favorite-v81,
  body #searchResultsV8215 .search-page-image-v8215 .search-favorite-v8258{
    width:30px!important;
    height:30px!important;
    min-width:30px!important;
    min-height:30px!important;
    top:8px!important;
    right:8px!important;
    font-size:16px!important;
  }
}

/* 6) Home Recommended / Hot / New use the same square artwork rhythm as related/search cards.
   Historical V4 sets .home-product-img to 4/5, which is why Home stayed rectangular. */
#homeView .home-product-v8239 .home-product-img-v8239,
#homeView .home-product-v8238 .home-product-img-v8238{
  aspect-ratio:1/1!important;
  height:auto!important;
}
#homeView .home-product-v8239 .home-product-img-v8239>img,
#homeView .home-product-v8238 .home-product-img-v8238>img{
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
}
