/*
 * Adforest – Mobile Bottom Navigation
 * Exclusivement visible sur mobile (max-width: 767px)
 * Design ultra-moderne avec glassmorphism, safe-area iOS/Android
 */

/* ── CSS Variables (overridable via Customizer live preview) ── */
:root {
  --abn-accent:      #6366f1;
  --abn-accent-rgb:  99, 102, 241;
  --abn-bg:          #ffffff;
  --abn-muted:       #94a3b8;
  --abn-cta-bg:      #6366f1;
  --abn-cta-txt:     #ffffff;
  --abn-height:      64px;
  --abn-radius:      20px 20px 0 0;
  --abn-cta-size:    52px;
  --abn-cta-lift:    20px;
  --abn-z:           9900;
  --abn-shadow:      0 -4px 24px rgba(0,0,0,.10), 0 -1px 0 rgba(0,0,0,.06);
}

/* ══════════════════════════════════════════════
   ONLY ON MOBILE — hidden on tablet+
   ══════════════════════════════════════════════ */
.abn-bar { display: none; }

@media (max-width: 767px) {

/* ── Make room at the bottom so content isn't hidden ── */
body {
  padding-bottom: calc(var(--abn-height) + env(safe-area-inset-bottom, 0px)) !important;
}

/* ── Bar wrapper ── */
.abn-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;

  /* Fixed to bottom */
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--abn-z);

  /* Dimensions */
  height: calc(var(--abn-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);

  /* Glassmorphism */
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);

  border-radius: var(--abn-radius);
  box-shadow: var(--abn-shadow);

  /* Slide-in animation */
  animation: abnSlideUp .45s cubic-bezier(.34,1.56,.64,1) both;
}

/* Fallback: no backdrop-filter */
@supports not (backdrop-filter: blur(1px)) {
  .abn-bar { background: var(--abn-bg); }
}

@keyframes abnSlideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ══════════════════════════════════════════════
   NAV ITEMS
   ══════════════════════════════════════════════ */
.abn-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  height: var(--abn-height);
  text-decoration: none !important;
  color: var(--abn-muted);
  transition: color .2s, transform .2s;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

/* Ripple effect on tap */
.abn-item::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 12px;
  background: rgba(var(--abn-accent-rgb), 0);
  transition: background .25s;
}
.abn-item:active::after {
  background: rgba(var(--abn-accent-rgb), .12);
}

/* Active item */
.abn-item.abn-active {
  color: var(--abn-accent);
}

/* Dot indicator on active */
.abn-item.abn-active .abn-icon::after {
  content: '';
  display: block;
  width: 4px;
  height: 4px;
  background: var(--abn-accent);
  border-radius: 50%;
  margin: 3px auto 0;
  animation: abnDotIn .3s ease;
}
@keyframes abnDotIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* Icon wrapper */
.abn-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 20px;
  line-height: 1;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}
.abn-item.abn-active .abn-icon { transform: translateY(-2px); }
.abn-item:active .abn-icon { transform: scale(.88); }

/* Label */
.abn-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .3px;
  line-height: 1;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52px;
  text-align: center;
}

/* Avatar (logged-in user) */
.abn-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid transparent;
  transition: border-color .2s;
}
.abn-item.abn-active .abn-avatar {
  border-color: var(--abn-accent);
}

/* ══════════════════════════════════════════════
   CTA BUTTON — Publier
   ══════════════════════════════════════════════ */
.abn-cta {
  color: var(--abn-cta-bg) !important;
  position: relative;
  z-index: 1;
  flex: 1.1;  /* slightly wider */
}
.abn-cta .abn-label { color: var(--abn-muted); font-weight: 700; }
.abn-cta.abn-active .abn-label { color: var(--abn-accent); }

.abn-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--abn-cta-size);
  height: var(--abn-cta-size);
  border-radius: 50%;

  /* Gradient background */
  background: linear-gradient(135deg, var(--abn-cta-bg), color-mix(in srgb, var(--abn-cta-bg) 70%, #8b5cf6));
  background: linear-gradient(135deg, var(--abn-cta-bg), var(--abn-cta-bg));  /* fallback */
  color: var(--abn-cta-txt);
  font-size: 22px;

  /* Lift above the bar */
  margin-top: calc(-1 * var(--abn-cta-lift) - 14px);

  /* Shadow ring */
  box-shadow:
    0 0 0 4px var(--abn-bg),
    0 8px 24px rgba(var(--abn-accent-rgb), .45),
    0 4px 8px rgba(0,0,0,.15);

  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s;
  will-change: transform;
}
.abn-cta:active .abn-cta-btn {
  transform: scale(.88);
  box-shadow: 0 0 0 4px var(--abn-bg), 0 4px 12px rgba(var(--abn-accent-rgb),.3);
}
/* Pulse animation on the CTA */
.abn-cta-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: inherit;
  opacity: 0;
  animation: abnPulse 2.5s cubic-bezier(.4,0,.6,1) infinite;
}
@keyframes abnPulse {
  0%,100% { transform: scale(1);   opacity: 0; }
  50%      { transform: scale(1.35); opacity: .25; }
}

/* ══════════════════════════════════════════════
   NOTIFICATION BADGE
   ══════════════════════════════════════════════ */
.abn-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 18px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #ef4444;
  color: #fff;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--abn-bg);
  line-height: 1;
  animation: abnBounce .4s cubic-bezier(.34,1.56,.64,1);
}
@keyframes abnBounce {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

/* ══════════════════════════════════════════════
   SAFE AREA — iOS home indicator
   ══════════════════════════════════════════════ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .abn-bar {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
}

/* ══════════════════════════════════════════════
   HIDE DEFAULT THEME FOOTER ON MOBILE
   (only while the bottom-nav is visible)
   ══════════════════════════════════════════════ */
.adt-copyright-section,
.adt-bottom-footer {
  margin-bottom: calc(var(--abn-height) + env(safe-area-inset-bottom, 8px)) !important;
}

/* ══════════════════════════════════════════════
   THEME COMPATIBILITY FIXES
   ══════════════════════════════════════════════ */

/* Prevent theme sticky footer from overlapping */
.adt-sticky-header ~ * { z-index: auto; }

/* WhatsApp / chat widget — push up if present */
.adt-whatsapp-btn,
.adt-chat-widget,
[class*="whatsapp"],
[class*="chat-button"],
[id*="tawkto"],
#launcher {
  bottom: calc(var(--abn-height) + env(safe-area-inset-bottom, 8px) + 12px) !important;
}

/* Cookiebot / cookie banner */
#CookiebotWidget,
.cookie-notice {
  bottom: calc(var(--abn-height) + env(safe-area-inset-bottom, 0px)) !important;
}

/* Overlay (for potential future dropdowns) */
.abn-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: calc(var(--abn-z) - 1);
  opacity: 0;
  transition: opacity .3s;
}
.abn-overlay.visible {
  display: block;
  opacity: 1;
}

} /* end @media (max-width: 767px) */

/* ══════════════════════════════════════════════
   HIDE BAR on tablet/desktop — extra safety
   ══════════════════════════════════════════════ */
@media (min-width: 768px) {
  .abn-bar,
  .abn-overlay {
    display: none !important;
  }
  body { padding-bottom: 0 !important; }
}
