/* Advance Nutrition mobile product detail adjustments — 2026-09-27.
 * Intended destination: Advance Nutrition's own /ecom-custom/custom.css.
 * Page guard: existing .productDetailHeader, observed on product detail pages.
 * Modern browsers supporting :has(); no HTML or JS changes required.
 */
@media (max-width: 600px) {
  /* 1. Compact the existing store banner. */
  :is(body:has(.productDetailHeader),html[data-an-hydrate="scs_detail.htm"] body) .services_hero .hero_text {
    padding: 12px 16px;
  }
  :is(body:has(.productDetailHeader),html[data-an-hydrate="scs_detail.htm"] body) .services_hero .sectionHeader {
    font-size: 24px;
    line-height: 1.25;
  }
  :is(body:has(.productDetailHeader),html[data-an-hydrate="scs_detail.htm"] body) .services_hero .sectionSubHeader {
    margin: 8px 0 0;
    line-height: 1.4;
  }

  /* 2. Trim search/cart spacing, keeping usable touch targets. */
  :is(body:has(.productDetailHeader),html[data-an-hydrate="scs_detail.htm"] body) .container.compliment {
    padding: 12px 0;
  }
  :is(body:has(.productDetailHeader),html[data-an-hydrate="scs_detail.htm"] body) #searchform {
    display: flex;
    gap: 6px;
    align-items: stretch;
  }
  :is(body:has(.productDetailHeader),html[data-an-hydrate="scs_detail.htm"] body) #search {
    flex: 1;
    min-width: 0;
    width: auto;
    height: 44px;
    box-sizing: border-box;
    padding: 8px 10px 8px 42px;
    background-size: 28px 28px;
    background-position: 8px center;
    font-size: 16px;
  }
  :is(body:has(.productDetailHeader),html[data-an-hydrate="scs_detail.htm"] body) #searchbtn {
    width: 52px;
    min-height: 44px;
    box-sizing: border-box;
    margin: 0;
    padding: 8px;
    font-size: 16px;
  }
  :is(body:has(.productDetailHeader),html[data-an-hydrate="scs_detail.htm"] body) .cart {
    margin-top: 10px;
  }
  :is(body:has(.productDetailHeader),html[data-an-hydrate="scs_detail.htm"] body) .cart a {
    min-height: 44px;
    box-sizing: border-box;
    padding: 12px 14px;
    font-size: 16px;
    line-height: 20px;
  }

  /* 3. Preserve two columns while preventing image overflow. */
  :is(body:has(.productDetailHeader),html[data-an-hydrate="scs_detail.htm"] body) .detail_page_container {
    display: grid;
    grid-template-columns: minmax(0, 40%) minmax(0, 1fr);
    gap: 12px;
    align-items: start;
  }
  :is(body:has(.productDetailHeader),html[data-an-hydrate="scs_detail.htm"] body) .detail_page_container::before,
  :is(body:has(.productDetailHeader),html[data-an-hydrate="scs_detail.htm"] body) .detail_page_container::after {
    display: none;
  }
  :is(body:has(.productDetailHeader),html[data-an-hydrate="scs_detail.htm"] body) .detail_page_container > .sp-wrap {
    width: auto;
    min-width: 0;
    float: none;
    margin: 0;
  }
  :is(body:has(.productDetailHeader),html[data-an-hydrate="scs_detail.htm"] body) .productDetailImage {
    max-width: 100% !important;
    width: auto !important;
    height: auto;
    max-height: 180px;
    box-sizing: border-box;
    margin: 0 auto;
  }
  :is(body:has(.productDetailHeader),html[data-an-hydrate="scs_detail.htm"] body) .detail_page_info {
    width: auto;
    min-width: 0;
    float: none;
    padding: 0;
  }

  /* 4. Compact the purchase controls, without shrinking tap targets. */
  :is(body:has(.productDetailHeader),html[data-an-hydrate="scs_detail.htm"] body) .detail_page_price_reduced {
    margin-bottom: 10px;
  }
  :is(body:has(.productDetailHeader),html[data-an-hydrate="scs_detail.htm"] body) input.scsQty {
    width: 60px;
    height: 44px;
    box-sizing: border-box;
    padding: 8px;
    font-size: 16px;
  }
  :is(body:has(.productDetailHeader),html[data-an-hydrate="scs_detail.htm"] body) .detail_page_cta input {
    min-height: 44px;
    padding: 10px 8px !important;
    font-size: 16px;
    margin: 10px 0;
  }
  :is(body:has(.productDetailHeader),html[data-an-hydrate="scs_detail.htm"] body) .detail_page_info .stock {
    margin: 10px 0 12px;
  }
}
