/*
 * NepalTechHub — Phase 28A Navigation + Homepage Hero UX polish
 * 2026-09-08
 *
 * Goals:
 * - clarify primary navigation hierarchy without changing destinations;
 * - keep desktop navigation on one deliberate baseline;
 * - make mobile navigation easier to scan/tap and prevent horizontal overflow;
 * - make homepage search the dominant above-the-fold action;
 * - visually demote secondary hero actions/rotating copy;
 * - preserve the evidence-backed Recently verified pulse as a compact trust surface;
 * - no catalogue, Price Truth, affiliate, commerce, schema or admin mutations.
 */

/* --------------------------------------------------------------------------
 * 1. Global navigation hierarchy
 * ----------------------------------------------------------------------- */
@media (min-width: 901px) {
  .site-header .inside-header,
  .main-navigation .inside-navigation {
    min-width: 0;
  }

  .main-navigation .inside-navigation {
    min-height: 62px;
    display: flex;
    align-items: center;
  }

  .main-navigation .main-nav {
    min-width: 0;
    flex: 1 1 auto;
  }

  .main-navigation .main-nav > ul,
  .main-navigation ul#primary-menu {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 2px;
    min-width: 0;
  }

  .main-navigation .main-nav > ul > li > a,
  .main-navigation ul#primary-menu > li > a {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: 10px;
    padding: 0 12px !important;
    font-weight: 700;
    letter-spacing: -0.01em;
  }

  .main-navigation .main-nav > ul > li:not(.current-menu-item):not(.current_page_item) > a:hover,
  .main-navigation ul#primary-menu > li:not(.current-menu-item):not(.current_page_item) > a:hover {
    background: #f8fafc;
  }

  .main-navigation .current-menu-item > a,
  .main-navigation .current_page_item > a {
    background: #eff6ff;
  }

  .main-navigation .nth-mega-trigger {
    min-height: 44px;
    padding-inline: 14px !important;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    font-weight: 800;
  }

  .main-navigation .nth-header-search-li {
    flex: 1 1 270px;
    max-width: 380px;
    min-width: 220px;
    margin-left: auto;
    padding-left: 16px;
  }

  .main-navigation .nth-header-search,
  .main-navigation .nth-hsearch-wrap {
    width: 100%;
    min-width: 0;
  }

  .main-navigation .nth-hsearch-input {
    min-height: 42px;
    border-radius: 999px !important;
    border-color: #cbd5e1 !important;
    background: #f8fafc !important;
    padding-inline: 15px 42px !important;
    font-size: 14px;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
  }

  .main-navigation .nth-hsearch-input:hover {
    background: #fff !important;
    border-color: #94a3b8 !important;
  }

  .main-navigation .nth-hsearch-input:focus {
    background: #fff !important;
    border-color: var(--brand, #1d4ed8) !important;
    box-shadow: 0 0 0 3px rgba(29, 78, 216, .10) !important;
  }
}

/* Mid-size laptops: retain one clean row instead of wrapping nav into a second
 * pseudo-header. Search is allowed to contract before labels become cramped. */
@media (min-width: 901px) and (max-width: 1180px) {
  .main-navigation .main-nav > ul > li > a,
  .main-navigation ul#primary-menu > li > a {
    padding-inline: 9px !important;
    font-size: 13.5px;
  }

  .main-navigation .nth-header-search-li {
    flex-basis: 210px;
    min-width: 180px;
    padding-left: 10px;
  }
}

/* Dropdowns: stronger information separation, quieter than a modal. */
@media (min-width: 769px) {
  .main-navigation ul ul,
  .main-navigation .sub-menu {
    padding: 8px;
    border-radius: 14px;
    border-color: #dbe3ee;
    box-shadow: 0 18px 42px -18px rgba(15, 23, 42, .28),
                0 8px 18px -14px rgba(15, 23, 42, .16);
  }

  .main-navigation ul ul li a,
  .main-navigation .sub-menu li a {
    min-height: 40px;
    display: flex;
    align-items: center;
    line-height: 1.35;
  }
}

/* --------------------------------------------------------------------------
 * 2. Mobile navigation: scanability, tap size, overflow safety
 * ----------------------------------------------------------------------- */
@media (max-width: 900px) {
  .site-header,
  .main-navigation,
  .main-navigation .inside-navigation,
  .main-navigation .main-nav,
  .main-navigation .main-nav > ul,
  .main-navigation ul#primary-menu {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .main-navigation .menu-toggle {
    min-width: 46px;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px !important;
    border-radius: 12px !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: none !important;
  }

  .main-navigation.toggled .main-nav,
  .main-navigation .main-nav.toggled {
    width: 100%;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 16px 32px -24px rgba(15, 23, 42, .28);
    padding: 8px 12px 14px;
  }

  .main-navigation .main-nav > ul,
  .main-navigation ul#primary-menu {
    width: 100%;
    display: block;
    overflow: visible;
  }

  .main-navigation .main-nav > ul > li,
  .main-navigation ul#primary-menu > li {
    width: 100%;
    margin: 0;
  }

  .main-navigation .main-nav > ul > li > a,
  .main-navigation ul#primary-menu > li > a {
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 10px 12px !important;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 750;
    line-height: 1.35;
  }

  .main-navigation .main-nav > ul > li > a:hover,
  .main-navigation .main-nav > ul > li > a:focus-visible,
  .main-navigation .current-menu-item > a,
  .main-navigation .current_page_item > a {
    background: #f8fafc;
  }

  .main-navigation .nth-mega-trigger {
    background: #eff6ff;
    border: 1px solid #dbeafe;
  }

  .main-navigation .sub-menu,
  .main-navigation ul ul {
    margin: 2px 0 8px;
    padding: 4px 0 4px 12px;
    background: #f8fafc;
    border-left: 2px solid #dbeafe;
  }

  .main-navigation .sub-menu li a,
  .main-navigation ul ul li a {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 8px 11px !important;
    font-size: 14px;
    line-height: 1.35;
  }

  .main-navigation .nth-header-search-li {
    width: 100%;
    margin: 4px 0 8px;
    padding: 0;
    border: 0;
  }

  .main-navigation .nth-header-search,
  .main-navigation .nth-hsearch-wrap {
    width: 100%;
  }

  .main-navigation .nth-hsearch-input {
    width: 100% !important;
    min-height: 46px;
    border-radius: 12px !important;
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    font-size: 16px; /* avoids iOS focus zoom */
  }

  .main-navigation .menu-item-nth-login > a,
  .main-navigation .menu-item-nth-account > a {
    width: calc(100% - 8px);
    margin: 8px 4px 2px;
    min-height: 46px;
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
 * 3. Homepage hero: search-first decision hierarchy
 * ----------------------------------------------------------------------- */
body.home #nth-home .nth-hero {
  isolation: isolate;
  padding: clamp(24px, 3vw, 42px);
  border-radius: 24px;
  border-color: #dbe3ee;
  background:
    radial-gradient(circle at 88% 10%, rgba(37, 99, 235, .10), transparent 35%),
    linear-gradient(135deg, #ffffff 0%, #f8fbff 58%, #f4f8ff 100%);
  box-shadow: 0 24px 60px -46px rgba(15, 23, 42, .42);
}

body.home #nth-home .nth-hero::before {
  opacity: .7;
}

body.home #nth-home .nth-hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}

body.home #nth-home .nth-hero-layout.has-pulse {
  grid-template-columns: minmax(0, 1.38fr) minmax(285px, .62fr);
}

body.home #nth-home .nth-hero-main,
body.home #nth-home .nth-hero-text,
body.home #nth-home .nth-hero-pulse {
  min-width: 0;
}

body.home #nth-home .nth-hero-text {
  max-width: 780px;
}

body.home #nth-home .nth-hero-eyebrow {
  min-height: 28px;
  margin-bottom: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(239, 246, 255, .92);
  border: 1px solid #dbeafe;
  color: #1e40af;
  text-transform: none;
  letter-spacing: .01em;
  font-size: 12px;
  line-height: 1.3;
}

body.home #nth-home .nth-hero h1 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: clamp(2rem, 3.4vw, 3.25rem);
  line-height: 1.06;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

body.home #nth-home .nth-hero-text > p:not(.nth-hero-eyebrow) {
  max-width: 720px;
  color: #475569;
  font-size: clamp(14.5px, 1.25vw, 16.5px);
  line-height: 1.7;
}

/* The rotating value line is supporting context, not a competing CTA. */
body.home #nth-home .nth-hero-rotator {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 32px;
  margin-top: 13px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(248, 250, 252, .78);
  border: 1px solid rgba(226, 232, 240, .9);
  color: #475569;
  font-size: 12.5px;
  line-height: 1.35;
}

body.home #nth-home .nth-hero-rotator-static {
  color: #334155;
  font-weight: 800;
}

body.home #nth-home .nth-hero-rotator-text {
  color: #64748b;
  font-weight: 650;
}

body.home #nth-home .nth-hero-rotator-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, .10);
}

/* Search becomes the dominant interaction. */
body.home #nth-home .nth-search-form {
  max-width: 790px;
  margin-top: 22px;
  padding: 6px;
  gap: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 34px -24px rgba(15, 23, 42, .42);
}

body.home #nth-home .nth-search-wrap-home {
  min-width: 0;
}

body.home #nth-home .nth-search-form .nth-search-input {
  min-height: 50px;
  padding-inline: 15px;
  border: 0 !important;
  border-radius: 12px !important;
  background: transparent;
  box-shadow: none !important;
  font-size: 16px;
}

body.home #nth-home .nth-search-form .nth-search-input:focus {
  box-shadow: none !important;
}

body.home #nth-home .nth-search-btn {
  min-height: 50px;
  min-width: 112px;
  padding-inline: 22px;
  border-radius: 12px !important;
  background: #1d4ed8 !important;
  box-shadow: 0 8px 18px -12px rgba(29, 78, 216, .7) !important;
}

body.home #nth-home .nth-search-btn:hover,
body.home #nth-home .nth-search-btn:focus-visible {
  background: #1e40af !important;
}

/* Secondary hero actions stay easy to find without competing with Search. */
body.home #nth-home .nth-hero-actions {
  gap: 9px;
  margin-top: 14px;
}

body.home #nth-home .nth-hero-cta {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-decoration: none;
  transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

body.home #nth-home .nth-hero-cta.is-primary {
  color: #1e3a8a;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

body.home #nth-home .nth-hero-cta.is-secondary {
  color: #334155;
  background: rgba(255, 255, 255, .78);
  border: 1px solid #e2e8f0;
}

body.home #nth-home .nth-hero-cta:hover,
body.home #nth-home .nth-hero-cta:focus-visible {
  transform: translateY(-1px);
  border-color: #93c5fd;
  background: #fff;
  color: #1d4ed8;
}

/* Evidence pulse: compact trust proof rather than a second hero. */
body.home #nth-home .nth-hero-pulse {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  padding: 17px;
  border: 1px solid #dbe3ee;
  border-radius: 18px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 14px 34px -28px rgba(15, 23, 42, .40);
}

body.home #nth-home .nth-hero-pulse-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding-bottom: 11px;
  border-bottom: 1px solid #eef2f7;
}

body.home #nth-home .nth-pulse-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #166534;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .045em;
}

body.home #nth-home .nth-hero-pulse-head > strong {
  color: #0f172a;
  font-size: 16px;
  line-height: 1.25;
}

body.home #nth-home .nth-hero-pulse-head > span:last-child {
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}

body.home #nth-home .nth-hero-pulse-list {
  display: grid;
  gap: 3px;
  padding-block: 6px;
}

body.home #nth-home .nth-hero-pulse-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 11px;
  color: inherit;
  text-decoration: none;
}

body.home #nth-home .nth-hero-pulse-item:hover,
body.home #nth-home .nth-hero-pulse-item:focus-visible {
  background: #f8fafc;
}

body.home #nth-home .nth-hero-pulse-item img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid #eef2f7;
  background: #fff;
}

body.home #nth-home .nth-hero-pulse-copy,
body.home #nth-home .nth-hero-pulse-meta {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 5px;
}

body.home #nth-home .nth-hero-pulse-copy {
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
}

body.home #nth-home .nth-hero-pulse-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #1e293b;
  font-size: 12.5px;
  font-weight: 750;
}

body.home #nth-home .nth-hero-pulse-meta {
  color: #64748b;
  font-size: 11.5px;
}

body.home #nth-home .nth-hero-pulse-meta strong {
  color: #047857;
  font-size: 12px;
}

body.home #nth-home .nth-hero-pulse-link {
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px solid #eef2f7;
  color: #1d4ed8;
  font-size: 11.5px;
  font-weight: 800;
  text-decoration: none;
}

/* --------------------------------------------------------------------------
 * 4. Responsive hero behavior
 * ----------------------------------------------------------------------- */
@media (max-width: 980px) {
  body.home #nth-home .nth-hero-layout.has-pulse {
    grid-template-columns: minmax(0, 1fr);
  }

  body.home #nth-home .nth-hero-pulse-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.home #nth-home .nth-hero-pulse-link {
    margin-top: 4px;
  }
}

@media (max-width: 640px) {
  body.home #nth-home .nth-hero {
    padding: 20px 15px 16px;
    border-radius: 18px;
  }

  body.home #nth-home .nth-hero h1 {
    font-size: clamp(1.85rem, 9vw, 2.35rem);
    line-height: 1.08;
  }

  body.home #nth-home .nth-hero-eyebrow {
    display: flex;
    width: fit-content;
    max-width: 100%;
    font-size: 11px;
  }

  body.home #nth-home .nth-hero-rotator {
    width: 100%;
    box-sizing: border-box;
  }

  body.home #nth-home .nth-search-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 5px;
    border-radius: 15px;
  }

  body.home #nth-home .nth-search-btn {
    width: 100%;
  }

  body.home #nth-home .nth-hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.home #nth-home .nth-hero-cta {
    min-width: 0;
    padding-inline: 10px;
    text-align: center;
  }

  body.home #nth-home .nth-hero-pulse {
    padding: 14px;
  }

  body.home #nth-home .nth-hero-pulse-list {
    grid-template-columns: minmax(0, 1fr);
  }

  body.home #nth-home .nth-hero-pulse-item:nth-child(n+3) {
    display: none;
  }
}

@media (max-width: 390px) {
  body.home #nth-home .nth-hero-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --------------------------------------------------------------------------
 * 5. Accessibility and motion
 * ----------------------------------------------------------------------- */
.main-navigation a:focus-visible,
.main-navigation button:focus-visible,
body.home #nth-home .nth-hero a:focus-visible,
body.home #nth-home .nth-hero button:focus-visible,
body.home #nth-home .nth-hero input:focus-visible {
  outline: 3px solid rgba(37, 99, 235, .28) !important;
  outline-offset: 2px !important;
}

@media (prefers-reduced-motion: reduce) {
  .main-navigation *,
  body.home #nth-home .nth-hero * {
    transition: none !important;
    animation: none !important;
  }
}

/* --------------------------------------------------------------------------
 * 6. Phase 28A.1 live desktop smoke corrections
 * -----------------------------------------------------------------------
 * Evidence from the 1366px Windows/Chrome smoke test showed two presentation
 * regressions that were not visible in the source-only review:
 *
 * 1) GeneratePress' sticky-navigation state could inherit a washed-out link /
 *    placeholder colour while the fixed bar itself stayed white, making the
 *    primary links almost disappear during scroll.
 * 2) The shared 4:3 product media well made the Latest Phones grid consume too
 *    much vertical space at common laptop/desktop widths.  The product images
 *    themselves are not cropped; the desktop-only media well is simply made
 *    shallower and keeps object-fit:contain.
 *
 * These remain presentation-only changes.  No product query, card truth state,
 * CTA destination, price, seller, affiliate or Commerce behaviour is changed.
 */
@media (min-width: 901px) {
  .main-navigation,
  .main-navigation.navigation-stick,
  .main-navigation.navigation-clone,
  .main-navigation.is_stuck,
  #sticky-navigation.main-navigation {
    background: rgba(255, 255, 255, .98) !important;
    color: #0f172a !important;
  }

  /* Keep ordinary primary links readable in both the normal and cloned/sticky
   * navigation bars. Account actions intentionally retain their existing
   * white-on-brand treatment. */
  .main-navigation .main-nav > ul > li:not(.menu-item-nth-login):not(.menu-item-nth-account) > a,
  .main-navigation ul#primary-menu > li:not(.menu-item-nth-login):not(.menu-item-nth-account) > a {
    color: #0f172a !important;
    opacity: 1 !important;
  }

  .main-navigation .nth-mega-trigger {
    color: #1d4ed8 !important;
  }

  .main-navigation .nth-hsearch-input {
    color: #0f172a !important;
    opacity: 1 !important;
  }

  .main-navigation .nth-hsearch-input::placeholder {
    color: #64748b !important;
    opacity: 1 !important;
  }

  .main-navigation.navigation-stick .inside-navigation,
  .main-navigation.navigation-clone .inside-navigation,
  .main-navigation.is_stuck .inside-navigation,
  #sticky-navigation.main-navigation .inside-navigation {
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 10px 28px -26px rgba(15, 23, 42, .42);
  }
}

/* Common 1024–1440px desktop/laptop screens: keep four-column card width, but
 * stop phone photography from dominating the viewport.  A bounded explicit
 * height is preferable here to a wider aspect-ratio override because it stays
 * visually stable as the shell width changes. */
@media (min-width: 992px) {
  body.home #nth-home section[aria-labelledby="nth-latest-phones-title"] .nth-prod-grid {
    gap: 14px;
  }

  body.home #nth-home section[aria-labelledby="nth-latest-phones-title"] .nth-card-img {
    aspect-ratio: auto;
    height: clamp(158px, 12.5vw, 176px);
    padding: 7px 9px;
    box-sizing: border-box;
    background: #fff;
    border-bottom: 1px solid #eef2f7;
  }

  body.home #nth-home section[aria-labelledby="nth-latest-phones-title"] .nth-card-img img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
  }
}

/* --------------------------------------------------------------------------
 * 7. Phase 28A.2 — 1366×768 desktop density + sticky stacking correction
 * -----------------------------------------------------------------------
 * The second live smoke pass confirms the page is structurally correct but is
 * still too vertically generous for the most common Nepal laptop viewport:
 * 1366×768.  The browser chrome leaves roughly 600px of actual page viewport,
 * so 4 wide cards plus tall section spacing makes the catalogue feel zoomed-in
 * even at 100% browser zoom.
 *
 * This pass deliberately changes only desktop presentation. Mobile/tablet
 * breakpoints remain untouched. Product queries, order, prices, trust state,
 * affiliate routing, schema and Commerce state remain unchanged.
 */
@media (min-width: 1180px) {
  /* Bring the custom/GeneratePress sticky layer above any translucent header
   * clone. The live screenshots showed the links physically present but washed
   * out behind the white header surface. */
  .main-navigation.navigation-stick,
  .main-navigation.navigation-clone,
  .main-navigation.is_stuck,
  #sticky-navigation.main-navigation {
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
    mix-blend-mode: normal !important;
    z-index: 10020 !important;
    isolation: isolate;
  }

  .main-navigation.navigation-stick .inside-navigation,
  .main-navigation.navigation-clone .inside-navigation,
  .main-navigation.is_stuck .inside-navigation,
  #sticky-navigation.main-navigation .inside-navigation,
  .main-navigation.navigation-stick .main-nav,
  .main-navigation.navigation-clone .main-nav,
  .main-navigation.is_stuck .main-nav,
  #sticky-navigation.main-navigation .main-nav {
    opacity: 1 !important;
    visibility: visible !important;
    filter: none !important;
    background: rgba(255,255,255,.985) !important;
  }

  /* Denser section rhythm. Keep headings comfortably readable, but remove the
   * large dead zones that made each section consume most of one laptop screen. */
  body.home #nth-home .nth-section {
    margin-top: 28px;
  }

  body.home #nth-home .nth-section-head {
    gap: 10px;
    margin-bottom: 7px;
  }

  body.home #nth-home .nth-section-title {
    font-size: clamp(23px, 1.8vw, 27px);
    line-height: 1.16;
    letter-spacing: -0.025em;
  }

  body.home #nth-home .nth-home-section-intro {
    margin-top: 0;
    margin-bottom: 13px;
    font-size: 13px;
    line-height: 1.45;
  }

  /* Hero: preserve all information and the evidence pulse, but fit the complete
   * search decision surface into materially less vertical space. */
  body.home #nth-home .nth-hero {
    padding: 27px 40px 25px;
  }

  body.home #nth-home .nth-hero-layout {
    gap: 18px;
  }

  body.home #nth-home .nth-hero h1 {
    max-width: 700px;
    margin-bottom: 8px;
    font-size: clamp(2.18rem, 3vw, 2.78rem);
    line-height: 1.05;
  }

  body.home #nth-home .nth-hero-text > p:not(.nth-hero-eyebrow) {
    max-width: 700px;
    font-size: 14.5px;
    line-height: 1.55;
  }

  body.home #nth-home .nth-hero-eyebrow {
    min-height: 25px;
    margin-bottom: 9px;
    padding: 4px 9px;
    font-size: 11.5px;
  }

  body.home #nth-home .nth-hero-rotator {
    min-height: 28px;
    margin-top: 9px;
    padding: 5px 9px;
    font-size: 12px;
  }

  body.home #nth-home .nth-hero-actions {
    margin-top: 10px;
  }

  body.home #nth-home .nth-hero-cta {
    min-height: 39px;
    padding: 7px 12px;
    font-size: 12.5px;
  }

  body.home #nth-home .nth-search-form {
    margin-top: 14px;
    padding: 4px;
    border-radius: 15px;
  }

  body.home #nth-home .nth-search-form .nth-search-input,
  body.home #nth-home .nth-search-btn {
    min-height: 44px;
  }

  body.home #nth-home .nth-search-btn {
    min-width: 104px;
    padding-inline: 18px;
  }

  body.home #nth-home .nth-hero-pulse {
    padding: 13px;
    border-radius: 16px;
  }

  body.home #nth-home .nth-hero-pulse-head {
    padding-bottom: 8px;
  }

  body.home #nth-home .nth-hero-pulse-list {
    gap: 2px;
    padding-block: 4px;
  }

  body.home #nth-home .nth-hero-pulse-item {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 8px;
    padding: 6px;
  }

  body.home #nth-home .nth-hero-pulse-item img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }

  body.home #nth-home .nth-hero-pulse-link {
    padding-top: 7px;
  }

  /* Category discovery: keep all 12 categories visible at once without making
   * the category block feel like another hero. */
  body.home #nth-home .nth-home-explore .nth-cat-nav {
    gap: 9px;
  }

  body.home #nth-home .nth-home-explore .nth-cat-item {
    min-height: 70px;
    padding: 9px 7px;
  }

  body.home #nth-home .nth-home-explore .nth-cat-icon {
    width: 34px;
    height: 34px;
  }

  body.home #nth-home .nth-home-explore .nth-cat-icon svg {
    width: 17px;
    height: 17px;
  }

  body.home #nth-home .nth-home-explore .nth-cat-label {
    font-size: 11px;
    line-height: 1.25;
  }

  body.home #nth-home .nth-home-explore .nth-stats-bar {
    margin-top: 10px;
  }

  body.home #nth-home .nth-home-explore .nth-stat-item {
    padding: 12px 9px;
  }

  body.home #nth-home .nth-home-explore .nth-stat-num {
    font-size: 23px;
    line-height: 1;
  }

  body.home #nth-home .nth-home-explore .nth-stat-label {
    font-size: 10.5px;
  }

  /* Decision tools were correctly structured but had the same generous desktop
   * padding as touch-first surfaces. */
  body.home #nth-home .nth-home-tools {
    gap: 10px;
  }

  body.home #nth-home .nth-home-tool {
    padding: 12px 13px;
  }

  body.home #nth-home .nth-home-tool-copy strong {
    font-size: 13px;
  }

  body.home #nth-home .nth-home-tool-copy span {
    font-size: 11.5px;
    line-height: 1.35;
  }

  /* Phone controls and cards: reduce chrome around the actual buying data. */
  body.home #nth-home .nth-home-phone-controls {
    margin-bottom: 10px;
    padding: 8px 10px;
  }

  body.home #nth-home .nth-price-chips {
    gap: 6px;
  }

  body.home #nth-home .nth-chip {
    padding: 7px 10px;
    font-size: 11.5px;
    line-height: 1.2;
  }

  body.home #nth-home .nth-sort-select {
    min-height: 37px;
    padding-block: 7px;
    font-size: 12px;
  }

  body.home #nth-home section[aria-labelledby="nth-latest-phones-title"] .nth-prod-card {
    border-radius: 13px;
  }

  body.home #nth-home section[aria-labelledby="nth-latest-phones-title"] .nth-card-img {
    height: 142px;
    padding: 5px 7px;
  }

  body.home #nth-home section[aria-labelledby="nth-latest-phones-title"] .nth-card-body {
    padding: 10px 11px 9px;
  }

  body.home #nth-home section[aria-labelledby="nth-latest-phones-title"] .nth-card-name {
    font-size: 13.5px;
    line-height: 1.25;
  }

  body.home #nth-home section[aria-labelledby="nth-latest-phones-title"] .nth-card-price {
    font-size: 17px;
    line-height: 1.2;
  }

  /* The Top-3 rail intentionally remains three columns, but its photography no
   * longer needs a 4:3 desktop billboard. */
  body.home #nth-home .nth-home-trending .nth-card-img {
    aspect-ratio: auto;
    height: 148px;
    padding: 5px 7px;
    box-sizing: border-box;
  }

  /* Mixed-category sampler intentionally remains four items per group (one per
   * represented category). Compact the media/body rather than creating empty or
   * semantically misleading fifth columns. */
  body.home #nth-home section[aria-labelledby="nth-latest-across-tech-title"] .nth-home-group-section {
    margin-bottom: 18px;
  }

  body.home #nth-home section[aria-labelledby="nth-latest-across-tech-title"] .nth-prod-grid {
    gap: 12px;
  }

  body.home #nth-home section[aria-labelledby="nth-latest-across-tech-title"] .nth-card-img {
    aspect-ratio: auto;
    height: 132px;
    padding: 5px 7px;
    box-sizing: border-box;
  }

  body.home #nth-home section[aria-labelledby="nth-latest-across-tech-title"] .nth-card-body {
    padding: 10px 11px 9px;
  }

  body.home #nth-home .nth-home-launch-grid,
  body.home #nth-home .nth-home-discovery-split {
    gap: 10px;
  }

  body.home #nth-home .nth-home-launch-card,
  body.home #nth-home .nth-home-discovery-box {
    padding: 13px 14px;
  }
}

/* Five Latest Phones across the common 1366/1440 desktop width. This is the
 * primary density correction requested from the live screenshots. It is
 * deliberately limited to the phone discovery section; Trending stays Top 3
 * and Latest Across Tech stays one representative per category. */
@media (min-width: 1280px) {
  body.home #nth-home section[aria-labelledby="nth-latest-phones-title"] .nth-prod-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }
}


/* --------------------------------------------------------------------------
 * 8. Phase 28A.3 — complete-media fit + category-aware homepage
 * -----------------------------------------------------------------------
 * Live 1366×768 acceptance showed that aggressively short fixed media wells
 * can make tall phones, headphones, wearables and appliance pack-shots look
 * visually clipped even when the card itself is denser. The image element is
 * constrained inside a flex-centred safe area rather than stretched to the
 * full media box. No homepage product-card image is intentionally cropped.
 */
body.home #nth-home .nth-prod-card .nth-card-img {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden;
  background: #fff;
}

body.home #nth-home .nth-prod-card .nth-card-img picture {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.home #nth-home .nth-prod-card .nth-card-img img,
body.home #nth-home .nth-prod-card:hover .nth-card-img img {
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 90% !important;
  max-height: 90% !important;
  aspect-ratio: auto !important;
  object-fit: contain !important;
  object-position: center !important;
  transform: none !important;
  margin: auto !important;
}

@media (min-width: 1180px) {
  body.home #nth-home section[aria-labelledby="nth-latest-phones-title"] .nth-card-img {
    height: 160px;
    padding: 5px 7px;
  }

  body.home #nth-home .nth-home-trending .nth-card-img {
    height: 168px;
    padding: 5px 7px;
  }
}

/* Category-aware compact discovery. Keep three high-level groups to avoid a
 * very long 11-rail wall, but give every actual CPT its own panel and its own
 * latest-product rows inside those groups. */
body.home #nth-home .nth-home-category-latest .nth-category-latest-groups {
  display: grid;
  gap: 18px;
}

body.home #nth-home .nth-category-latest-group {
  min-width: 0;
}

body.home #nth-home .nth-category-latest-group + .nth-category-latest-group {
  padding-top: 18px;
  border-top: 1px solid #e2e8f0;
}

body.home #nth-home .nth-category-latest-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

body.home #nth-home .nth-category-latest-group-head h3 {
  margin: 0;
  color: #1e293b;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 850;
}

body.home #nth-home .nth-category-panel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 10px;
}

body.home #nth-home .nth-category-panel {
  min-width: 0;
  padding: 11px;
  border: 1px solid #dbe3ee;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 28px -26px rgba(15, 23, 42, .35);
}

body.home #nth-home .nth-category-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #eef2f7;
}

body.home #nth-home .nth-category-panel-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dbeafe;
  border-radius: 9px;
  background: #f8fbff;
  color: #2563eb;
}

body.home #nth-home .nth-category-panel-icon svg {
  width: 17px;
  height: 17px;
}

body.home #nth-home .nth-category-panel-title {
  min-width: 0;
  margin: 0;
  flex: 1 1 auto;
  color: #0f172a;
  font-size: 13.5px;
  line-height: 1.25;
  font-weight: 850;
}

body.home #nth-home .nth-category-panel-viewall {
  flex: 0 0 auto;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

body.home #nth-home .nth-category-product-list {
  display: grid;
  gap: 5px;
  padding-top: 7px;
}

body.home #nth-home .nth-category-product-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 6px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}

body.home #nth-home .nth-category-product-row:hover,
body.home #nth-home .nth-category-product-row:focus-visible {
  background: #f8fafc;
}

body.home #nth-home .nth-category-product-thumb {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #eef2f7;
  border-radius: 9px;
  background: #fff;
}

body.home #nth-home .nth-category-product-thumb img {
  width: auto !important;
  height: auto !important;
  max-width: 88% !important;
  max-height: 88% !important;
  object-fit: contain !important;
  object-position: center !important;
  transform: none !important;
}

body.home #nth-home .nth-category-product-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body.home #nth-home .nth-category-product-copy strong {
  min-width: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: #1e293b;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 800;
}

body.home #nth-home .nth-category-product-price {
  color: #64748b;
  font-size: 10.5px;
  line-height: 1.25;
  font-weight: 700;
}

body.home #nth-home .nth-category-product-price.is-current {
  color: #047857;
  font-weight: 850;
}

@media (max-width: 900px) {
  body.home #nth-home .nth-category-panel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  body.home #nth-home .nth-category-panel-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.home #nth-home .nth-category-product-row {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  body.home #nth-home .nth-category-product-thumb {
    width: 54px;
    height: 54px;
  }
}



/* --------------------------------------------------------------------------
 * 9. Phase 28A.4 — frontend UI / CSS audit hardening
 * -----------------------------------------------------------------------
 * Source audit of the materialized v5.45.0 frontend found a handful of safe,
 * presentation-only improvements that should not wait for the later monolithic
 * style.css refactor. Keep them in the cacheable Phase 28A layer so rollback is
 * one asset replacement and Price Truth / affiliate / Commerce stay untouched.
 */

/* Long homepage, small addition: one non-sticky jump rail instead of another
 * large content section. Narrow screens may scroll the rail itself; page-level
 * overflow is never hidden or masked. */
body.home #nth-home .nth-home-jump {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px 0 0;
  padding: 7px 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 10px 26px -26px rgba(15, 23, 42, .38);
}

body.home #nth-home .nth-home-jump-label {
  flex: 0 0 auto;
  padding-inline: 6px 8px;
  color: #64748b;
  font-size: 11px;
  line-height: 1;
  font-weight: 850;
  letter-spacing: .045em;
  text-transform: uppercase;
  white-space: nowrap;
}

body.home #nth-home .nth-home-jump a {
  min-height: 34px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #334155;
  background: #f8fafc;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

body.home #nth-home .nth-home-jump a:hover,
body.home #nth-home .nth-home-jump a:focus-visible {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

/* Native emoji differ by platform. Put every existing heading glyph inside the
 * same quiet component shell rather than rewriting semantic headings or adding
 * another icon library. */
body.home #nth-home .nth-heading-emoji {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f8fafc;
  font-size: 15px;
  line-height: 1;
  font-weight: 400;
}

/* The Phase 28A.3 category panels were deliberately compact, but 10.5/11px
 * metadata is unnecessarily small. Raise legibility without increasing the
 * number of products or changing the information hierarchy. */
body.home #nth-home .nth-category-panel-viewall {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 4px 5px;
  font-size: 12px;
  line-height: 1.2;
}

body.home #nth-home .nth-category-product-price {
  font-size: 11.5px;
  line-height: 1.35;
}

/* Price/stat figures scan better when digits do not change width. */
body.home #nth-home .nth-card-price,
body.home #nth-home .nth-hero-pulse-meta strong,
body.home #nth-home .nth-stat-num,
body.home #nth-home .nth-home-launch-price,
body.home #nth-home .nth-category-product-price {
  font-variant-numeric: tabular-nums;
}

/* Homepage card controls: retain five-column desktop density while giving
 * secondary actions a more deliberate control size and stronger alignment. */
body.home #nth-home .nth-prod-card .nth-card-btn {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
}

body.home #nth-home .nth-prod-card .nth-iconbtn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
}

/* Visible focus should follow the whole interactive surface, not only hero/nav. */
body.home #nth-home :is(
  .nth-cat-item,
  .nth-home-tool,
  .nth-card-btn,
  .nth-iconbtn,
  .nth-viewall,
  .nth-category-panel-viewall,
  .nth-category-product-row,
  .nth-home-primary-cta,
  .nth-browse-chip
):focus-visible {
  outline: 3px solid rgba(37, 99, 235, .28) !important;
  outline-offset: 2px !important;
}

/* The legacy base stylesheet permanently set will-change on every generic card.
 * Browsers should promote only when useful; idle long grids do not need their
 * own compositor hint. */
.nth-card {
  will-change: auto;
}

/* Product evidence imagery must never be cropped. The legacy washing-machine
 * gallery was the one audited product gallery still using cover. */
.nth-wm-page .nth-gallery img {
  object-fit: contain;
  object-position: center;
  box-sizing: border-box;
  padding: 8px;
  background: #fff;
}

/* Hover elevation is a desktop affordance. Prevent touch/coarse-pointer devices
 * from holding a transformed card after a tap. Colours/borders can still give
 * feedback; only movement is neutralised. */
@media (hover: none), (pointer: coarse) {
  .nth-card:hover,
  .nth-prod-card:hover,
  .nth-related-card:hover,
  .nth-bp-card:hover,
  body.home #nth-home .nth-cat-item:hover,
  body.home #nth-home .nth-home-tool:hover,
  body.home #nth-home .nth-hero-cta:hover {
    transform: none !important;
  }
}

/* New section-jump destinations need to land below the desktop sticky header. */
body.home #nth-home :is(
  #nth-home-explore,
  #nth-latest-phones,
  #nth-trending,
  #nth-reviews-guides,
  #nth-category-latest,
  #nth-launch-tracker
) {
  scroll-margin-top: 92px;
}

/* Existing mobile product action bar: respect devices with a bottom safe area. */
@media (max-width: 859px) {
  .nth-sticky {
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  body.home #nth-home .nth-prod-card .nth-card-btn {
    min-height: 42px;
  }

  body.home #nth-home .nth-prod-card .nth-iconbtn {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
  }

  body.home #nth-home :is(
    #nth-home-explore,
    #nth-latest-phones,
    #nth-trending,
    #nth-reviews-guides,
    #nth-category-latest,
    #nth-launch-tracker
  ) {
    scroll-margin-top: 28px;
  }
}

@media (max-width: 560px) {
  body.home #nth-home .nth-home-jump {
    margin-top: 9px;
    padding: 6px;
  }

  body.home #nth-home .nth-home-jump-label {
    font-size: 10.5px;
  }

  body.home #nth-home .nth-home-jump a {
    min-height: 36px;
    padding-inline: 9px;
  }
}
