/* ═══════════════════════════════════════════════════════
   TechDomicile — Navigation partagée
   ═══════════════════════════════════════════════════════ */

/* ── PROGRESS BAR ────────────────────────────────────────── */
#scroll-progress {
  position: fixed; top: 0; left: 0; height: 2px; z-index: 9999;
  background: linear-gradient(90deg, #2b5ce6, #7ba3f8);
  width: 0%; transition: width 0.1s linear;
  pointer-events: none;
}

/* ── NAV BASE ────────────────────────────────────────────── */
#main-nav {
  position: sticky; top: 0; z-index: 500;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid rgba(0,0,0,0.07);
  transition: box-shadow 0.3s, background 0.3s;
}
#main-nav.scrolled {
  background: rgba(255,255,255,0.95);
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}

.nav-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 0 2rem; height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
}

/* ── LOGO ────────────────────────────────────────────────── */
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.2rem; letter-spacing: -0.02em;
  color: #0c0c0c; text-decoration: none; flex-shrink: 0;
}
.nav-logo-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: #0c0c0c;
  display: flex; align-items: center; justify-content: center;
}
.nav-logo-icon svg { color: #fff; }
.nav-logo span { color: #2b5ce6; }

/* ── CENTER LINKS ────────────────────────────────────────── */
.nav-center {
  display: flex; align-items: center; gap: 0.25rem; flex: 1; justify-content: center;
}
.nav-item { position: relative; }
.nav-link {
  display: flex; align-items: center; gap: 4px;
  padding: 0.5rem 0.75rem; border-radius: 8px;
  font-size: 0.875rem; color: #71717a; font-weight: 400;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.nav-link:hover { color: #0c0c0c; background: rgba(0,0,0,0.04); }
.nav-link.active { color: #0c0c0c; font-weight: 500; }
.nav-chevron { transition: transform 0.2s; }
.nav-item:hover .nav-chevron { transform: rotate(180deg); }

/* ── SERVICES DROPDOWN ───────────────────────────────────── */

/* Bridge invisible entre le lien nav et le dropdown pour éviter
   que la souris "tombe dans le vide" et ferme le menu */
.nav-item::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -20px;
  right: -20px;
  height: 14px; /* couvre le gap de 10px + marge */
}

.nav-dropdown {
  position: absolute; top: calc(100% + 10px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 560px;
  background: #fff; border: 1px solid rgba(0,0,0,0.08);
  border-radius: 16px; padding: 1.25rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.1), 0 4px 16px rgba(0,0,0,0.06);
  opacity: 0; visibility: hidden;
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  pointer-events: none;
}
.nav-item:hover .nav-dropdown,
.nav-dropdown:hover {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.nav-dropdown-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem;
}
.nav-dd-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 0.6rem 0.7rem; border-radius: 10px;
  text-decoration: none; color: #0c0c0c;
  transition: background 0.15s;
}
.nav-dd-item:hover { background: #f4f4f5; }
.nav-dd-icon {
  width: 28px; height: 28px; border-radius: 7px;
  background: #eff4ff; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.nav-dd-icon svg { color: #2b5ce6; }
.nav-dd-name { font-size: 0.82rem; font-weight: 500; display: block; line-height: 1.2; }
.nav-dd-desc { font-size: 0.72rem; color: #71717a; font-weight: 300; margin-top: 1px; }
.nav-dropdown-footer {
  margin-top: 1rem; padding-top: 1rem;
  border-top: 1px solid rgba(0,0,0,0.07);
  display: flex; justify-content: space-between; align-items: center;
}
.nav-dropdown-footer span { font-size: 0.78rem; color: #71717a; font-weight: 300; }
.nav-dd-cta {
  font-size: 0.78rem; font-weight: 500; color: #2b5ce6; text-decoration: none;
  display: flex; align-items: center; gap: 4px;
}
.nav-dd-cta:hover { text-decoration: underline; }

/* ── RIGHT ACTIONS ───────────────────────────────────────── */
.nav-right {
  display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0;
}
.nav-phone {
  font-size: 0.82rem; color: #71717a; font-weight: 400;
  text-decoration: none; letter-spacing: 0.01em;
  transition: color 0.2s;
}
.nav-phone:hover { color: #0c0c0c; }
.nav-cta-btn {
  background: #0c0c0c; color: #fff;
  padding: 0.5rem 1.1rem; border-radius: 100px;
  font-size: 0.82rem; font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
  white-space: nowrap;
}
.nav-cta-btn:hover { background: #2b5ce6; }

/* ── HAMBURGER ───────────────────────────────────────────── */
.nav-hamburger {
  display: none; background: none; border: none;
  cursor: pointer; padding: 6px; color: #0c0c0c;
  border-radius: 8px;
  transition: background 0.2s;
}
.nav-hamburger:hover { background: rgba(0,0,0,0.06); }
.ham-bar {
  display: block; width: 20px; height: 1.5px;
  background: currentColor; border-radius: 2px;
  transition: transform 0.3s cubic-bezier(.22,1,.36,1), opacity 0.2s;
  transform-origin: center;
}
.ham-bar + .ham-bar { margin-top: 5px; }
.nav-hamburger.open .ham-bar:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger.open .ham-bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.open .ham-bar:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── MOBILE OVERLAY ──────────────────────────────────────── */
.mobile-overlay {
  position: fixed; inset: 0; z-index: 600;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: opacity 0.35s, visibility 0.35s;
}
.mobile-overlay.open { opacity: 1; visibility: visible; }

/* ── MOBILE PANEL ────────────────────────────────────────── */
.mobile-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(400px, 88vw);
  background: #fff; z-index: 700;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(.22,1,.36,1);
  overflow-y: auto; overflow-x: hidden;
  box-shadow: -20px 0 60px rgba(0,0,0,0.12);
}
.mobile-panel.open { transform: translateX(0); }

/* Panel header */
.mobile-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
.mobile-close {
  width: 36px; height: 36px; border-radius: 50%;
  background: #f4f4f5; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #0c0c0c; transition: background 0.2s;
}
.mobile-close:hover { background: #e4e4e7; }

/* Panel links */
.mobile-links { flex: 1; padding: 0.75rem 0; }
.mobile-link-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.95rem 1.5rem;
  font-size: 1.05rem; font-weight: 500; color: #0c0c0c;
  text-decoration: none; border-bottom: 1px solid rgba(0,0,0,0.05);
  transition: background 0.15s, color 0.15s;
}
.mobile-link-item:hover { background: #f9f9f8; color: #2b5ce6; }
.mobile-link-item.active { color: #2b5ce6; }
.mobile-link-num {
  font-size: 0.7rem; color: #a1a1aa; font-weight: 400;
  font-family: 'DM Serif Display', serif; margin-right: 1rem;
}

/* Services accordion */
.mobile-services-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 0.95rem 1.5rem;
  font-size: 1.05rem; font-weight: 500; color: #0c0c0c;
  background: none; border: none; border-bottom: 1px solid rgba(0,0,0,0.05);
  cursor: pointer; text-align: left;
  transition: background 0.15s;
}
.mobile-services-toggle:hover { background: #f9f9f8; }
.mobile-services-toggle svg { transition: transform 0.3s; flex-shrink: 0; }
.mobile-services-toggle.expanded svg { transform: rotate(180deg); }
.mobile-services-sub {
  display: none; background: #f9f9f8;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.mobile-services-sub.open { display: block; }
.mobile-sub-item {
  display: flex; align-items: center; gap: 10px;
  padding: 0.75rem 1.5rem 0.75rem 2rem;
  font-size: 0.9rem; color: #3f3f46; font-weight: 400;
  text-decoration: none;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  transition: color 0.15s, background 0.15s;
}
.mobile-sub-item:last-child { border-bottom: none; }
.mobile-sub-item:hover { color: #2b5ce6; background: #eff4ff; }
.mobile-sub-icon {
  width: 24px; height: 24px; border-radius: 6px;
  background: #eff4ff; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.mobile-sub-icon svg { color: #2b5ce6; }

/* Panel footer */
.mobile-panel-foot {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(0,0,0,0.07);
  background: #f9f9f8;
}
.mobile-foot-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: #a1a1aa; font-weight: 500; margin-bottom: 0.85rem; }
.mobile-foot-btns { display: flex; gap: 0.65rem; }
.mobile-foot-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0.75rem 0.5rem; border-radius: 12px;
  font-size: 0.82rem; font-weight: 500; text-decoration: none;
  transition: opacity 0.2s;
}
.mobile-foot-btn:hover { opacity: 0.85; }
.mobile-wa { background: #25d366; color: #fff; }
.mobile-call { background: #0c0c0c; color: #fff; }
.mobile-hours { font-size: 0.72rem; color: #a1a1aa; text-align: center; margin-top: 0.75rem; }

/* ── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-center, .nav-phone { display: none; }
  .nav-hamburger { display: flex; flex-direction: column; justify-content: center; }
}
@media (max-width: 480px) {
  .nav-inner { padding: 0 1rem; }
  .nav-cta-btn { display: none; }
}
