/* Mobile navigation polish for Reviews IA.
   Loaded after page-level CSS so it can normalize generated pages. */

@media (max-width: 1100px) {
  html.reviews-menu-lock,
  body.reviews-menu-open {
    overflow: hidden;
  }

  .navbar {
    isolation: isolate;
  }

  .navbar__inner {
    position: relative;
    height: 64px;
    gap: 0.75rem;
  }

  .navbar__brand {
    min-width: 0;
    max-width: calc(100vw - 150px);
    gap: 0.7rem;
    font-size: clamp(1.02rem, 4.8vw, 1.26rem);
    line-height: 1;
    white-space: nowrap;
  }

  .navbar__brand span:not(.navbar__brand-icon) {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .navbar__brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    box-shadow: 0 10px 26px rgba(234, 88, 12, 0.22);
  }

  .navbar__actions {
    gap: 0.55rem;
    flex-shrink: 0;
  }

  .theme-toggle,
  .navbar__actions #theme-toggle,
  .navbar__actions .btn#theme-toggle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(234, 88, 12, 0.16);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
  }

  [data-theme="dark"] .theme-toggle,
  [data-theme="dark"] .navbar__actions #theme-toggle,
  [data-theme="dark"] .navbar__actions .btn#theme-toggle {
    background: rgba(30, 41, 59, 0.88);
    border-color: rgba(148, 163, 184, 0.22);
  }

  .nav-toggle {
    display: inline-flex !important;
    position: relative;
    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;
    padding: 0;
    border: 1px solid rgba(234, 88, 12, 0.22);
    border-radius: 999px;
    background:
      linear-gradient(180deg, rgba(255,255,255,0.9), rgba(255,255,255,0.62)),
      var(--color-primary-subtle);
    color: var(--text-strong);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.09);
    transition:
      transform var(--duration-normal, 200ms) var(--ease-default, ease),
      background var(--duration-normal, 200ms) var(--ease-default, ease),
      border-color var(--duration-normal, 200ms) var(--ease-default, ease),
      box-shadow var(--duration-normal, 200ms) var(--ease-default, ease);
  }

  .nav-toggle:hover,
  .nav-toggle:focus-visible {
    border-color: rgba(234, 88, 12, 0.42);
    background: var(--color-primary-light);
    box-shadow: 0 14px 32px rgba(234, 88, 12, 0.14);
  }

  .nav-toggle[aria-expanded="true"] {
    color: #fff;
    background: var(--color-primary);
    border-color: var(--color-primary);
    box-shadow: 0 16px 38px rgba(234, 88, 12, 0.26);
  }

  .nav-toggle__bar {
    position: absolute;
    left: 50%;
    width: 18px;
    height: 2px;
    margin: 0 !important;
    border-radius: 999px;
    background: currentColor;
    transform: translateX(-50%);
    transform-origin: center;
    transition:
      transform var(--duration-normal, 200ms) var(--ease-default, ease),
      opacity var(--duration-fast, 100ms) var(--ease-default, ease);
  }

  .nav-toggle__bar:nth-child(1) { top: 16px; }
  .nav-toggle__bar:nth-child(2) { top: 22px; }
  .nav-toggle__bar:nth-child(3) { top: 28px; }

  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
    transform: translateX(-50%) translateY(6px) rotate(45deg);
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
    transform: translateX(-50%) translateY(-6px) rotate(-45deg);
  }

  .navbar__links {
    display: none !important;
  }

  .navbar__links.is-open {
    display: grid !important;
    grid-template-columns: 1fr;
    position: absolute;
    top: calc(100% + 10px);
    left: max(12px, var(--container-padding, 16px));
    right: max(12px, var(--container-padding, 16px));
    max-height: min(74vh, calc(100dvh - 96px));
    overflow-y: auto;
    overscroll-behavior: contain;
    gap: 0.35rem;
    padding: 0.65rem;
    border: 1px solid rgba(234, 88, 12, 0.14);
    border-radius: 18px;
    background: rgba(255, 250, 245, 0.98);
    box-shadow:
      0 22px 70px rgba(15, 23, 42, 0.18),
      0 1px 0 rgba(255, 255, 255, 0.82) inset;
    backdrop-filter: blur(18px) saturate(1.12);
    -webkit-backdrop-filter: blur(18px) saturate(1.12);
    animation: reviews-menu-in 180ms var(--ease-out, ease) both;
    z-index: 1002;
  }

  [data-theme="dark"] .navbar__links.is-open {
    border-color: rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.98);
    box-shadow:
      0 22px 70px rgba(0, 0, 0, 0.42),
      0 1px 0 rgba(255, 255, 255, 0.08) inset;
  }

  .navbar__links.is-open a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 48px;
    padding: 0.82rem 0.95rem !important;
    border: 0 !important;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.96rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.2;
    white-space: normal;
  }

  .navbar__links.is-open a::after {
    content: "";
    width: 7px;
    height: 7px;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    opacity: 0.28;
    transform: rotate(45deg);
    flex: 0 0 auto;
    margin-left: 0.75rem;
  }

  .navbar__links.is-open a:hover,
  .navbar__links.is-open a:focus-visible,
  .navbar__links.is-open a[aria-current="page"] {
    color: var(--color-primary);
    background: var(--color-primary-light);
  }

  .navbar__actions .btn--sm:not(#theme-toggle) {
    display: none !important;
  }

  .affiliate-banner {
    margin-top: 64px;
    padding: 0.62rem var(--container-padding, 16px);
    font-size: 0.76rem;
  }

  .container {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  :root {
    --container-padding: 16px;
  }

  .navbar__inner {
    height: 62px;
  }

  .navbar__brand-icon {
    width: 40px;
    height: 40px;
  }

  .theme-toggle,
  .navbar__actions #theme-toggle,
  .navbar__actions .btn#theme-toggle {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
  }

  .nav-toggle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .navbar__links.is-open {
    left: 10px;
    right: 10px;
    top: calc(100% + 8px);
    max-height: min(76vh, calc(100dvh - 88px));
    border-radius: 16px;
  }

  .affiliate-banner {
    margin-top: 62px;
  }

  .hero,
  .cat-hero,
  .page-content,
  .product-hero {
    overflow-x: hidden;
  }

  .hero__ctas,
  .cta-row,
  .newsletter__form {
    width: 100%;
  }

  .hero__ctas .btn,
  .cta-row .btn,
  .newsletter__form .btn {
    width: 100%;
    white-space: normal;
  }
}

@keyframes reviews-menu-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@media (max-width: 640px) {
  .btn,
  .btn--lg,
  .product-hero .btn,
  .product-hero__content .btn,
  .product-hero__actions .btn,
  .pros-cons .btn,
  .content-section .btn {
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
  }

  .btn--lg,
  .product-hero .btn--primary,
  .product-hero__content .btn--primary,
  .product-hero__actions .btn--primary {
    width: 100%;
  }
}
