/* ==========================================================================
   NEVEITALIA — UI Audit Remediation Stylesheet (2026-12-05)
   Enqueued at priority 999 via mu-plugin `neve-ui-audit-fixes.php`.
   Fixes:
     1. P1 #2: Mobile header hamburger off-screen on /ru/ & /es/ (+ EN/AR RTL)
     2. P1 #3: Blog post mobile <table> horizontal overflow + header shift
     3. P1 #4 & #5: CTA :hover/:focus/:active contrast lock (>= 4.5:1) sitewide
     4. P2: Category archive mobile pagination +5px overflow
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. P1 #2 — Mobile Header Flex / Sizing (EN, RU, ES, AR RTL) + Header Pin
   -------------------------------------------------------------------------- */
#nv-hdr.site-header-shell {
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

#nv-hdr .site-header {
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

@media (max-width: 900px) {
  #nv-hdr .site-header__inner {
    padding: 0 14px !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  #nv-hdr .site-branding {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    max-width: 44% !important;
  }

  #nv-hdr .site-branding__link {
    display: inline-flex !important;
    align-items: center !important;
    max-width: 100% !important;
  }

  #nv-hdr .site-branding__logo,
  body.home-header-scrolled #nv-hdr .site-branding__logo {
    max-height: 22px !important;
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
  }

  #nv-hdr .site-header__actions {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    margin: 0 !important;
    margin-inline-start: auto !important;
    min-width: 0 !important;
    flex: 0 1 auto !important;
  }

  #nv-hdr .site-header__actions > .btn {
    padding: 7px 10px !important;
    font-size: 9.5px !important;
    letter-spacing: 0.35px !important;
    line-height: 1.15 !important;
    white-space: normal !important;
    text-align: center !important;
    max-width: 170px !important;
    min-width: 0 !important;
    flex: 0 1 auto !important;
  }

  #nv-hdr .site-menu-toggle {
    flex: 0 0 24px !important;
    width: 24px !important;
    min-width: 24px !important;
    height: 18px !important;
    min-height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

@media (max-width: 480px) {
  #nv-hdr .site-header__inner {
    padding: 0 12px !important;
    gap: 6px !important;
  }

  #nv-hdr .site-branding {
    max-width: 38% !important;
  }

  #nv-hdr .site-branding__logo,
  body.home-header-scrolled #nv-hdr .site-branding__logo {
    max-height: 20px !important;
  }

  #nv-hdr .site-header__actions {
    gap: 8px !important;
  }

  #nv-hdr .site-header__actions > .btn {
    padding: 6px 8px !important;
    font-size: 9px !important;
    letter-spacing: 0.25px !important;
    max-width: 158px !important;
  }
}

/* --------------------------------------------------------------------------
   2. P1 #3 — Blog Post & Page Mobile <table> Horizontal Scroll (0px Overflow)
   -------------------------------------------------------------------------- */
body .kj-post,
body .kj-post-main,
body .kj-post-content {
  min-width: 0 !important;
  max-width: 100% !important;
}

@media (max-width: 1100px) {
  body .kj-post-body {
    grid-template-columns: minmax(0, 1fr) !important;
    max-width: 100% !important;
  }
}

@media (max-width: 768px) {
  body .kj-post-content .wp-block-table,
  body .entry-content .wp-block-table {
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  body .kj-post-content table,
  body .entry-content table {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box !important;
  }

  body .kj-post-content table thead th,
  body .kj-post-content table tbody td {
    padding: 10px 12px !important;
    font-size: 14px !important;
  }
}

/* --------------------------------------------------------------------------
   3. P1 #4 & #5 — Primary CTA :hover / :focus / :active Contrast Lock (>=4.5:1)
   Prevents global `a:hover { color: var(--color-accent); }` or generic dark
   `:hover` background overrides from collapsing button text contrast to 1:1.
   -------------------------------------------------------------------------- */

/* Dark-olive primary buttons -> deeper olive bg (#262E25) + ivory text (#F4F2E9) = 12.48:1 */
body a.nv-btn:is(:hover, :focus, :active),
body button.nv-btn:is(:hover, :focus, :active),
body .nv-btn:is(:hover, :focus, :active),
body .nv-sofa a.btn:is(:hover, :focus, :active),
body .nv-custom a.btn:is(:hover, :focus, :active),
body .nv-oem a.btn:is(:hover, :focus, :active),
body .nv-qc a.btn:not(.btn--light):not(.btn--ghost):is(:hover, :focus, :active),
body .nv-factory a.btn:not(.btn--light):not(.btn--ghost):is(:hover, :focus, :active),
body .nv-our-factory a.btn:not(.btn--light):not(.btn--ghost):is(:hover, :focus, :active),
body:is(.nv-manufacturing-process, .nv-product-customization, .nv-quality-control, .nv-oem-odm, .nv-our-factory, .nv-shipping-logistics, .nv-after-sales-support) :is(.nv-btn, .btn):not(.btn--light):not(.btn--ghost):is(:hover, :focus, :active),
body a.jl-btn-primary:is(:hover, :focus, :active),
body a.nvb2b-button:is(:hover, :focus, :active) {
  background-color: #262E25 !important;
  border-color: #262E25 !important;
  color: #F4F2E9 !important;
}

/* Light-surface CTA buttons (.btn--light, hero light CTAs) -> #FFFFFF bg + #1B221A text = 16.14:1 */
body a.btn--light:is(:hover, :focus, :active),
body button.btn--light:is(:hover, :focus, :active),
body .btn--light:is(:hover, :focus, :active),
body:is(.nv-manufacturing-process, .nv-product-customization, .nv-quality-control, .nv-oem-odm, .nv-our-factory, .nv-shipping-logistics, .nv-after-sales-support) .btn--light:is(:hover, :focus, :active),
body :is(.nv-sofa, .nv-custom, .nv-oem) .hero__btn:is(:hover, :focus, :active),
body :is(.pd-btn:not(.ghost), .cs-btn, .jc-btn):is(:hover, :focus, :active) {
  background-color: #FFFFFF !important;
  border-color: #FFFFFF !important;
  color: #1B221A !important;
}

/* Ghost buttons on dark sections -> translucent ivory tint + crisp white text */
body a.btn--ghost:is(:hover, :focus, :active),
body .btn--ghost:is(:hover, :focus, :active),
body:is(.nv-manufacturing-process, .nv-product-customization, .nv-quality-control, .nv-oem-odm, .nv-our-factory, .nv-shipping-logistics, .nv-after-sales-support) .btn--ghost:is(:hover, :focus, :active) {
  background-color: rgba(244, 242, 233, 0.16) !important;
  border-color: #FFFFFF !important;
  color: #FFFFFF !important;
}

/* Generic .btn-primary / .btn-dark anchors */
body a.btn-primary:is(:hover, :focus, :active),
body a.btn-dark:is(:hover, :focus, :active) {
  color: #FFFFFF !important;
}

/* --------------------------------------------------------------------------
   4. P2 — Category Archive Mobile Pagination (0px Overflow at 390x844)
   -------------------------------------------------------------------------- */
body .jl-cat-pagination {
  flex-wrap: wrap !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 640px) {
  body .jl-cat-pagination {
    padding: 16px 12px 60px !important;
    gap: 6px !important;
  }

  body .jl-cat-pagination a,
  body .jl-cat-pagination span {
    padding: 9px 12px !important;
    font-size: 0.78rem !important;
    min-width: 36px;
    text-align: center;
    box-sizing: border-box !important;
  }
}
