/* Mobile product photo enhancement. Load LAST after products-unified.css.
   Presentation only: original pixels, links, variants and purchase controls stay intact.
   Embedded whitespace in the source is deliberately retained (no crop or distortion). */
@media (max-width: 650px) {
  /* Give the detail gallery a true portrait-sized stage instead of a 320px cap. */
  body.az-products-unified .v21-detail-photo,
  body.az-products-unified .v21-detail-photo:has(.az-accessory-wa) {
    padding: 50px 6px 12px;
  }
  body.az-products-unified .v21-detail-main {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    max-width: 100%;
    max-height: none;
    object-fit: contain !important;
    object-position: center;
    clip-path: none !important;
    transform: none !important;
    padding: 0;
  }
  /* A separate upper toolbar protects the WA mark and zoom action. */
  body.az-products-unified .v21-detail-photo .v21-detail-zoom-open {
    top: 8px;
    inset-inline-end: 10px;
    min-height: 36px;
    max-width: calc(100% - 74px);
  }
  body.az-products-unified .v21-detail-photo img.az-accessory-wa {
    inset-block-start: 9px !important;
    inset-inline-start: 10px !important;
    width: 32px !important;
    height: 32px !important;
  }
  body.az-products-unified :is(.v21-detail-thumbs, .store-product-thumbs) {
    gap: 7px;
  }
  body.az-products-unified .v21-detail-thumb {
    width: 49px;
    height: 49px;
  }
  /* Related/home PRODUCT rails, not the homepage category artworks. */
  body:is(.az-products-unified,[data-page="home"]) .az-discovery-track {
    grid-auto-columns: minmax(0, 92%);
    gap: 12px;
  }
  body:is(.az-products-unified,[data-page="home"]) .az-discovery-photo {
    aspect-ratio: 1 / 1;
    padding: 42px 6px 8px;
    box-sizing: border-box;
  }
  body:is(.az-products-unified,[data-page="home"]) .az-discovery-photo > img:not(.az-accessory-wa) {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain !important;
    object-position: center;
    clip-path: none !important;
    transform: none !important;
  }
  /* Undo the old Nutrex side mask everywhere, including thumbnails and zoom.
     If the source contains screenshot UI it remains visible: replace the SOURCE
     with an approved clean photo, never hide label/packaging pixels with CSS. */
  body.az-products-unified img[src*="nutrex-creatine-300g-"] {
    clip-path: none !important;
  }
}
@media (max-width: 480px) {
  /* One generous image/card per phone row; tablet two-column rules are untouched. */
  body.az-products-unified :is(.v21-item-grid, .store-products) {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
  body.az-products-unified :is(.v21-item-photo, .store-photo) {
    display: flex;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: 1 / 1;
    padding: 38px 6px 30px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
  }
  body.az-products-unified :is(.v21-item-photo > img:not(.az-accessory-wa), .store-photo-img) {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain !important;
    object-position: center;
    clip-path: none !important;
    transform: none !important;
    padding: 0;
    mix-blend-mode: normal;
  }
  body.az-products-unified .store-photo-panel {
    padding: 0 0 56px;
  }
  body.az-products-unified .store-product-thumb {
    width: 40px;
    height: 42px;
  }
  body.az-products-unified :is(.v21-item-body, .store-product-info) {
    padding: 16px;
    gap: 10px;
  }
  body.az-products-unified :is(.v21-item-body h3, .store-product-title) {
    font-size: 17px;
    min-height: 0;
  }
  body.az-products-unified .store-product-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
