/*
 * Trinity36 V49.6 — focused systems repair
 * Loaded after V49.4. Keeps essential phone controls on-screen, preserves
 * comfortable content clearance above the fixed navigation, and leaves the
 * approved desktop header and visual system unchanged.
 */

body.trinity-storefront
  :is(#cardCatalog, .tri-home-product, .tri-related-products, .tri-search-vial, .tri-detail-vial, #membershipCardsGrid)
  .exact-vial-name:is(.medium-name, .long-name, .xlong-name) {
  --v31-vial-name-left: 13%;
  --v31-vial-name-right: 13%;
  width: auto !important;
}

body.trinity-storefront
  .membership-package-vials
  .membership-component-vial
  .exact-vial-name:is(.medium-name, .long-name, .xlong-name) {
  left: 13% !important;
  right: 13% !important;
  width: auto !important;
}

@media (max-width: 700px) {
  body.trinity-storefront {
    padding-bottom: calc(104px + env(safe-area-inset-bottom)) !important;
    scroll-padding-bottom: calc(104px + env(safe-area-inset-bottom));
  }

  #trinityImageHeader .trinity-v35-actions {
    box-sizing: border-box !important;
    width: calc(100% - 28px) !important;
    max-width: calc(100% - 28px) !important;
    min-height: 62px !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    overflow: hidden !important;
    padding: 0 4px !important;
    margin-inline: auto !important;
  }

  #trinityImageHeader .trinity-v35-actions > :nth-child(3),
  #trinityImageHeader .trinity-v35-actions > :nth-child(4),
  #trinityImageHeader .trinity-v35-actions > :nth-child(5),
  #trinityImageHeader .trinity-v35-actions > :nth-child(6) {
    display: none !important;
  }

  #trinityImageHeader .trinity-v35-search-wrap,
  #trinityImageHeader .trinity-v35-bubble {
    box-sizing: border-box !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 60px !important;
    flex: 1 1 20% !important;
    scroll-snap-align: none !important;
  }

  #trinityImageHeader .trinity-v35-search-wrap,
  #trinityImageHeader #openCartButton,
  #trinityImageHeader #menuToggle {
    display: flex !important;
  }

  #trinityImageHeader .trinity-v35-actions > a[href*="#catalog"],
  #trinityImageHeader .trinity-v35-actions > .theme-toggle,
  #trinityImageHeader #openCartButton,
  #trinityImageHeader #menuToggle {
    height: 60px !important;
    min-height: 60px !important;
    padding: 0 6px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  #trinityImageHeader .trinity-v35-search {
    width: 100% !important;
    min-width: 0 !important;
  }

  #trinityImageHeader .advanced-research-search.search-active {
    position: fixed !important;
    inset: 0 0 auto 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    transform: none !important;
  }

  .trinity-v49-4-header-actions {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 62px !important;
    display: flex !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    gap: 0 !important;
    overflow: hidden !important;
    padding: 0 4px !important;
  }

  .trinity-v49-4-header-actions > :nth-child(3),
  .trinity-v49-4-header-actions > :nth-child(4),
  .trinity-v49-4-header-actions > :nth-child(6) {
    display: none !important;
  }

  .trinity-v49-4-bubble {
    box-sizing: border-box !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 60px !important;
    flex: 1 1 20% !important;
    scroll-snap-align: none !important;
  }

  #cardCatalog,
  .catalog-section,
  .tri-product-page,
  .tv49-portal {
    scroll-padding-bottom: calc(104px + env(safe-area-inset-bottom));
  }

  #cardCatalog > *,
  .product-card,
  .catalog-card,
  .membership-product-card,
  .tri-product-buy {
    scroll-margin-bottom: calc(104px + env(safe-area-inset-bottom));
  }
}
