/**
 * NepalTechHub Phase 19G — final responsive/accessibility hardening.
 * Presentation only. No catalogue, price, seller, history, compare or SEO authority.
 */

html{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}

body.nth-phase19g-final{
  --nth-g-focus:#2457e6;
  --nth-g-focus-ring:rgba(36,87,230,.34);
  --nth-g-sticky-top:86px;
  max-width:100%;
}

body.nth-phase19g-final *,
body.nth-phase19g-final *::before,
body.nth-phase19g-final *::after{
  box-sizing:border-box;
}

/* Prevent grid/flex children and long catalogue strings from forcing page width. */
body.nth-phase19g-final :where(
  main,section,article,aside,header,footer,nav,
  .grid,.nth-grid,.nth-neo-grid,.nth-wrap,.nth-card,.nth-neo-card,
  .nth-cmp,.nth-comparison-table-wrap,.nth-specs,.nth-spec-table,
  .nth-home-snap-rail,.nth-p19d-related-rail,.nth-p19c3-brand-discovery
){
  min-width:0;
}

body.nth-phase19g-final :where(
  h1,h2,h3,h4,h5,h6,p,li,dd,dt,td,th,
  .nth-neo-title,.nth-product-title,.nth-title,.nth-seller-name,
  .nth-p19f-message,.nth-meta,.nth-submeta
){
  overflow-wrap:anywhere;
}

/* Media can never be wider than its owning content surface. */
body.nth-phase19g-final :where(img,svg,video,canvas,iframe){
  max-width:100%;
}
body.nth-phase19g-final :where(img,video,canvas){
  height:auto;
}

/* Anchors should not land under the sticky section/header UI. */
body.nth-phase19g-final :where(
  section[id],article[id],
  #where-to-buy,#nth-e3-price-history,#specifications,#reviews,#comments,
  #nth-catalogue-results,#nthCompareResult
){
  scroll-margin-top:calc(var(--nth-g-sticky-top) + 28px);
}

/* Strong, consistent keyboard focus without changing normal visual hierarchy. */
body.nth-phase19g-final :where(
  a,button,input,select,textarea,summary,[role="button"],[role="tab"],
  [role="option"],[tabindex]
):focus-visible{
  outline:3px solid var(--nth-g-focus-ring) !important;
  outline-offset:3px !important;
  box-shadow:none;
}

/* Skip-link support from GeneratePress/WordPress if present. */
body.nth-phase19g-final .screen-reader-text:focus,
body.nth-phase19g-final .skip-link:focus{
  clip:auto !important;
  clip-path:none !important;
  width:auto !important;
  height:auto !important;
  overflow:visible !important;
  position:fixed !important;
  left:12px !important;
  top:12px !important;
  z-index:100000 !important;
  padding:12px 16px !important;
  border-radius:10px !important;
  background:#fff !important;
  color:#0f172a !important;
  box-shadow:0 10px 32px rgba(15,23,42,.18) !important;
}

/* True interactive controls: comfortable touch targets, not ordinary inline links. */
body.nth-phase19g-final :where(
  .menu-toggle,
  .nth-p19c2-trigger,.nth-p19c2-close,.nth-p19c2-apply,
  .nth-p19c4-pagination a,.nth-p19c4-pagination span,
  .nth-p19d-section-nav a,.nth-sticky a,.nth-sticky button,
  .nth-p19d-spec-toggle,.nth-p19d-spec-all,
  .nth-cmp button,.nth-cmp .button,.nth-cmp [role="tab"],
  .nth-pa-btn,.nth-wishlist-btn
){
  min-height:44px;
}

/* Keep horizontal discovery rails contained; page itself must not scroll sideways. */
body.nth-phase19g-final :where(
  .nth-home-snap-rail,
  .nth-home-editorial-rail,
  .nth-home-brand-rail,
  .nth-p19d-related-rail,
  .nth-p19c3-brand-discovery,
  .nth-p19c4-pagination,
  .nth-p19e-table-scroll,
  .nth-comparison-table-wrap,
  .nth-p19d-section-nav
){
  overscroll-behavior-inline:contain;
  -webkit-overflow-scrolling:touch;
}

/* Tables remain usable at narrow widths and 200% zoom. */
body.nth-phase19g-final :where(.nth-table-wrap,.nth-spec-table-wrap,.nth-comparison-table-wrap){
  max-width:100%;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
}

/* Forms: avoid iOS zoom and make long option/search content resilient. */
@media(max-width:768px){
  body.nth-phase19g-final :where(input,select,textarea){
    font-size:16px !important;
  }

  body.nth-phase19g-final{
    --nth-g-sticky-top:74px;
  }

  body.admin-bar.nth-phase19g-final{
    --nth-g-sticky-top:120px;
  }
}

/* Very narrow phones: let control rows wrap instead of clipping. */
@media(max-width:360px){
  body.nth-phase19g-final :where(
    .nth-action-row,.nth-actions,.nth-hero-actions,
    .nth-p19c4-discovery-actions,.nth-p19d-spec-toolbar,
    .nth-cmp-actions,.nth-compare-actions,.nth-empty-links
  ){
    flex-wrap:wrap !important;
  }

  body.nth-phase19g-final :where(
    .nth-action-row > *,.nth-actions > *,.nth-hero-actions > *,
    .nth-p19d-spec-toolbar > *
  ){
    min-width:0;
  }
}

/* Landscape phones: keep sticky buying UI useful without dominating the viewport. */
@media(max-width:900px) and (max-height:520px) and (orientation:landscape){
  body.nth-phase19g-final .nth-sticky{
    padding-top:6px !important;
    padding-bottom:max(6px,env(safe-area-inset-bottom)) !important;
  }
  body.nth-phase19g-final .nth-p19d-section-nav{
    position:relative !important;
    top:auto !important;
  }
}

/* Preserve meaning in Windows/high-contrast mode. */
@media(forced-colors:active){
  body.nth-phase19g-final :where(
    button,.button,[role="button"],input,select,textarea,
    .nth-neo-card,.nth-empty,.nth-p19f-message,
    .nth-p19d-spec-group,.nth-cmp-card
  ){
    forced-color-adjust:auto;
    border:1px solid CanvasText !important;
  }

  body.nth-phase19g-final :where(a,button,[role="button"]):focus-visible{
    outline:3px solid Highlight !important;
  }
}

/* Never make motion mandatory for comprehension. */
@media(prefers-reduced-motion:reduce){
  body.nth-phase19g-final *,
  body.nth-phase19g-final *::before,
  body.nth-phase19g-final *::after{
    scroll-behavior:auto !important;
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.01ms !important;
  }
}

/* Printing should exclude interaction-only floating layers. */
@media print{
  body.nth-phase19g-final :where(
    .nth-sticky,.nth-p19d-section-nav,.nth-p19e-mobile-tray,
    .nth-p19c2-trigger,.nth-p19c2-sheet,.nth-p19c4-load-status
  ){
    display:none !important;
  }
}
