/* ==========================================================================
   Harsh Sales Agency — mobile navigation
   Loaded last so nothing later in the cascade can break the panel again.
   ========================================================================== */

@media (max-width: 960px) {

  /* Backdrop --------------------------------------------------------------- */
  .nav__scrim {
    position: fixed; inset: 0; z-index: 55;
    background: rgba(22, 46, 66, .45);
    backdrop-filter: blur(2px);
    opacity: 0; pointer-events: none;
    transition: opacity .3s var(--ease);
  }
  .nav.is-open ~ .nav__scrim,
  body.nav-open .nav__scrim { opacity: 1; pointer-events: auto }

  /* Panel ------------------------------------------------------------------ */
  .nav__links {
    position: fixed !important;      /* defended: a later rule broke this once */
    top: var(--nav-h); left: 0; right: 0; bottom: auto;
    width: 100%; max-height: calc(100dvh - var(--nav-h));
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    display: flex; flex-direction: column; align-items: stretch;
    gap: 2px; margin: 0;
    padding: 12px 20px calc(20px + env(safe-area-inset-bottom));
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 48px rgba(22, 46, 66, .16);
    /* Visibility is switched, not faded: a stalled opacity transition would
       leave the whole menu invisible. Only the slide is animated. */
    visibility: hidden; pointer-events: none;
    transform: translateY(-12px);
    transition: transform .3s var(--ease-out), visibility 0s linear .3s;
    z-index: 58;
  }
  .nav.is-open .nav__links {
    visibility: visible; pointer-events: auto;
    transform: none;
    transition: transform .3s var(--ease-out), visibility 0s;
  }

  .nav__links li { list-style: none }

  /* Scoped to real nav rows only. A bare `.nav__links a` rule (0,2,0) would
     also win against `.btn--primary`, painting the CTA's label navy on a
     navy button — i.e. invisible. */
  .nav__links > li:not(.nav__extra) > a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 15px 14px; border-radius: var(--r-md);
    font-size: 1.02rem; font-weight: 600; color: var(--ink);
    min-height: 52px;                /* comfortable tap target */
    border-bottom: 1px solid var(--line-2);
  }
  .nav__links > li:not(.nav__extra):last-of-type > a { border-bottom: none }
  .nav__links > li:not(.nav__extra) > a::after { content: none }
  .nav__links > li:not(.nav__extra) > a.is-active { background: var(--ink); color: var(--cream) }
  .nav__links > li:not(.nav__extra) > a:active { background: var(--cream-2) }

  /* Chevron on each row */
  .nav__links > li:not(.nav__extra) > a::before {
    content: ""; order: 2; width: 7px; height: 7px; flex: none;
    border-right: 2px solid var(--ink-300); border-bottom: 2px solid var(--ink-300);
    transform: rotate(-45deg); margin-left: 12px;
  }
  .nav__links > li:not(.nav__extra) > a.is-active::before { border-color: rgba(251,247,241,.6) }

  /* Contact block inside the panel ----------------------------------------- */
  .nav__extra {
    margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line);
    display: grid; gap: 10px;
  }
  /* `.nav__links a` in style.css (0,2,0) outranks `.btn--primary` (0,1,0),
     so the button label has to be restated at matching specificity. */
  .nav__extra .btn { width: 100%; justify-content: center; min-height: 52px }
  .nav__extra .btn--primary { background: var(--ink); color: var(--cream) }
  .nav__extra .btn--primary:hover { background: var(--amber); color: var(--ink) }
  .nav__extra .nav__tel { color: var(--ink) }
  .nav__extra a.nav__tel {
    display: flex; align-items: center; justify-content: center; gap: 9px;
    min-height: 48px; border-radius: var(--r-full);
    border: 1px solid var(--line); background: var(--white);
    font-weight: 600; font-size: .95rem; color: var(--ink);
  }

  .nav__extra svg { width: 17px; height: 17px; color: var(--amber-600) }

  /* No per-row entrance animation by design. This is critical navigation:
     any opacity-based reveal can strand the rows invisible if the animation
     does not run. The panel's own slide provides the motion. */

  /* Lock the page behind the panel */
  body.nav-open { overflow: hidden }
}

@media (min-width: 961px) {
  .nav__scrim { display: none }
  .nav__extra { display: none }
}

@media (prefers-reduced-motion: reduce) {
  .nav__links { transition: none }

}


/* ==========================================================================
   Footer — centred, compact layout on phones
   The stacked left-aligned columns ran very long and read as a wall of links.
   ========================================================================== */
@media (max-width: 700px) {
  .foot { text-align: center }
  .foot__grid { gap: 30px }

  /* Brand block */
  .foot .brand { justify-content: center }
  .foot__about { margin-inline: auto; max-width: 38ch; text-align: center }
  .social { justify-content: center }

  /* Link columns sit side by side instead of two long stacks */
  .foot__grid > div:nth-child(2),
  .foot__grid > div:nth-child(3) {
    grid-column: span 1;
    text-align: center;
  }
  .foot__grid { grid-template-columns: repeat(2, 1fr) }
  .foot__grid > div:first-child,
  .foot__grid > div:last-child { grid-column: 1 / -1 }

  .foot h4 { margin-bottom: 10px }
  .foot ul { gap: 11px }
  .foot a { display: inline-block; padding: 2px 0 }

  /* Contact block: make the phone and email obvious tap targets */
  .foot__grid > div:last-child ul { gap: 8px }
  .foot__grid > div:last-child a[href^="tel:"],
  .foot__grid > div:last-child a[href^="mailto:"],
  .foot__grid > div:last-child a[href*="wa.me"] {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 8px 18px; border-radius: var(--r-full);
    border: 1px solid rgba(251, 247, 241, .18);
    font-weight: 600;
  }
  .foot__grid > div:last-child a[href^="tel:"] { background: var(--amber); color: var(--ink); border-color: var(--amber) }

  .foot__bot {
    justify-content: center; text-align: center; gap: 6px; flex-direction: column;
    font-size: .72rem; line-height: 1.6; letter-spacing: .03em;
    padding-inline: 8px;
    /* clear the floating WhatsApp button */
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
  .foot__bot span { display: block; max-width: 34ch; margin-inline: auto }
}

@media (max-width: 380px) {
  .foot__grid { grid-template-columns: 1fr }
  .foot__grid > div { grid-column: 1 / -1 !important }
}
