/* ============================================================
   MOBILE-ONLY OVERRIDES
   Loaded LAST so it always wins (no !important hacks beyond what's needed
   to neutralise earlier @media rules).
   Strategy:
   - ≤ 980px : tablet — keep most layouts side-by-side but tighter
   - ≤ 720px : phone landscape — stack heros, shrink visuals
   - ≤ 480px : phone portrait — aggressive declutter
   ============================================================ */

/* ============ ≤ 980px : neutralise PC-only forcings ============ */
@media (max-width: 980px) {
  /* heros that were FORCED side-by-side: let them stack again */
  .ecc-sol-hero-inner,
  .ecc-sec-hero-inner {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .ecc-sol-hero h1,
  .ecc-sec-hero h1 { font-size: 42px; }

  /* PC nav is hidden by styles.css @ 980px — so swap in the burger */
  .ecc-mobile-burger {
    display: inline-flex !important;
    align-items: center; justify-content: center;
    width: 40px; height: 40px;
    background: var(--ecc-surface);
    border: 1px solid var(--ecc-line);
    border-radius: 10px;
    color: var(--ecc-ink-900);
    cursor: pointer;
  }
  .ecc-mobile-burger i { width: 18px; height: 18px; }
  .ecc-mobile-drawer.is-open { display: flex !important; }
}

/* ============ ≤ 720px : phone landscape ============ */
@media (max-width: 720px) {
  /* ===== HOME : remove the phone mockup entirely ===== */
  .ecc-hero-visual { display: none !important; }
  .ecc-hero-grid {
    grid-template-columns: 1fr !important;
  }

  /* ===== SOLUTIONS hero : remove the phone, center the CTA ===== */
  .ecc-sol-stage,
  .ecc-sol-stage--b,
  .ecc-sol-stage--b .ecc-sol-stage-dash,
  .ecc-sol-stage--b .ecc-sol-stage-phone-b { display: none !important; }
  .ecc-sol-hero-inner > div:first-child { text-align: center; }
  .ecc-sol-hero-inner > div:first-child > .ecc-pill { display: inline-flex; }
  .ecc-sol-hero-inner > div:first-child > div[style*="display: flex"] {
    justify-content: center !important;
  }

  /* ===== SECTEURS sector blocks : hide both dashboard AND phone on mobile ===== */
  .ecc-sector-head,
  .ecc-sector-head.is-reverse {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .ecc-sector-head > .ecc-sector-stage,
  .ecc-sector-head.is-reverse > .ecc-sector-stage { display: none !important; }
  .ecc-sector-stage,
  .ecc-sector-stage .ecc-dash,
  .ecc-sector-stage-phone,
  .ecc-sector-head.is-reverse .ecc-sector-stage-phone { display: none !important; }

  /* Make the meta column tighter so the layout fits */
  .ecc-sector-meta h2,
  .ecc-sector-meta h2 strong { font-size: 24px !important; line-height: 1.15; }
  .ecc-sector-meta .ecc-pitch-head { margin: 16px 0 12px; font-size: 11px; }
  .ecc-sector-meta .ecc-bens { gap: 8px; }
  .ecc-sector-meta .ecc-bens li { font-size: 14px; }

  /* ----- Header : tighter spacing on phone (burger already shown by ≤980px block) ----- */
  .ecc-header-inner { gap: 12px; padding: 0 16px; }
  .ecc-header-cta .ecc-link { display: none; }
  .ecc-header-cta { gap: 8px; }
  .ecc-header-cta .ecc-btn { padding: 9px 14px; font-size: 13px; }

  /* ----- Container padding ----- */
  .ecc-container { padding: 0 20px; }

  /* ----- Hero (Home) ----- */
  .ecc-hero { padding: 32px 0 56px; }
  .ecc-hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
    padding: 0 20px;
    text-align: center;
  }
  .ecc-hero-title { font-size: 36px; line-height: 1.08; }
  .ecc-hero-sub { font-size: 15px; margin-left: auto; margin-right: auto; }
  .ecc-hero-ctas { justify-content: center; }
  .ecc-hero-ctas .ecc-btn { flex: 1 1 auto; justify-content: center; }
  .ecc-pill { font-size: 11px; }

  /* shrink the phone mockup, hide floating side badges (too cluttered) */
  .ecc-phone-wrap { transform: scale(0.85); transform-origin: center; }
  .ecc-phone-badge-1,
  .ecc-phone-badge-2,
  .ecc-phone-badge-3 { display: none; }

  /* ----- Sub-heros (Solutions, Secteurs, FAQ, Blog, Legal, Demo) ----- */
  .ecc-sol-hero,
  .ecc-sec-hero,
  .ecc-faq-hero,
  .ecc-legal-hero,
  .ecc-demo-hero,
  .ecc-subhero { padding: 48px 0 32px; }

  .ecc-sol-hero h1,
  .ecc-sec-hero h1,
  .ecc-faq-hero h1,
  .ecc-legal-hero h1,
  .ecc-demo-hero h1,
  .ecc-subhero h1 { font-size: 32px; line-height: 1.08; }

  .ecc-sol-hero p,
  .ecc-sec-hero p,
  .ecc-faq-hero p,
  .ecc-legal-hero p,
  .ecc-demo-hero p,
  .ecc-subhero p { font-size: 15px; }

  .ecc-sol-hero-inner,
  .ecc-sec-hero-inner {
    padding: 0 20px;
    text-align: center;
  }
  .ecc-sol-hero-inner .ecc-toc,
  .ecc-sec-hero-inner .ecc-toc { justify-content: center !important; }

  /* Solutions hero — hide dashboard, show simpler phone-only visual */
  .ecc-sol-stage--b { aspect-ratio: auto; }
  .ecc-sol-stage--b .ecc-sol-stage-dash { display: none; }
  .ecc-sol-stage--b .ecc-sol-stage-phone-b {
    position: relative;
    right: auto; bottom: auto;
    transform: none;
    margin: 0 auto;
    display: block;
    width: 240px;
  }
  .ecc-sol-stage--b .ecc-sol-stage-phone-b .ecc-phone {
    width: 240px; height: 480px;
    border-radius: 32px; padding: 6px;
  }
  .ecc-sol-stage--b .ecc-sol-stage-phone-b .ecc-phone::before { width: 80px; height: 18px; top: 11px; }
  .ecc-sol-stage--b .ecc-sol-stage-phone-b .ecc-phone-screen {
    border-radius: 28px; padding: 38px 12px 14px; gap: 8px;
  }
  .ecc-sol-stage--b .ecc-sol-stage-phone-b .ecc-phone-orb-inner { width: 80px; height: 80px; }
  .ecc-sol-stage--b .ecc-sol-stage-phone-b .ecc-phone-orb-portrait { width: 96px; }
  .ecc-sol-stage--b .ecc-sol-stage-phone-b .ecc-phone-eyebrow { font-size: 9px; }
  .ecc-sol-stage--b .ecc-sol-stage-phone-b .ecc-phone-name { font-size: 14px; }
  .ecc-sol-stage--b .ecc-sol-stage-phone-b .ecc-phone-status { font-size: 10px; }

  /* Secteurs hero trio — stack as horizontal scroll */
  .ecc-sec-stage-trio {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .ecc-sec-trio-card { height: 200px; padding: 10px 6px; }
  .ecc-sec-trio-card img { height: 110px; }
  .ecc-sec-trio-card-name { font-size: 12px; margin-top: 8px; }
  .ecc-sec-trio-card-name small { font-size: 9px; }

  /* Sections — tighter padding */
  .ecc-section,
  .ecc-personas,
  .ecc-stats,
  .ecc-insight,
  .ecc-cta-final { padding: 56px 0; }
  .ecc-section-head { margin-bottom: 32px; }
  .ecc-section-head h2 { font-size: 28px !important; line-height: 1.1; }
  .ecc-subhead { font-size: 15px; }

  /* Features grid — 1 column */
  .ecc-features-grid,
  .ecc-features-grid--3col { grid-template-columns: 1fr !important; gap: 14px; }
  .ecc-feature { padding: 24px 22px; }
  .ecc-feature h3 { font-size: 20px; }
  .ecc-feature p { font-size: 14px; }

  /* Personas (Home) — 1 column */
  .ecc-agents-grid { grid-template-columns: 1fr !important; gap: 18px; }
  .ecc-agent-figure { height: 220px; }
  .ecc-agent-figure img { height: 220px; }
  .ecc-agent-name { font-size: 24px; }

  /* Voice note */
  .ecc-voice-note { flex-direction: column; text-align: center; padding: 18px; }

  /* Integrations marquee */
  .ecc-int-title { font-size: 18px; }
  .ecc-int-rail { grid-template-columns: 1fr; }
  .ecc-int-more {
    width: 100%; flex-direction: row; gap: 10px; padding: 12px;
    justify-content: center;
  }
  .ecc-int-more-lbl { margin-top: 0; }
  .ecc-int-marquee { height: 72px; }
  .ecc-int-logo svg { height: 30px; }

  /* Insight (dark block) */
  .ecc-insight-grid { grid-template-columns: 1fr !important; gap: 36px; }
  .ecc-insight-num { font-size: 80px; }
  .ecc-insight-copy { font-size: 16px; }
  .ecc-testi { padding: 44px 22px 22px; }
  .ecc-testi blockquote { font-size: 16px; line-height: 1.5; }
  .ecc-testi-mark { font-size: 48px; top: 10px; left: 18px; }
  .ecc-trust-row { margin-top: 40px; }
  .ecc-trust-logos { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .ecc-trust-logo { font-size: 14px; padding: 10px 6px; }
  .ecc-trust-logo small { font-size: 9px; }

  /* CTA final */
  .ecc-cta-final-inner { grid-template-columns: 1fr !important; gap: 36px; }
  .ecc-cta-final h2 { font-size: 30px !important; line-height: 1.1; }
  .ecc-cta-final-sub { font-size: 15px; }
  .ecc-form-mini { padding: 22px 18px 18px; }
  .ecc-form-row { grid-template-columns: 1fr !important; }

  /* Stats KPIs */
  .ecc-stats-head { grid-template-columns: 1fr !important; gap: 16px; }
  .ecc-stats-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .ecc-stat-num { font-size: 38px; }
  .ecc-stats-quote { font-size: 16px; padding: 16px 18px; }

  /* Sector blocks (Secteurs page) */
  .ecc-sector { padding: 64px 0; }
  .ecc-sector-head,
  .ecc-sector-head.is-reverse {
    grid-template-columns: 1fr !important;
    gap: 28px;
  }
  .ecc-sector-head.is-reverse > .ecc-sector-meta { order: 0; }
  .ecc-sector-head.is-reverse > .ecc-sector-stage { order: 0; }
  .ecc-sector-meta h2,
  .ecc-sector-meta h2 strong { font-size: 28px !important; line-height: 1.1; }
  .ecc-sector-stage .ecc-dash { transform: none !important; }
  .ecc-sector-stage-phone,
  .ecc-sector-head.is-reverse .ecc-sector-stage-phone {
    position: relative !important;
    right: auto !important; left: auto !important; bottom: auto !important;
    margin: -32px auto 0;
    transform: rotate(2deg);
  }
  .ecc-sector-feats { grid-template-columns: 1fr !important; }
  .ecc-pitch-head { font-size: 12px; }

  /* Sector integrations strip */
  .ecc-sec-int-ribbon {
    grid-template-columns: 1fr !important;
    padding: 22px;
    gap: 18px;
  }
  .ecc-sec-int-more { width: 100%; }

  /* Solutions split sections */
  .ecc-split { padding: 56px 0; }
  .ecc-split-inner {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
    padding: 0 20px;
  }
  .ecc-split.is-reverse .ecc-split-inner > :first-child { order: 0 !important; }
  .ecc-split-copy h2 { font-size: 28px; line-height: 1.1; }
  .ecc-split-copy > p { font-size: 15px; }
  .ecc-illus { min-height: 0; padding: 8px; aspect-ratio: auto; }
  .ecc-illus-card { padding: 18px; }
  .ecc-illus-pill {
    /* often clips on small screens */
    display: none !important;
  }

  /* Dashboards: simplify — hide sidebar, smaller padding */
  .ecc-dash {
    grid-template-columns: 1fr !important;
    aspect-ratio: auto;
  }
  .ecc-dash-side { display: none !important; }
  .ecc-dash-main { padding: 14px 16px; gap: 10px; }
  .ecc-dash-top h3 { font-size: 14px; }
  .ecc-dash-kpis { grid-template-columns: repeat(2, 1fr); }
  .ecc-dash-grid { grid-template-columns: 1fr; gap: 10px; }
  .ecc-dash-svg { height: 90px; }

  /* Footer — single column, centered */
  .ecc-footer { padding: 56px 0 24px; }
  .ecc-footer-grid {
    grid-template-columns: 1fr !important;
    gap: 32px;
    text-align: center;
  }
  .ecc-footer-brand { display: flex; flex-direction: column; align-items: center; }
  .ecc-footer-brand .ecc-logo img { height: 44px; }
  .ecc-footer-social { justify-content: center; }
  .ecc-footer-col ul { align-items: center; }
  .ecc-footer-base {
    flex-direction: column; gap: 12px; text-align: center;
    padding-top: 22px;
  }
  .ecc-footer-base-links { justify-content: center; gap: 14px; row-gap: 6px; }

  /* FAQ */
  .ecc-faq-search { padding: 12px 16px; gap: 10px; }
  .ecc-faq-search input { font-size: 14px; }
  .ecc-faq-cats { gap: 4px; }
  .ecc-faq-cat { padding: 6px 11px; font-size: 12px; }
  .ecc-faq-q { padding: 16px 18px; font-size: 15px; }
  .ecc-faq-a { padding: 0 18px 16px; }
  .ecc-faq-a p { font-size: 14px; }
  .ecc-faq-ask { padding: 24px 20px; gap: 24px; grid-template-columns: 1fr !important; }
  .ecc-faq-ask-l h3 { font-size: 24px; }
  .ecc-faq-ask-row { grid-template-columns: 1fr; }
  .ecc-faq-ask-form button[type="submit"] { width: 100%; justify-content: center; }

  /* Blog */
  .ecc-blog-empty { padding: 36px 22px; }
  .ecc-blog-soon-grid { grid-template-columns: 1fr !important; }

  /* Legal */
  .ecc-legal-inner { grid-template-columns: 1fr !important; gap: 24px; padding: 0 20px; }
  .ecc-legal-toc {
    position: static !important;
    background: var(--ecc-surface);
    border-radius: 12px;
    padding: 14px 16px;
  }
  .ecc-legal-content h2 { font-size: 20px; margin-top: 32px; }
  .ecc-legal-content p, .ecc-legal-content li { font-size: 14px; }
  .ecc-legal-content table { font-size: 12px; }
  .ecc-legal-content th, .ecc-legal-content td { padding: 8px 10px; }
  .ecc-legal-tabs { flex-wrap: wrap; }
  .ecc-legal-tabs a { font-size: 12px; padding: 7px 11px; }

  /* Demo */
  .ecc-demo-cine-frame { padding: 14px; border-radius: 18px; }
  .ecc-demo-cine-persona { width: 130px; right: -10px; bottom: -10px; }
  .ecc-demo-cine-meta { flex-direction: column; align-items: flex-start; gap: 10px; padding: 8px 4px 0; }
  .ecc-demo-cine-meta h2 { font-size: 20px; }
  .ecc-demo-cine-feats { grid-template-columns: 1fr !important; }
  .ecc-demo-tabs { gap: 4px; padding: 5px; flex-wrap: wrap; justify-content: center; }
  .ecc-demo-tab { padding: 7px 12px; font-size: 12px; }
}

/* ============ ≤ 480px : phone portrait (extreme declutter) ============ */
@media (max-width: 480px) {
  .ecc-logo span { display: none; }       /* keep logo mark only */
  .ecc-logo img { height: 34px; }

  .ecc-header-cta .ecc-btn { padding: 8px 12px; font-size: 12px; }
  .ecc-header-cta .ecc-btn i { display: none; }

  .ecc-hero-title { font-size: 30px; }
  .ecc-hero-sub { font-size: 14px; }

  /* phone mockup gets smaller still */
  .ecc-phone-wrap { transform: scale(0.7); }

  /* hide trust block on tiny screens — already get social proof from testimonial */
  .ecc-trust-row { display: none; }

  /* Secteurs trio — keep all 3 visible but tiny */
  .ecc-sec-trio-card { height: 140px; }
  .ecc-sec-trio-card img { height: 70px; }
  .ecc-sec-trio-card-name { font-size: 10px; gap: 0; }
  .ecc-sec-trio-card-name i { width: 12px; height: 12px; }
  .ecc-sec-trio-card-name small { display: none; }

  /* Solutions feature-strip pills — wrap cleanly */
  .ecc-sol-features-pill { font-size: 11px; padding: 8px 12px; }

  /* TOC chips */
  .ecc-toc-chip { font-size: 11px; padding: 7px 12px; }
  .ecc-toc-chip-ico { width: 22px; height: 22px; }
  .ecc-toc-chip-ico i { width: 12px; height: 12px; }

  /* Dashboard text squeeze */
  .ecc-dash { font-size: 11px; }
  .ecc-dash-kpi-num { font-size: 16px; }
  .ecc-dash-kpi-lbl { font-size: 9px; }
}

/* ============ Mobile drawer (works at any width when forced open) ============ */
.ecc-mobile-burger { display: none; }
.ecc-mobile-drawer {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  flex-direction: column;
  background: #fff;
  padding: 18px 20px 32px;
  overflow-y: auto;
}
.ecc-mobile-drawer-top {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ecc-line);
  margin-bottom: 20px;
}
.ecc-mobile-drawer-close {
  width: 40px; height: 40px;
  background: var(--ecc-surface);
  border: 1px solid var(--ecc-line);
  border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ecc-ink-900);
}
.ecc-mobile-drawer-close i { width: 18px; height: 18px; }
.ecc-mobile-section {
  margin-bottom: 18px;
}
.ecc-mobile-section-h {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--ecc-ink-400);
  margin: 0 0 8px;
  padding: 0 8px;
}
.ecc-mobile-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--ecc-ink-900);
  font-size: 15px; font-weight: 500;
  transition: background 220ms;
}
.ecc-mobile-link:hover { background: var(--ecc-surface); }
.ecc-mobile-link-ico {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.ecc-mobile-link-ico i { width: 16px; height: 16px; }
.ecc-mobile-drawer .ecc-btn {
  width: 100%;
  justify-content: center;
  margin-top: 18px;
}
body.is-drawer-open { overflow: hidden; }
