/**
 * Mobile bottom navigation bar + Expertise bottom sheet.
 *
 * Belectrotec mobile app-style quick nav. Floating glass pill anchored to
 * the bottom of the viewport on <= 900px, iOS tab-bar pattern adapted to
 * the industrial electrotechnical brand:
 *   - dark teal glass base (backdrop blur) with thin amber ring
 *   - thin animated amber "voltage" indicator that slides to the active cell
 *   - amber "Devis" cell with soft electrical glow
 *   - bottom sheet for the Expertise mega menu, with grabber + spring ease
 *
 * DOM is built by blt-nav.js; this file is styles only.
 */

/* ── Tokens ───────────────────────────────────────────────── */
:root {
  --blt-amber:        #FBAE29;
  --blt-amber-hot:    #E69315;
  --blt-amber-soft:   rgba(251, 174, 41, 0.14);
  --blt-amber-line:   rgba(251, 174, 41, 0.38);
  --blt-teal:         #0E202E;
  --blt-teal-glass:   rgba(14, 32, 46, 0.78);
  --blt-hair:         rgba(255, 255, 255, 0.08);
  --blt-hair-strong:  rgba(255, 255, 255, 0.14);
  --blt-ink-muted:    rgba(255, 255, 255, 0.62);
  --blt-spring:       cubic-bezier(0.22, 1, 0.36, 1);
  --blt-ease:         cubic-bezier(0.4, 0, 0.2, 1);
}

/* ══════════════════════════════════════════════════════════
 * 1. Bottom bar — floating glass pill
 * ══════════════════════════════════════════════════════════ */

.blt-bottombar {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  /* Pinned above everything — modals, drawers, scrims — so the user's
     quick-nav is never obscured on mobile. */
  z-index: 9998;
  display: none; /* flipped to block on <= 900px below */
  padding: 6px;
  background: var(--blt-teal-glass);
  border: 1px solid var(--blt-hair);
  border-radius: 26px;
  -webkit-backdrop-filter: blur(22px) saturate(180%);
          backdrop-filter: blur(22px) saturate(180%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 22px 48px rgba(0, 0, 0, 0.42),
    0 6px 14px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(251, 174, 41, 0.05);
  /* Visible immediately on load — no fade-in delay that makes the bar
     feel like it "arrives" after the rest of the page. */
  opacity: 1;
  transform: translateY(0);
  /* Hairline amber voltage line at the top — subtle brand signature */
  overflow: hidden;
}

.blt-bottombar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22%;
  right: 22%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--blt-amber-line) 50%,
    transparent 100%
  );
  pointer-events: none;
  opacity: 0.7;
}

.blt-bottombar.is-ready {
  opacity: 1;
  transform: translateY(0);
}

.blt-bottombar ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 2px;
  position: relative;
}

.blt-bottombar li {
  flex: 1 1 0;
  min-width: 0;
}

.blt-bottombar a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 4px 9px;
  color: var(--blt-ink-muted);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: 18px;
  -webkit-tap-highlight-color: transparent;
  /* Prevent the browser from adding the translucent blue tap overlay
     on iOS and Android — we provide our own press feedback below. */
  -webkit-touch-callout: none;
  user-select: none;
  transition:
    color 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.14s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform, background-color;
}

/* Tap feedback — subtle press that feels native on mobile. */
.blt-bottombar a:active {
  transform: scale(0.94);
  background: rgba(255, 255, 255, 0.04);
}

.blt-bottombar a svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.35s var(--blt-spring);
}

.blt-bottombar a span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 0.25s var(--blt-ease);
}

/* Voltage indicator — thin amber line above the active cell, radiating a faint glow */
.blt-bottombar a::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--blt-amber);
  border-radius: 2px;
  transform: translateX(-50%);
  opacity: 0;
  box-shadow: 0 0 10px rgba(251, 174, 41, 0.75);
  transition:
    width 0.45s var(--blt-spring),
    opacity 0.3s var(--blt-ease);
  pointer-events: none;
}

.blt-bottombar a:hover,
.blt-bottombar a:focus-visible {
  color: #fff;
  outline: none;
}

.blt-bottombar a.is-active {
  color: var(--blt-amber);
  background: var(--blt-amber-soft);
}

.blt-bottombar a.is-active::after {
  width: 22px;
  opacity: 1;
}

.blt-bottombar a.is-active svg {
  transform: translateY(-1px) scale(1.06);
}

.blt-bottombar a:active {
  transform: scale(0.94);
}

/* ── CTA cell — "Devis" ───────────────────────────────────── */
.blt-bottombar .blt-bb-cta {
  flex: 1.15 1 0; /* a touch wider to accommodate the rounded pill */
}

.blt-bottombar .blt-bb-cta a {
  color: var(--blt-teal);
  background: linear-gradient(180deg, var(--blt-amber) 0%, #F5A31A 100%);
  box-shadow:
    0 4px 12px rgba(251, 174, 41, 0.38),
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 -1px 0 rgba(0, 0, 0, 0.12) inset;
  font-weight: 600;
}

.blt-bottombar .blt-bb-cta a::after {
  display: none; /* CTA doesn't need the voltage indicator */
}

.blt-bottombar .blt-bb-cta a:hover,
.blt-bottombar .blt-bb-cta a:focus-visible,
.blt-bottombar .blt-bb-cta a.is-active {
  color: var(--blt-teal);
  background: linear-gradient(180deg, var(--blt-amber-hot) 0%, #D18410 100%);
}

.blt-bottombar .blt-bb-cta a svg {
  stroke-width: 2;
}

/* ── Visibility breakpoints ───────────────────────────────── */
@media (max-width: 900px) {
  .blt-bottombar {
    display: block;
  }
}

@media (min-width: 901px) {
  .blt-bottombar,
  .blt-sheet,
  .blt-sheet-scrim {
    display: none !important;
  }
}

/* Narrow phones — tighten sizing so 5 cells still fit at 320px */
@media (max-width: 360px) {
  .blt-bottombar {
    left: 8px;
    right: 8px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    border-radius: 22px;
    padding: 5px;
  }
  .blt-bottombar a {
    padding: 9px 2px 8px;
    font-size: 10px;
  }
  .blt-bottombar a svg {
    width: 20px;
    height: 20px;
  }
}

/* Hide labels on very short viewports (landscape phone) to avoid cramp */
@media (max-height: 500px) and (max-width: 900px) {
  .blt-bottombar a {
    padding: 8px 4px;
  }
  .blt-bottombar a span {
    display: none;
  }
}

/* ══════════════════════════════════════════════════════════
 * 2. Viewport-boundary hygiene — make sure the three nav modes
 *    (desktop nav-links, tablet burger, phone bottombar) never
 *    show simultaneously at boundary widths.
 *
 *    Breakpoints:
 *      ≥ 1025 px  → desktop: nav-links + nav-cta visible
 *      901–1024   → tablet: burger (drawer on tap)
 *      ≤ 900 px   → phone: bottombar is primary (burger hidden)
 * ══════════════════════════════════════════════════════════ */

/* Phones: hide the legacy burger/drawer so the bottombar owns the nav. */
@media (max-width: 900px) {
  .blt-burger,
  .blt-drawer,
  .blt-drawer-scrim {
    display: none !important;
  }
}

/* Tablets + phones: force-hide the desktop nav-links and nav-cta so
   the burger/bottombar is the only nav UI. The built global.css rule
   lives inside `@layer base`, so any unlayered `display:flex` on the
   element wins — these explicit !important overrides settle it. */
@media (max-width: 1024px) {
  #nav .nav-links,
  .nav .nav-links {
    display: none !important;
  }
  #nav .nav-cta,
  .nav .nav-cta {
    display: none !important;
  }
}

/* ══════════════════════════════════════════════════════════
 * 3. Expertise bottom sheet (opens from "Expertise" cell)
 * ══════════════════════════════════════════════════════════ */

.blt-sheet-scrim {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--blt-ease), visibility 0s linear 0.4s;
}

.blt-sheet-scrim.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s var(--blt-ease);
}

.blt-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 72;
  display: flex;
  flex-direction: column;
  max-height: 86vh;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  color: #fff;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(251, 174, 41, 0.08) 0%, transparent 55%),
    var(--blt-teal);
  border-top: 1px solid var(--blt-hair-strong);
  border-radius: 26px 26px 0 0;
  overflow: hidden;
  box-shadow: 0 -24px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform 0.55s var(--blt-spring);
}

.blt-sheet.is-open {
  transform: translateY(0);
}

.blt-sheet-grabber {
  width: 44px;
  height: 4px;
  margin: 10px auto 0;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 2px;
  flex-shrink: 0;
}

.blt-sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px 12px;
  flex-shrink: 0;
}

.blt-sheet-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--blt-amber);
  font-family: Inter, sans-serif;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.blt-sheet-kicker::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 1px;
  background: currentColor;
}

.blt-sheet-title {
  margin: 6px 0 0;
  font-family: Inter, sans-serif;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.blt-sheet-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--blt-hair);
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition:
    background 0.22s var(--blt-ease),
    border-color 0.22s var(--blt-ease),
    color 0.22s var(--blt-ease),
    transform 0.22s var(--blt-ease);
}

.blt-sheet-close:hover,
.blt-sheet-close:focus-visible {
  color: var(--blt-amber);
  background: rgba(251, 174, 41, 0.14);
  border-color: rgba(251, 174, 41, 0.42);
  outline: none;
}

.blt-sheet-close:active {
  transform: scale(0.94);
}

.blt-sheet-close svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
}

.blt-sheet-body {
  flex: 1 1 auto;
  overflow-y: auto;
  /* Bottom padding clears the floating bottombar (~72px tall, pinned
     14px above the viewport bottom + the iOS safe-area inset). Without
     this the last sheet card / the "Voir tous les services" CTA slide
     under the bar and can't be tapped. */
  padding: 4px 14px calc(96px + env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.blt-sheet-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}

.blt-sheet-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 14px;
  color: inherit;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 16px;
  -webkit-tap-highlight-color: transparent;
  transition:
    background 0.22s var(--blt-ease),
    border-color 0.22s var(--blt-ease),
    transform 0.22s var(--blt-ease);
}

.blt-sheet-card:hover,
.blt-sheet-card:active {
  background: rgba(251, 174, 41, 0.08);
  border-color: rgba(251, 174, 41, 0.28);
}

.blt-sheet-card:active {
  transform: scale(0.99);
}

.blt-sheet-card-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--blt-amber);
  background: rgba(251, 174, 41, 0.1);
  border: 1px solid rgba(251, 174, 41, 0.22);
  border-radius: 12px;
}

.blt-sheet-card-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: square;
  stroke-linejoin: round;
}

.blt-sheet-card-body {
  flex: 1 1 auto;
  min-width: 0;
}

.blt-sheet-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #fff;
  font-family: Inter, sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.blt-sheet-card-title svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  fill: none;
  stroke: rgba(251, 174, 41, 0.75);
  stroke-width: 2;
  stroke-linecap: square;
  transition: transform 0.25s var(--blt-ease);
}

.blt-sheet-card:hover .blt-sheet-card-title svg,
.blt-sheet-card:active .blt-sheet-card-title svg {
  transform: translateX(3px);
}

.blt-sheet-card-desc {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-family: Inter, sans-serif;
  font-size: 13px;
  font-weight: 300;
  line-height: 1.55;
}

.blt-sheet-featured {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 4px 6px;
  padding: 18px 18px;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, rgba(251, 174, 41, 0.18) 0%, rgba(251, 174, 41, 0.05) 100%);
  border: 1px solid rgba(251, 174, 41, 0.34);
  border-radius: 16px;
  transition:
    background 0.25s var(--blt-ease),
    border-color 0.25s var(--blt-ease);
}

.blt-sheet-featured:hover,
.blt-sheet-featured:active {
  background: linear-gradient(135deg, rgba(251, 174, 41, 0.26) 0%, rgba(251, 174, 41, 0.08) 100%);
  border-color: rgba(251, 174, 41, 0.54);
}

.blt-sheet-featured-label {
  font-family: Inter, sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
}

.blt-sheet-featured-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  color: var(--blt-amber);
  font-family: Inter, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.blt-sheet-featured-arrow svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: square;
}

body.blt-sheet-open {
  overflow: hidden;
}

/* Reduced-motion — swap spring transitions for short linear ones */
@media (prefers-reduced-motion: reduce) {
  .blt-bottombar,
  .blt-bottombar a,
  .blt-bottombar a svg,
  .blt-bottombar a::after,
  .blt-sheet,
  .blt-sheet-card,
  .blt-sheet-card-title svg,
  .blt-sheet-close {
    transition-duration: 0.12s !important;
    transition-timing-function: linear !important;
  }
}
