/* ==========================================================================
   NORTHSTAR ELECTRICAL — components
   buttons · top bar · header · mobile menu · mobile action bar · WhatsApp FAB
   ========================================================================== */

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  --bg: var(--blue);
  --fg: var(--white);
  --bg-h: var(--blue-dk);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  min-height: 54px;
  padding: 0.85em 1.5em;
  background: var(--bg);
  color: var(--fg);
  border: 2px solid var(--bg);
  border-radius: 8px;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}

.btn:hover,
.btn:focus-visible {
  background: var(--bg-h);
  border-color: var(--bg-h);
}

.btn:active {
  transform: translateY(1px);
}

.btn .i {
  width: 1.3em;
  height: 1.3em;
}

.btn--wa {
  --bg: var(--wa);
  --bg-h: var(--wa-dk);
}

.btn--outline {
  --bg: transparent;
  --fg: var(--ink);
  border-color: var(--line);
  border-color: #b8c1cf;
}

.btn--outline:hover,
.btn--outline:focus-visible {
  background: var(--snow);
  border-color: var(--charcoal);
}

.btn--dark {
  --bg: var(--charcoal);
  --bg-h: var(--charcoal-3);
}

.btn--white {
  --bg: var(--white);
  --fg: var(--charcoal);
  --bg-h: var(--blue-lt);
}

.btn--white:hover,
.btn--white:focus-visible {
  color: var(--charcoal);
}

.btn--lg {
  min-height: 64px;
  padding-inline: 1.8em;
  font-size: 1.15rem;
}

.btn--block {
  width: 100%;
}

.btn--sm {
  min-height: 44px;
  padding: 0.6em 1.1em;
  font-size: 0.95rem;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-weight: 700;
  color: var(--blue);
  min-height: 44px;
}

.link .i {
  width: 1em;
  height: 1em;
  transition: transform 0.2s var(--ease);
}

.link:hover .i,
.link:focus-visible .i {
  transform: translateX(3px);
}

.link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Top bar
   -------------------------------------------------------------------------- */

.topbar {
  background: var(--charcoal);
  color: #e3e8f0;
  font-size: 0.86rem;
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 42px;
}

.topbar__msg {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-weight: 600;
}

.topbar__msg::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #35d07f;
  box-shadow: 0 0 0 0 rgba(53, 208, 127, 0.6);
  animation: pulse 2.4s ease-out infinite;
}

@keyframes pulse {
  70%,
  100% {
    box-shadow: 0 0 0 8px rgba(53, 208, 127, 0);
  }
}

.topbar__links {
  display: none;
  align-items: center;
  gap: 1.6rem;
}

.topbar__links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 600;
}

.topbar__links a:hover {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.topbar__call {
  margin-left: auto;
  font-weight: 700;
  color: var(--white);
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
}

@media (min-width: 900px) {
  .topbar__links {
    display: flex;
  }

  .topbar__call {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .topbar__msg::before {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.25s var(--ease);
}

.site-header.is-scrolled {
  box-shadow: 0 6px 20px rgba(20, 30, 50, 0.08);
}

.site-header__inner {
  position: relative;
  z-index: 2; /* keeps logo, call and menu buttons above the open mobile menu */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
  background: var(--white);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  line-height: 1;
}

.logo__mark {
  width: 38px;
  height: 38px;
  flex: none;
}

.logo__text {
  display: grid;
  gap: 0.22em;
}

.logo__name {
  font-size: 1.14rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.logo__sub {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--blue);
}

.nav {
  display: none;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: clamp(1.2rem, 2.4vw, 2.4rem);
}

.nav__link {
  position: relative;
  display: inline-block;
  padding-block: 0.6em;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.1em;
  height: 3px;
  border-radius: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transition: transform 0.25s var(--ease);
}

.nav__link:hover::after,
.nav__link:focus-visible::after,
.nav__link.is-active::after {
  transform: scaleX(1);
}

.nav__link.is-active {
  color: var(--blue);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.header__phone {
  display: none;
  align-items: center;
  gap: 0.5em;
  font-weight: 800;
  font-size: 1.08rem;
  white-space: nowrap;
}

.header__phone .i {
  color: var(--blue);
}

.header__cta {
  display: none;
}

.call-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
}

.call-icon .i {
  width: 22px;
  height: 22px;
}

.menu-toggle {
  position: relative;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 10px;
}

.menu-toggle__bars {
  position: relative;
  width: 20px;
  height: 14px;
}

.menu-toggle__bars::before,
.menu-toggle__bars::after,
.menu-toggle__bars i {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 2.5px;
  border-radius: 2px;
  background: var(--charcoal);
  transition: transform 0.3s var(--ease), opacity 0.2s, top 0.3s var(--ease);
}

.menu-toggle__bars::before {
  top: 0;
}

.menu-toggle__bars i {
  top: 6px;
}

.menu-toggle__bars::after {
  top: 12px;
}

.menu-open .menu-toggle__bars::before {
  top: 6px;
  transform: rotate(45deg);
}

.menu-open .menu-toggle__bars i {
  opacity: 0;
}

.menu-open .menu-toggle__bars::after {
  top: 6px;
  transform: rotate(-45deg);
}

/* mobile menu */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  padding: 110px var(--gutter) calc(var(--bar-h) + 24px);
  background: var(--white);
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s linear 0.25s;
}

.menu-open .mobile-menu {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), visibility 0s;
}

.menu-open .site-header {
  z-index: 70;
}

.mobile-menu__list {
  display: grid;
}

.mobile-menu__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  border-bottom: 1px solid var(--line);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.mobile-menu__link .i {
  color: var(--blue);
}

.mobile-menu__ctas {
  display: grid;
  gap: 12px;
  margin-top: 26px;
}

.mobile-menu__meta {
  margin-top: 22px;
  font-size: 0.95rem;
  color: var(--ink-2);
  display: grid;
  gap: 0.3rem;
}

@media (min-width: 980px) {
  .nav {
    display: block;
  }

  .header__phone {
    display: inline-flex;
  }

  .header__cta {
    display: inline-flex;
  }

  .call-icon,
  .menu-toggle,
  .mobile-menu {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Mobile action bar — Call + WhatsApp, always within thumb reach
   -------------------------------------------------------------------------- */

.action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(20, 30, 50, 0.1);
}

.action-bar .btn {
  min-height: 52px;
  padding-inline: 0.8em;
  font-size: 1.02rem;
}

/* Desktop: floating WhatsApp button instead */
.wa-fab {
  display: none;
}

@media (min-width: 900px) {
  body {
    padding-bottom: 0;
  }

  .action-bar {
    display: none;
  }

  .wa-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 80;
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    min-height: 58px;
    padding: 0 1.4em 0 1.1em;
    border-radius: 999px;
    background: var(--wa);
    color: var(--white);
    font-weight: 700;
    box-shadow: 0 10px 28px rgba(10, 60, 30, 0.35);
    transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
  }

  .wa-fab:hover,
  .wa-fab:focus-visible {
    background: var(--wa-dk);
    transform: translateY(-2px);
  }

  .wa-fab .i {
    width: 26px;
    height: 26px;
  }
}
