/* SNBG Header v2 — modern two-tier navigation */

/* ============== TOP UTILITY BAR ============== */
.topbar {
  background: linear-gradient(90deg, #0f3b24 0%, #2B5D31 100%);
  color: #e8f5e9;
  font-size: 0.82rem;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0;
  gap: 1rem;
  flex-wrap: wrap;
}
.topbar-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.topbar-info a {
  color: #e8f5e9;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s;
}
.topbar-info a:hover { color: #FFD700; }
.topbar-info i { color: #FFD700; font-size: 0.9rem; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.locale-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 3px;
  border: 1px solid rgba(255,215,0,0.25);
}
.locale-switcher a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  color: #e8f5e9;
  border-radius: 999px;
  transition: all 0.2s;
}
.locale-switcher a:hover { background: rgba(255,215,0,0.15); color: #FFD700; }
.locale-switcher a.is-active {
  background: #FFD700;
  color: #0f3b24;
  box-shadow: 0 2px 8px rgba(255,215,0,0.3);
}

.topbar-social {
  display: flex;
  gap: 0.4rem;
}
.topbar-social a {
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #e8f5e9;
  text-decoration: none;
  font-size: 0.75rem;
  transition: all 0.2s;
}
.topbar-social a:hover {
  background: #FFD700;
  color: #0f3b24;
  transform: translateY(-1px);
}

/* ============== MAIN HEADER ============== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #0f3b24;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: box-shadow 0.3s ease;
}
/* Override the global 1200px container to give the navigation room to breathe.
   With 8 nav items + 2 CTA buttons + logo, we need ~1500px. */
.header > .container,
.topbar > .container {
  max-width: 1500px;
}
.header-scrolled {
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}
.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  gap: 1.25rem;
  min-width: 0;
}

/* Logo */
.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.logo-content { display: flex; align-items: center; gap: 0.7rem; }
.logo-image-wrap {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  flex-shrink: 0;
  transition: transform 0.4s var(--ease-out, cubic-bezier(0.16,1,0.3,1));
}
.logo:hover .logo-image-wrap { transform: rotate(-6deg) scale(1.05); }
.logo-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(15,59,36,0.25));
}
.logo-emoji { font-size: 2.2rem; line-height: 1; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-main {
  font-family: 'Montserrat', system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.02em;
}
.logo-sub {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.65);
  font-weight: 500;
  margin-top: 2px;
  white-space: nowrap;
}

/* Navigation */
.nav-area { flex: 0 1 auto; display: flex; justify-content: center; }
.nav-list {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  align-items: center;
}
.nav-item { position: relative; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: #ffffff;
  font-weight: 500;
  font-size: 0.92rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.nav-link:hover {
  color: #FFD700;
  background: transparent;
}
.nav-link.is-active {
  color: #FFD700;
  background: transparent;
}

/* Dropdowns */
.nav-item-dropdown > .nav-link::after {
  content: "▾";
  font-size: 0.7rem;
  opacity: 0.7;
  margin-left: 2px;
}
.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 260px;
  background: #fff;
  border-radius: 14px;
  padding: 0.5rem;
  box-shadow: 0 20px 40px rgba(15,59,36,0.12), 0 4px 12px rgba(15,59,36,0.08);
  border: 1px solid rgba(15,59,36,0.06);
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transition: all 0.22s ease;
  z-index: 999;
}
.nav-dropdown::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 12px; height: 12px;
  background: #fff;
  border-left: 1px solid rgba(15,59,36,0.06);
  border-top: 1px solid rgba(15,59,36,0.06);
}
.nav-item-dropdown:hover > .nav-dropdown,
.nav-item-dropdown:focus-within > .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown li { list-style: none; }
.nav-dropdown a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.85rem;
  text-decoration: none;
  color: #1f2937;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 10px;
  transition: all 0.18s;
}
.nav-dropdown a:hover {
  background: linear-gradient(90deg, rgba(43,93,49,0.08), rgba(255,215,0,0.06));
  color: #0f3b24;
  transform: translateX(2px);
}
.nav-dropdown .dd-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-500, #2B5D31);
  flex-shrink: 0;
  margin-left: 4px;
  margin-right: 4px;
  transition: transform 0.18s, background 0.18s;
}
.nav-dropdown a:hover .dd-bullet {
  background: var(--gold-400, #FFD700);
  transform: scale(1.4);
}

/* Header actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.btn-connexion {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.4rem;
  background: linear-gradient(135deg, #FFD700 0%, #FFC107 100%);
  color: #0f3b24;
  border: 1.5px solid transparent;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.4;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  box-sizing: border-box;
  flex-shrink: 0;
}
.btn-connexion:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255,215,0,0.35);
  filter: brightness(1.05);
}
.btn-ghost {
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  background: transparent;
  color: #2B5D31;
  border: 1.5px solid rgba(43,93,49,0.25);
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-ghost:hover {
  border-color: #2B5D31;
  background: rgba(43,93,49,0.06);
}

/* "Demander un devis" button — ghost style with icon */
.btn-quote {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  background: transparent;
  color: #ffffff;
  border: 1.5px solid rgba(255,255,255,0.4);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  line-height: 1.4;
  transition: all 0.2s;
  white-space: nowrap;
  box-sizing: border-box;
  flex-shrink: 0;
}
.btn-quote:hover { border-color: #FFD700; color: #FFD700; background: transparent; }

/* On medium-sized screens (1200-1400px), collapse "Demander un devis" to icon-only
   so the header still has room for nav + login button without overflowing. */
@media (max-width: 1400px) {
  .btn-quote span { display: none; }
  .btn-quote { padding: 0.55rem 0.7rem; }
}

/* =====================================================================
   USER MENU (avatar + name + dropdown)
   ===================================================================== */
.user-menu {
  position: relative;
}

.user-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.75rem 0.35rem 0.4rem;
  background: rgba(43,93,49,0.06);
  border: 1.5px solid rgba(43,93,49,0.18);
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  color: #1d3f21;
  transition: all 0.18s ease;
  font-weight: 600;
  font-size: 0.88rem;
}
.user-trigger:hover {
  background: rgba(43,93,49,0.10);
  border-color: rgba(43,93,49,0.30);
}
.user-trigger:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(43,93,49,0.18);
}

.user-trigger-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2B5D31 0%, #1d3f21 100%);
  color: #FFD700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  box-shadow: inset 0 0 0 1.5px rgba(255,215,0,0.35);
  flex-shrink: 0;
  overflow: hidden;
}
.user-trigger-avatar img,
.user-dropdown-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.user-trigger-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-trigger-caret {
  font-size: 0.68rem;
  color: #6b7280;
  transition: transform 0.2s ease;
}
.user-menu.is-open .user-trigger-caret { transform: rotate(180deg); }

/* Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  background: #ffffff;
  border: 1px solid rgba(15,23,42,0.08);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(15,23,42,0.12), 0 4px 12px rgba(15,23,42,0.06);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 100;
  overflow: hidden;
}
.user-menu.is-open .user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, #f0f7f1 0%, #e8f1ea 100%);
  border-bottom: 1px solid rgba(15,23,42,0.06);
}

.user-dropdown-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2B5D31 0%, #1d3f21 100%);
  color: #FFD700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1.5px rgba(255,215,0,0.4);
  overflow: hidden;
}

.user-dropdown-id {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.user-dropdown-name {
  font-weight: 700;
  color: #0f172a;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-dropdown-email {
  color: #6b7280;
  font-size: 0.78rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.user-dropdown-role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 2px 8px;
  background: rgba(43,93,49,0.10);
  color: #2B5D31;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  width: max-content;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.user-dropdown-role i { font-size: 0.65rem; color: #FFD700; }

.user-dropdown-body {
  padding: 6px;
}

.user-dropdown-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  width: 100%;
  background: transparent;
  border: 0;
  border-radius: 8px;
  text-decoration: none;
  color: #1f2937;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.user-dropdown-link i {
  width: 16px;
  text-align: center;
  font-size: 0.86rem;
  color: #6b7280;
  transition: color 0.15s ease;
}
.user-dropdown-link:hover {
  background: rgba(43,93,49,0.06);
  color: #2B5D31;
}
.user-dropdown-link:hover i { color: #2B5D31; }
.user-dropdown-link.is-danger:hover {
  background: #fef2f2;
  color: #dc2626;
}
.user-dropdown-link.is-danger:hover i { color: #dc2626; }

.user-dropdown-sep {
  height: 1px;
  background: rgba(15,23,42,0.08);
  margin: 4px 4px;
}

.user-dropdown-logout { margin: 0; }

/* Hide name on small screens (keep only avatar) */
@media (max-width: 640px) {
  .user-trigger-name { display: none; }
  .user-trigger { padding: 0.3rem; }
  .user-trigger-caret { display: none; }
  .user-dropdown { min-width: 260px; }
  .btn-quote span { display: none; }
}

/* Mobile toggle */
.mobile-menu-toggle {
  display: none;
  width: 40px; height: 40px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.3rem;
  align-items: center;
  justify-content: center;
}
.mobile-menu-toggle:hover { background: rgba(255,215,0,0.15); border-color: rgba(255,215,0,0.4); color: #FFD700; }

/* Body padding compensated by sticky (no fixed offset) */
body { padding-top: 0; }

/* ============== RESPONSIVE ============== */
@media (max-width: 1280px) {
  .header-content { gap: 0.6rem; }
  .nav-list { gap: 0.05rem; }
  .nav-link { padding: 0.45rem 0.5rem; font-size: 0.85rem; }
}

@media (max-width: 1100px) {
  .logo-sub { display: none; }
  .btn-connexion { padding: 0.55rem 0.85rem; font-size: 0.85rem; }
}

@media (max-width: 960px) {
  .topbar-info { gap: 1rem; font-size: 0.78rem; }
  .topbar-info .topbar-info-item-secondary { display: none; }
}

@media (max-width: 880px) {
  .nav-area { display: none; }
  .mobile-menu-toggle { display: inline-flex; }

  .nav-area.nav-open {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0f3b24;
    border-top: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    padding: 1rem;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
  }
  .nav-area.nav-open .nav-list {
    flex-direction: column;
    gap: 0.25rem;
    align-items: stretch;
    width: 100%;
  }
  .nav-area.nav-open .nav-link {
    padding: 0.85rem 1rem;
    border-radius: 10px;
    font-size: 1rem;
  }
  .nav-area.nav-open .nav-dropdown {
    position: static !important;
    transform: none !important;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: 0;
    background: rgba(255,255,255,0.06);
    padding: 0.25rem;
    margin-top: 0.25rem;
    min-width: auto;
  }
  .nav-area.nav-open .nav-dropdown::before { display: none; }
  .nav-area.nav-open .nav-dropdown a { padding: 0.6rem 0.75rem; font-size: 0.9rem; color: #ffffff; }
  .nav-area.nav-open .nav-dropdown a:hover { background: rgba(255,215,0,0.15); color: #FFD700; }
}

@media (max-width: 600px) {
  .topbar-info-item-tertiary { display: none; }
  .logo-image-wrap { width: 44px; height: 44px; }
  .logo-main { font-size: 1.1rem; }
  .header-content { padding: 0.6rem 0; gap: 0.75rem; }
  .btn-connexion { padding: 0.5rem 0.85rem; font-size: 0.82rem; }
}
