/* MatDev — Header & compte premium (2026) */

/* --- Layout header --- */
.header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem 1rem;
  min-height: var(--header-height, 72px);
  height: auto;
  padding-block: 0.35rem;
}

.header__logo {
  grid-column: 1;
  z-index: 2;
}

.header__nav {
  grid-column: 2;
  justify-self: center;
  max-width: 100%;
  overflow: visible;
}

.header__actions {
  grid-column: 3;
  display: none;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  z-index: 2;
}

.burger {
  grid-column: 3;
  justify-self: end;
  z-index: 3;
}

@media (min-width: 1024px) {
  .header__actions {
    display: flex;
  }

  .burger {
    display: none;
  }
}

@media (min-width: 1024px) and (max-width: 1280px) {
  .nav-link {
    padding: 0.45rem 0.55rem;
    font-size: 0.8125rem;
  }

  .nav-link--tool .nav-link__full { display: none; }
  .nav-link--tool .nav-link__short { display: inline; }
}

@media (min-width: 1281px) {
  .nav-link--tool .nav-link__full { display: inline; }
  .nav-link--tool .nav-link__short { display: none; }
}

.nav-link--tool .nav-link__short { display: none; }

.nav-list {
  flex-wrap: nowrap;
  gap: 0.05rem;
}

.nav-item--account {
  z-index: 120;
}

.nav-link--account {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 160px;
}

.nav-link--account__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-account__avatar {
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(118, 87, 255, 0.45);
  box-shadow: 0 0 12px rgba(118, 87, 255, 0.25);
  flex-shrink: 0;
}

/* Dropdown premium */
.nav-dropdown {
  z-index: 200;
  min-width: 220px;
  padding: 0.35rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 14, 32, 0.96);
  backdrop-filter: blur(20px) saturate(1.3);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(118, 87, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.nav-dropdown--account {
  min-width: 240px;
}

.nav-dropdown__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem 0.75rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary, #fff);
}

.nav-dropdown__head img {
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-dropdown__link {
  border-radius: 10px;
  margin: 0.1rem 0;
}

.nav-dropdown__link--logout {
  color: #fca5a5;
}

.nav-dropdown__link--logout:hover {
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
}

.nav-logout-form {
  margin: 0;
  display: block;
}

.nav-logout-form .nav-dropdown__link,
.nav-logout-form .nav-mobile__link {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

/* Boutons header */
.header__cta--devis,
.header__cta--login {
  display: none;
  white-space: nowrap;
}

@media (min-width: 1024px) {
  .header__cta--devis,
  .header__cta--login {
    display: inline-flex;
  }
}

.header__cta--devis {
  padding-inline: 1rem;
  font-size: 0.8125rem;
}

.btn--ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary, #f8fafc);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  text-decoration: none;
  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.25s ease;
}

.btn--ghost:hover {
  background: rgba(118, 87, 255, 0.12);
  border-color: rgba(118, 87, 255, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(118, 87, 255, 0.15);
}

.header__cta--login .header__cta-text--long,
.header__cta--login .header__cta-text--short {
  display: inline;
}

/* Mobile */
.nav-mobile__link--login {
  color: #20c7e8;
  font-weight: 600;
}

.nav-mobile__link--logout {
  color: #fca5a5 !important;
}

.nav-mobile__group--account {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* SEO header scroll */
.seo-page .header--seo .header__inner {
  height: auto;
}

.seo-page .header--seo.is-scrolled {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

@media (prefers-reduced-motion: reduce) {
  .btn--ghost,
  .nav-dropdown__link {
    transition: none;
  }
}
