/*
 * Public site header tidy-up (27 Sep 2026).
 *
 * Loaded from app/Views/front/_homepage-header.php after every template stylesheet, so it only
 * needs to win on specificity/order. What it changes:
 *  - "Log in" is a visible outlined button (Tracker login, Customer portal, Partner portal) and is
 *    never hidden on desktop/tablet widths (the old rules hid it from 941px to 1120px while the
 *    hamburger only appeared at 940px and below, so the login links vanished on tablets and small
 *    laptops; the shop template also hid it below 1088px).
 *  - A compact "Shop" button replaces the Shop text link in the (now five-item) main menu.
 *  - Below 1024px the main menu moves into the slide-out drawer (the drawer styles were only
 *    defined at 940px and below), the Log in button and basket stay in the bar; below 561px
 *    Log in moves into the drawer, where the log-in links are listed first.
 * Uses the live template tokens (--fs-*) with the older --home-* tokens as fallbacks.
 */

html body .home-header .fa-login > summary {
  gap: 6px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--fs-line-strong, #c9cdd6);
  border-radius: var(--fs-r-sm, 7px);
  background: var(--home-white, #ffffff);
  color: var(--fs-ink, #0f1115);
  font-weight: 600;
  transition: border-color var(--fs-fast, 160ms ease), color var(--fs-fast, 160ms ease);
}

html body .home-header .fa-login > summary:hover,
html body .home-header .fa-login[open] > summary,
html body .home-header .fa-login > summary:focus-visible {
  border-color: var(--fs-brand, #245cff);
  color: var(--fs-brand, #245cff);
}

html body .home-header .fa-login .home-sign-in__panel {
  width: 300px;
}

html body .home-header .fa-header-shop {
  display: inline-flex;
  align-items: center;
  height: 42px;
  padding: 0 16px;
  border-radius: var(--fs-r-sm, 7px);
  background: var(--fs-action, #14171d);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--fs-fast, 160ms ease);
}

html body .home-header .fa-header-shop:hover,
html body .home-header .fa-header-shop:focus-visible {
  background: var(--fs-action-2, #262b35);
  color: #ffffff;
}

html body .home-header .home-header__actions {
  gap: 10px;
}

/* Keep "Log in" visible where the older rules hid it (incl. the shop template's !important). */
@media (max-width: 1120px) {
  html body .home-header .home-header__actions .fa-login,
  html body.shop-experience .home-header .home-header__actions .fa-login {
    display: block !important;
  }
}

/* Below 1024px: main menu → drawer; Log in, Shop (≥761px) and basket stay in the bar. */
@media (max-width: 1023px) {
  html body .home-header .home-header__inner {
    grid-template-columns: 1fr auto auto;
    gap: 12px;
  }

  html body .home-header .home-desktop-nav {
    display: none !important;
  }

  html body .home-header .home-header__actions {
    display: flex !important;
  }

  html body .home-header .home-menu-button {
    display: inline-flex !important;
  }

  .home-menu-backdrop {
    position: fixed;
    z-index: 1250;
    inset: 0;
    display: block;
    background: rgba(6, 18, 34, 0.58);
  }

  .home-menu-backdrop[hidden] {
    display: none;
  }

  .home-mobile-menu {
    position: fixed;
    z-index: 1300;
    top: 0;
    right: 0;
    display: none;
    flex-direction: column;
    width: min(92vw, 390px);
    height: 100dvh;
    padding: 22px;
    background: var(--home-white, #ffffff);
    box-shadow: -20px 0 50px rgba(6, 18, 34, 0.2);
    transform: none;
  }

  .home-mobile-menu.is-open {
    display: flex;
  }

  .home-mobile-menu__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--home-line, #d8e1ec);
  }

  .home-mobile-menu__top img {
    width: 170px;
    height: auto;
  }

  .home-mobile-menu__links {
    display: grid;
    overflow-y: auto;
    margin-bottom: auto;
    padding: 4px 0 24px;
  }

  .home-mobile-menu__links a {
    padding: 13px 4px;
    border-bottom: 1px solid var(--home-line, #d8e1ec);
    color: var(--home-ink, #0d1b2f);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
  }
}

@media (max-width: 760px) {
  html body .home-header .fa-header-shop {
    display: none;
  }
}

@media (max-width: 560px) {
  html body .home-header .home-header__actions .fa-login,
  html body.shop-experience .home-header .home-header__actions .fa-login {
    display: none !important;
  }
}

/* Drawer: log-in links first, then grouped navigation. Hidden outside the drawer. */
.fa-mobile-login {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 16px 0 14px;
  border-bottom: 1px solid var(--home-line, #d8e1ec);
}

html body .home-mobile-menu .fa-mobile-login a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--fs-line-strong, #c9cdd6);
  border-radius: var(--fs-r-sm, 7px);
  color: var(--fs-ink, #0f1115) !important;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

html body .home-mobile-menu .fa-mobile-login a.fa-mobile-login__primary {
  grid-column: 1 / -1;
  border-color: var(--fs-action, #14171d);
  background: var(--fs-action, #14171d);
  color: #ffffff !important;
}

.fa-mobile-group {
  display: block;
  padding: 16px 4px 4px;
  color: var(--fs-muted, #626a7a);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
