/* ============================================================
   EV-olution - mobile.css
   Loaded AFTER style.css. Responsive overrides only - never
   redefine colors, spacing values, or logic that already exists
   in style.css. This file only adjusts layout at breakpoints.

   Phase A: nav hamburger menu (sitewide, every page via header.php).
   Remaining pages/sections get their mobile passes in later phases;
   see project notes for the full rollout plan.
   ============================================================ */

/* Hamburger hidden by default (desktop). Declared outside any @media
   block on purpose - a base rule must come before the max-width:768px
   override below sets display:flex, or cascade ordering issues can
   undo the override on some browsers. */
.nav-hamburger { display: none; }

@media (max-width: 768px) {
  .nav-inner { flex-wrap: wrap; row-gap: 12px; padding: 14px 5%; }

  .nav-left      { order: 1; }
  .nav-cart      { order: 2; margin-left: auto; }
  .nav-hamburger {
    order: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: 0.5px solid var(--border2);
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease;
  }
  .nav-hamburger:hover { background: rgba(255,255,255,0.05); }

  .ham-bar {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--white);
    border-radius: 2px;
    position: relative;
    transition: background 0.2s ease;
  }
  .ham-bar::before, .ham-bar::after {
    content: "";
    display: block;
    width: 20px;
    height: 2px;
    background: inherit;
    border-radius: 2px;
    position: absolute;
    left: 0;
    transition: transform 0.25s ease, top 0.25s ease, bottom 0.25s ease;
  }
  .ham-bar::before { top: -6px; }
  .ham-bar::after  { bottom: -6px; }

  /* Animated hamburger to X */
  #navbar.nav-open .ham-bar { background: transparent; }
  #navbar.nav-open .ham-bar::before { top: 0; transform: rotate(45deg); background: var(--white); }
  #navbar.nav-open .ham-bar::after  { bottom: 0; transform: rotate(-45deg); background: var(--white); }

  /* Nav links + Ko-Fi CTA collapse into a full-width panel below the
     logo/cart/hamburger row, expanded via JS toggling .nav-open on
     #navbar (see header.php script block). Padding is zeroed here and
     restored only in the open state below, so nothing can peek through
     before max-height finishes clipping the collapsed panel. */
  .nav-links, .nav-cta {
    flex: 1 0 100%;
    max-height: 0;
    padding: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }
  .nav-links { order: 4; flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-cta   { order: 5; }

  /* .nav's own background stays transparent (blurred) until scrolled,
     which isn't enough backing for an open dropdown sitting over page
     content - give the open state its own solid background. */
  #navbar.nav-open {
    background: rgba(20,20,20,0.98);
    height: auto;
  }

  #navbar.nav-open .nav-links { max-height: 480px; }
  #navbar.nav-open .nav-cta   { max-height: 60px; margin-top: 4px; padding: 9px 16px; }

  /* Right-aligned to sit under the hamburger icon, and sized up from the
     desktop pill size (13px/8px 14px) since these are now full-width
     tap targets on a touchscreen, not small hover-friendly desktop pills. */
  .nav-links .nav-link {
    width: 100%;
    box-sizing: border-box;
    border-color: transparent;
    text-align: right;
    font-size: 17px;
    padding: 14px 20px;
  }

  /* Buttons center their text by default in every browser - .nav-drop-btn
     is a <button>, unlike the other nav-links which are <a> tags. The
     .nav-links .nav-link rule above already wins on specificity, but this
     is kept explicit for clarity. */
  .nav-drop-btn { text-align: right; }

  .nav-cta {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }

  /* Products I Use dropdown becomes a tap-to-expand accordion instead of
     the desktop hover panel. Explicitly resetting opacity/visibility/
     transform here is required - otherwise the desktop hover-transition
     values leave the panel invisible when JS drives it via max-height.
     border is reset to none too - the desktop 0.5px border still rendered
     as a stray line even at max-height:0, since border isn't clipped by
     max-height the way padding/content are. */
  .dropdown { width: 100%; }
  .dropdown-content {
    position: static;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    border: none;
    transition: max-height 0.3s ease;
  }

  /* Sub-links aren't <a class="nav-link">, so they need their own
     right-align and size bump to match the top-level items above. */
  .dropdown-content a {
    text-align: right;
    font-size: 17px;
    padding: 12px 14px;
  }
  .dropdown.drop-open .dropdown-content {
    max-height: 220px;
    padding: 6px;
    border: 0.5px solid var(--border);
    border-radius: 6px;
  }
  .dropdown::after { display: none; } /* hover bridge not needed on tap */
}

@media (max-width: 480px) {
  .nav-logo-img { height: 28px; }
  .nav-inner { padding: 12px 5%; }
}

/* ============================================================
   FOOTER
   footer-top's 1fr/1fr/2fr grid and footer-nav's flex row of fixed-
   width columns both assume desktop width - neither wraps on their
   own, which is what was causing horizontal overflow on phones.
   ============================================================ */
@media (max-width: 1024px) {
  .footer-top { grid-template-columns: 1fr; gap: 28px; text-align: center; }

  .footer-brand { text-align: center; }
  .footer-tagline { max-width: 100%; margin-left: auto; margin-right: auto; }
  .footer-socials { justify-content: center; }

  .footer-nav { flex-direction: column; align-items: center; gap: 24px; }
  .footer-col { align-items: center; text-align: center; }
  .footer-col a, .footer-col span { white-space: normal; }

  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

  .cookie-banner { padding: 16px 5%; }
}

@media (max-width: 480px) {
  .evo-overlay-label span { font-size: 12px; letter-spacing: 1.5px; }
}
