/* ═══════════════════════════════════════════════
   Budget Famille — Global Styles v2.2.0
   Harmonisation visuelle de toutes les pages
   ═══════════════════════════════════════════════ */

/* ── Font ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── CSS Variables (matching homepage) ── */
:root {
  --bf-bg: #f7fbff;
  --bf-card: #fff;
  --bf-text: #071427;
  --bf-muted: #62718a;
  --bf-blue: #2563eb;
  --bf-cyan: #06b6d4;
  --bf-green: #10b981;
  --bf-purple: #7c3aed;
  --bf-border: rgba(20,43,82,.12);
  --bf-shadow: 0 24px 70px rgba(15,43,92,.13);
  --bf-soft: 0 14px 40px rgba(15,43,92,.09);
  --bf-radius: 18px;
  --bf-radius-sm: 12px;
}

/* ═══════════════════════════════════════
   1. HAMBURGER BUTTON (homepage mobile)
   ═══════════════════════════════════════ */

.bf-hamburger {
  display: none; /* hidden on desktop */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  z-index: 25;
  -webkit-tap-highlight-color: transparent;
}
.bf-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--bf-text);
  border-radius: 2px;
  transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .2s ease;
}
.bf-hamburger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.bf-hamburger.is-open span:nth-child(2) {
  opacity: 0;
}
.bf-hamburger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile drawer ── */
.bf-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: min(340px, 85vw);
  height: 100dvh;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 9999;
  transition: right .35s cubic-bezier(.4,0,.2,1);
  box-shadow: -20px 0 60px rgba(15,43,92,.15);
  overflow-y: auto;
}
.bf-drawer.is-open {
  right: 0;
}
.bf-drawer__inner {
  display: flex;
  flex-direction: column;
  padding: 80px 28px 40px;
  gap: 6px;
}
.bf-drawer__link {
  display: block;
  padding: 14px 16px;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--bf-text) !important;
  text-decoration: none !important;
  border-radius: var(--bf-radius-sm);
  transition: background .2s ease;
}
.bf-drawer__link:hover {
  background: rgba(37,99,235,.06);
  color: var(--bf-blue) !important;
}
.bf-drawer__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  padding: 14px 24px;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--bf-text), #17345f 48%, var(--bf-blue));
  box-shadow: 0 12px 28px rgba(7,20,39,.2);
  transition: transform .2s ease, box-shadow .2s ease;
}
.bf-drawer__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(7,20,39,.25);
}

/* ── Overlay ── */
.bf-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,20,39,.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}
.bf-drawer-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Show hamburger on mobile, hide nav links ── */
@media (max-width: 768px) {
  .bf-hamburger {
    display: flex;
  }
  /* Hide the desktop nav links in bfhome-nav */
  .bfhome-nav .bfhome-links {
    display: none !important;
  }
  /* Hide the desktop CTA button */
  .bfhome-nav .bfhome-navbtn {
    display: none !important;
  }
}


/* ═══════════════════════════════════════
   2. MEGAMENU HARMONISATION
   Style the WordPress MegaMenu to match
   the homepage aesthetic
   ═══════════════════════════════════════ */

/*
 * IMPORTANT: hardcoded colors (not var(--bf-text) etc.) because the
 * bfweb dark-theme overrides :root CSS variables on the App Web page,
 * which would make menu text white-on-white.
 */

/* ── Hero nav cleanup (CDN workaround) ── */
.bfhome-nav { display: none !important; }
.bfhome-hero { padding-top: 48px !important; }

/* Homepage hero must NOT overlap site header */
.bfhome-v6,
.bfhome-hero,
.bfhome-section {
  position: relative;
  z-index: 1 !important;
}

/* Ensure site header stays above ALL page content */
header.wp-block-template-part {
  z-index: 10000 !important;
  position: relative;
}

/* MegaMenu mobile: panel must be above everything */
[id^="mega-menu-wrap-"] {
  z-index: 10000 !important;
}
[id^="mega-menu-wrap-"] .mega-menu-toggle {
  z-index: 10001 !important;
  position: relative;
  pointer-events: auto !important;
}
[id^="mega-menu-wrap-"] > ul.mega-menu {
  z-index: 10002 !important;
}

/* Reset MegaMenu dark bar to modern light style */
[id^="mega-menu-wrap-"] {
  background: rgba(255,255,255,.92) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(20,43,82,.12) !important;
  box-shadow: 0 4px 20px rgba(15,43,92,.06) !important;
}

[id^="mega-menu-wrap-"] .mega-menu-toggle {
  background: rgba(255,255,255,.92) !important;
  border-bottom: 1px solid rgba(20,43,82,.12) !important;
}

[id^="mega-menu-wrap-"] .mega-menu-toggle .mega-toggle-blocks-center .mega-toggle-label,
[id^="mega-menu-wrap-"] .mega-menu-toggle .mega-toggle-block {
  color: #071427 !important;
}

/* Hamburger icon bars — must be dark on light background */
[id^="mega-menu-wrap-"] .mega-toggle-animated-slider .mega-toggle-animated-inner,
[id^="mega-menu-wrap-"] .mega-toggle-animated-slider .mega-toggle-animated-inner::before,
[id^="mega-menu-wrap-"] .mega-toggle-animated-slider .mega-toggle-animated-inner::after {
  background-color: #071427 !important;
}

/* Desktop menu links — use double-ID selector to beat MegaMenu generated CSS */
[id^="mega-menu-wrap-"] [id^="mega-menu-"] > li.mega-menu-item > a.mega-menu-link,
[id^="mega-menu-wrap-"] > ul.mega-menu > li.mega-menu-item > a.mega-menu-link {
  font-family: Inter, system-ui, -apple-system, sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #071427 !important;
  padding: 12px 16px !important;
  border-radius: 10px !important;
  transition: background .2s ease, color .2s ease !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  line-height: 1.4 !important;
}

[id^="mega-menu-wrap-"] [id^="mega-menu-"] > li.mega-menu-item > a.mega-menu-link:hover,
[id^="mega-menu-wrap-"] [id^="mega-menu-"] > li.mega-menu-item > a.mega-menu-link:focus,
[id^="mega-menu-wrap-"] > ul.mega-menu > li.mega-menu-item > a.mega-menu-link:hover,
[id^="mega-menu-wrap-"] > ul.mega-menu > li.mega-menu-item > a.mega-menu-link:focus {
  background: rgba(37,99,235,.06) !important;
  color: #2563eb !important;
}

[id^="mega-menu-wrap-"] [id^="mega-menu-"] > li.mega-current-menu-item > a.mega-menu-link,
[id^="mega-menu-wrap-"] > ul.mega-menu > li.mega-current-menu-item > a.mega-menu-link {
  color: #2563eb !important;
  background: rgba(37,99,235,.08) !important;
}

/* MegaMenu is now visible on ALL pages including homepage */


/* ═══════════════════════════════════════
   3. GLOBAL TYPOGRAPHY & BODY
   ═══════════════════════════════════════ */

/* Apply Inter font globally */
body:not(.bfhome-v6) {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Sub-page body background */
body:not(.home) {
  background:
    radial-gradient(circle at 8% 4%, rgba(6,182,212,.08), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(124,58,237,.07), transparent 30%),
    linear-gradient(180deg, #fff 0%, var(--bf-bg) 42%, #fff 100%) !important;
}

/* ── Page title styling ── */
.wp-block-post-title {
  font-family: Inter, system-ui, -apple-system, sans-serif !important;
  font-weight: 900 !important;
  color: var(--bf-text) !important;
  text-transform: none !important;
  letter-spacing: -0.02em !important;
  font-size: clamp(28px, 5vw, 42px) !important;
  text-align: center !important;
  margin-bottom: 8px !important;
  line-height: 1.15 !important;
}

/* Hide the default page title on sub-pages (content sections have their own) */
body:not(.home) .wp-block-post-title {
  display: none !important;
}


/* ═══════════════════════════════════════
   4. SUB-PAGE SECTIONS & CARDS
   Match the homepage card/section style
   ═══════════════════════════════════════ */

/* Section headings */
body:not(.home) .entry-content h2,
body:not(.home) .entry-content h3 {
  font-family: Inter, system-ui, -apple-system, sans-serif !important;
  color: var(--bf-text) !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
  line-height: 1.2 !important;
}

body:not(.home) .entry-content h2 {
  font-size: clamp(24px, 4vw, 36px) !important;
}

/* Section labels/badges (like "FONCTIONNALITÉS") */
body:not(.home) .entry-content .bf-section-badge,
body:not(.home) .entry-content [class*="badge"],
body:not(.home) .entry-content [class*="label-tag"] {
  font-family: Inter, system-ui, -apple-system, sans-serif !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  color: var(--bf-cyan) !important;
}

/* Content text */
body:not(.home) .entry-content p {
  font-family: Inter, system-ui, -apple-system, sans-serif !important;
  color: var(--bf-muted) !important;
  line-height: 1.7 !important;
  font-size: 15px !important;
}

/* Sub-page section containers (exclude bfweb app) */
body:not(.home) .entry-content > section:not(#bfweb-app),
body:not(.home) .entry-content > .wp-block-group {
  width: min(1180px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
  padding: 40px 0;
}

/* Feature cards on sub-pages (exclude bfweb app) */
body:not(.home) :not(#bfweb-app) > [class*="-card"],
body:not(.home) :not(#bfweb-app) > [class*="-feature"],
body:not(.home) .entry-content > .wp-block-column {
  background: var(--bf-card);
  border: 1px solid var(--bf-border);
  border-radius: var(--bf-radius) !important;
  box-shadow: var(--bf-soft);
  transition: transform .3s cubic-bezier(.4,0,.2,1), box-shadow .3s ease !important;
}

body:not(.home) :not(#bfweb-app) > [class*="-card"]:hover,
body:not(.home) :not(#bfweb-app) > [class*="-feature"]:hover {
  transform: translateY(-4px);
  box-shadow: var(--bf-shadow);
}

/* ── Buttons on sub-pages ── */
body:not(.home) .wp-block-button__link,
body:not(.home) a[class*="btn"],
body:not(.home) a[class*="cta"],
body:not(.home) a[class*="download"] {
  font-family: Inter, system-ui, -apple-system, sans-serif !important;
  font-weight: 800 !important;
  font-size: 14px !important;
  border-radius: 999px !important;
  padding: 12px 24px !important;
  transition: transform .2s ease, box-shadow .2s ease !important;
  text-decoration: none !important;
}

/* Primary buttons */
body:not(.home) .wp-block-button:not(.is-style-outline) .wp-block-button__link {
  color: #fff !important;
  background: linear-gradient(135deg, var(--bf-text), #17345f 48%, var(--bf-blue)) !important;
  box-shadow: 0 12px 28px rgba(7,20,39,.18) !important;
  border: none !important;
}

body:not(.home) .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(7,20,39,.25) !important;
}

/* Outline buttons */
body:not(.home) .wp-block-button.is-style-outline .wp-block-button__link {
  color: var(--bf-text) !important;
  background: transparent !important;
  border: 2px solid var(--bf-border) !important;
}

body:not(.home) .wp-block-button.is-style-outline .wp-block-button__link:hover {
  background: rgba(37,99,235,.06) !important;
  color: var(--bf-blue) !important;
  border-color: var(--bf-blue) !important;
}


/* ═══════════════════════════════════════
   5. PRICING CARDS (Premium page)
   ═══════════════════════════════════════ */

body:not(.home) [class*="pricing"],
body:not(.home) [class*="price-card"],
body:not(.home) [class*="plan-card"] {
  border-radius: var(--bf-radius) !important;
  border: 1px solid var(--bf-border) !important;
  box-shadow: var(--bf-soft) !important;
  overflow: hidden;
}

body:not(.home) [class*="pricing"][class*="recommend"],
body:not(.home) [class*="pricing"][class*="premium"],
body:not(.home) [class*="plan-card"][class*="recommend"] {
  border: 2px solid var(--bf-blue) !important;
  box-shadow: var(--bf-shadow) !important;
}


/* ═══════════════════════════════════════
   6. HERO SECTIONS (sub-pages)
   ═══════════════════════════════════════ */

body:not(.home) [class*="hero"],
body:not(.home) [class*="-page"] > [class*="hero"],
body:not(.home) .entry-content > section:first-child {
  border-radius: var(--bf-radius) !important;
  overflow: hidden;
}


/* ═══════════════════════════════════════
   7. FOOTER HARMONISATION
   ═══════════════════════════════════════ */

body:not(.home) footer,
body:not(.home) .wp-block-template-part footer {
  font-family: Inter, system-ui, -apple-system, sans-serif !important;
}


/* ═══════════════════════════════════════
   8. SCROLL REVEAL ANIMATIONS
   ═══════════════════════════════════════ */

.bf-reveal-target {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.4,0,.2,1), transform .7s cubic-bezier(.4,0,.2,1);
}

.bf-reveal-target.bf-revealed {
  opacity: 1;
  transform: translateY(0);
}


/* ═══════════════════════════════════════
   9. RESPONSIVE REFINEMENTS
   ═══════════════════════════════════════ */

@media (max-width: 768px) {
  /* MegaMenu mobile */
  [id^="mega-menu-wrap-"] .mega-menu-toggle {
    padding: 10px 16px !important;
  }

  [id^="mega-menu-wrap-"] > ul.mega-menu {
    background: rgba(255,255,255,.97) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
  }

  [id^="mega-menu-wrap-"] [id^="mega-menu-"] > li.mega-menu-item > a.mega-menu-link,
  [id^="mega-menu-wrap-"] > ul.mega-menu > li.mega-menu-item > a.mega-menu-link {
    padding: 14px 20px !important;
    font-size: 15px !important;
    border-radius: 0 !important;
    border-bottom: 1px solid rgba(20,43,82,.12) !important;
    color: #071427 !important;
  }

  /* Sub-page content */
  body:not(.home) .entry-content > section,
  body:not(.home) .entry-content > .wp-block-group {
    padding: 28px 0;
  }

  /* Better mobile spacing */
  body:not(.home) .wp-block-columns {
    gap: 16px !important;
  }
}

@media (max-width: 480px) {
  body:not(.home) .entry-content h2 {
    font-size: 22px !important;
  }
}


/* ═══════════════════════════════════════
   10. CLEANUP — Override WPCode leftovers
   ═══════════════════════════════════════ */

/* ═══════════════════════════════════════
   11. BFWEB APP — Reset global overrides
   The web app (#bfweb-app) has its own
   inline styles; global rules must not
   interfere.
   ═══════════════════════════════════════ */

#bfweb-app {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  overflow: hidden auto !important;
}

#bfweb-app h2,
#bfweb-app h3 {
  font-family: inherit !important;
  color: inherit !important;
  font-weight: inherit !important;
  letter-spacing: inherit !important;
  line-height: inherit !important;
  font-size: inherit !important;
  text-align: inherit !important;
}

#bfweb-app p {
  font-family: inherit !important;
  color: inherit !important;
  line-height: inherit !important;
  font-size: inherit !important;
}

#bfweb-app [class*="-card"],
#bfweb-app [class*="-feature"],
#bfweb-app .wp-block-column {
  background: inherit !important;
  border: inherit !important;
  border-radius: inherit !important;
  box-shadow: inherit !important;
  transition: inherit !important;
}

#bfweb-app [class*="-card"]:hover,
#bfweb-app [class*="-feature"]:hover {
  transform: none !important;
  box-shadow: inherit !important;
}

#bfweb-app section {
  width: auto !important;
  margin: inherit !important;
  padding: inherit !important;
}

#bfweb-app .wp-block-button__link,
#bfweb-app a[class*="btn"],
#bfweb-app a[class*="cta"] {
  font-family: inherit !important;
  font-weight: inherit !important;
  font-size: inherit !important;
  border-radius: inherit !important;
  padding: inherit !important;
}

#bfweb-app [class*="hero"] {
  border-radius: inherit !important;
  overflow: inherit !important;
}

/* Disable scroll-reveal on bfweb to prevent flash-of-invisible */
#bfweb-app.bf-reveal-target {
  opacity: 1 !important;
  transform: none !important;
}
