/* =====================================================================
   Doctor Manager — Floating Navbar + Megamenu (Loïc, DM-6482, 2026)
   Self-contained, namespaced under .dm-nav-wrap. Light theme only.
   ===================================================================== */

:root {
    --dm-mod-active: #FFFFFF;
    --dm-mod-consultation: #30A3F1;
    --dm-mod-consultation-subtle: rgba(56, 159, 255, 0.20);
    --dm-mod-services: #009083;
    --dm-mod-services-subtle: rgba(0, 144, 131, 0.20);
    --dm-mod-calendar: #FF6B00;
    --dm-mod-calendar-subtle: rgba(255, 107, 0, 0.20);
    --dm-mod-extras: #C85CDB;
    --dm-mod-extras-subtle: rgba(200, 92, 219, 0.20);
    --dm-mod-neutral: #003A61;
    --dm-mod-neutral-subtle: rgba(0, 58, 97, 0.20);
    --dm-nav-radius: 16px;
    --dm-nav-h: 66px;
    --dm-nav-gap: 25px;
    --dm-shadow-low: 0 0.1px 3px 0 rgba(52, 93, 158, 0.20);
    --dm-shadow-mid: 0 5px 25px 2px rgba(0, 0, 0, 0.10);
    --dm-grad-border: linear-gradient(151deg, rgba(162, 214, 249, 0.40) 2.35%, rgba(16, 56, 83, 0.20) 48.94%, rgba(162, 214, 249, 0.40) 100.22%);
    --dm-nav-font: 'Nunito Sans', 'Nunito', sans-serif;
}

/* Remove the legacy fixed <header> box so .dm-nav-wrap is the real element */
header.navbar-deskop,
header.navbar-mobile { display: contents; }

/* ---- Backdrop blur surface (sits behind the pill, blurs scrolled content) ---- */
.dm-nav-wrap {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1050;
    pointer-events: none; /* only the pill captures events */
}
.dm-nav-blur {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 100px;
    background: linear-gradient(180deg, rgba(14, 111, 177, 0.25) 8%, rgba(22, 141, 221, 0.00) 70%);
    -webkit-backdrop-filter: blur(12.5px);
    backdrop-filter: blur(12.5px);
    /* fade the blur itself out toward the bottom so there's no hard cut on scroll (progressive blur), extended lower */
    -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 42%, rgba(0,0,0,0) 100%);
            mask-image: linear-gradient(180deg, #000 0%, #000 42%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}

/* ---- The floating pill (navbar + expandable megamenu) ---- */
.dm-nav {
    pointer-events: auto;
    position: relative;
    width: calc(100% - var(--dm-nav-gap) * 2);
    max-width: 1920px;
    margin: var(--dm-nav-gap) auto 0;
    border-radius: var(--dm-nav-radius);
    /* white fill + 1.5px gradient inner border via double background */
    background:
        linear-gradient(#fff, #fff) padding-box,
        var(--dm-grad-border) border-box;
    border: 1.5px solid transparent;
    box-shadow: var(--dm-shadow-low);
    transition: box-shadow .25s ease;
    font-family: var(--dm-nav-font);
}
.dm-nav:hover,
.dm-nav.is-open { box-shadow: var(--dm-shadow-mid); }

/* ---- Top bar (66px) ---- */
.dm-nav-bar {
    position: relative;
    height: var(--dm-nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
}
.dm-nav-logo { display: flex; align-items: center; }
.dm-nav-logo img { height: 40px; width: auto; display: block; }

/* center nav — absolutely centered in the pill */
.dm-nav-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 6px;
}
.dm-nav-item {
    appearance: none;
    border: 0;
    background: transparent;
    font-family: var(--dm-nav-font);
    font-size: 16px;
    font-weight: 600;
    color: #5a6b7b;
    text-decoration: none;
    padding: 9px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
    line-height: 1;
}
.dm-nav-item:hover { color: var(--dm-mod-consultation); }
.dm-nav-trigger.is-active,
.dm-nav-trigger:hover {
    background: var(--dm-mod-consultation-subtle);
    color: var(--dm-mod-consultation);
}

/* right actions */
.dm-nav-actions { display: flex; align-items: center; gap: 12px; }

.dm-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--dm-nav-font);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 10px;
    padding: 10px 18px;
    line-height: 1;
    transition: all .18s ease;
    white-space: nowrap;
}
.dm-nav-btn-outline {
    color: var(--dm-mod-consultation);
    border: 1.5px solid var(--dm-mod-consultation);
    background: #fff;
}
.dm-nav-btn-outline:hover { background: var(--dm-mod-consultation-subtle); color: var(--dm-mod-consultation); }
.dm-nav-btn-primary {
    color: #fff;
    background: var(--dm-mod-consultation);
    border: 1.5px solid var(--dm-mod-consultation);
}
.dm-nav-btn-primary:hover { background: #1f8fe0; border-color: #1f8fe0; color: #fff; }

/* language switcher (reuses existing .lang-* logic, restyled compact) */
.dm-nav .lang-switcher { position: relative; }
.dm-nav .lang-current { cursor: pointer; display: flex; align-items: center; }
.dm-nav .lang-current .lang-flag { width: 26px; height: 26px; border-radius: 50%; display: block; }
.dm-nav .lang-dropdown {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--dm-shadow-mid);
    padding: 8px;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all .18s ease;
    z-index: 5;
}
.dm-nav .lang-switcher:hover .lang-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
.dm-nav .lang-option {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 8px; text-decoration: none;
    color: #1c2a36; font-size: 14px; font-weight: 600;
}
.dm-nav .lang-option:hover { background: var(--dm-mod-consultation-subtle); }
.dm-nav .lang-option .lang-flag { width: 20px; height: 20px; border-radius: 50%; }
.dm-nav .lang-option .lang-check { margin-left: auto; color: var(--dm-mod-consultation); font-size: 12px; }
.dm-nav .lang-option:not(.active) .lang-check { display: none; }

/* =====================================================================
   Expandable megamenu (desktop)
   ===================================================================== */
/* Height-based reveal driven by JS (mega.style.height = inner height).
   The inner is always full-size; the wrapper clips it and grows to exactly
   its height → ONE smooth motion, content revealed naturally top-to-bottom,
   the 4px bottom border appears only at the end. */
.dm-mega {
    height: 0;
    overflow: hidden;
    transition: height .3s ease;
}
.dm-mega-inner {
    padding: 6px 30px 24px;
    border-bottom: 4px solid var(--dm-mod-neutral);
    border-radius: 0 0 var(--dm-nav-radius) var(--dm-nav-radius);
}

.dm-mega-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0 22px;
}
.dm-mega-col { grid-column: span 2; }            /* 4 cols × col-lg-2 = 8 */
.dm-mega-frame { grid-column: span 4; }          /* illustrative frame = 4 */

/* fixed header height so all 4 columns' links start at the SAME line,
   even when a subtitle wraps to 2 lines */
.dm-mega-head { margin-bottom: 14px; min-height: 50px; }
.dm-mega-head h4 {
    font-family: var(--dm-nav-font);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--dm-mod-neutral);
    margin: 0 0 3px;
    line-height: 1.2;
}
.dm-mega-head p {
    font-family: var(--dm-nav-font);
    font-size: 11.5px;
    font-weight: 400;
    color: #8a98a6;
    margin: 0;
    line-height: 1.35;
}

/* fixed-height row slots → rows align across columns; the snug link pill is centered
   in its slot (so a single-line label keeps a tight hover bg, a 2-line one fills the slot) */
.dm-mega-links { display: grid; grid-auto-rows: 50px; row-gap: 2px; align-items: center; }
.dm-mega-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    border-radius: 10px;
    padding: 7px;                 /* even space around the icon (top = bottom = left) → snug hover pill */
    margin-left: -7px;            /* = -padding so the icon square's left edge lines up exactly with the column title above */
    transition: background .16s ease;
}
.dm-mega-ico {
    flex: 0 0 26px;
    width: 26px; height: 26px;
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
    transition: background .16s ease, color .16s ease;
}
.dm-mega-link .dm-mega-label {
    font-family: var(--dm-nav-font);
    font-size: 14.5px;
    font-weight: 600;
    color: #2a3744;
    line-height: 1.2;
    transition: color .15s ease;
}

/* per-column icon theming (idle) */
.dm-col-consultation .dm-mega-ico { background: var(--dm-mod-consultation-subtle); color: var(--dm-mod-consultation); }
.dm-col-services    .dm-mega-ico { background: var(--dm-mod-services-subtle);    color: var(--dm-mod-services); }
.dm-col-calendar    .dm-mega-ico { background: var(--dm-mod-calendar-subtle);    color: var(--dm-mod-calendar); }
.dm-col-extras      .dm-mega-ico { background: var(--dm-mod-extras-subtle);      color: var(--dm-mod-extras); }
.dm-col-neutral     .dm-mega-ico { background: var(--dm-mod-neutral-subtle);     color: var(--dm-mod-neutral); }

/* HOVER (Figma): row takes the module's light tint, the ICON SQUARE deepens to the
   solid module color with a white glyph, and the label takes the module color. No border. */
.dm-col-consultation .dm-mega-link:hover { background: rgba(56, 159, 255, 0.10); }
.dm-col-services     .dm-mega-link:hover { background: rgba(0, 144, 131, 0.10); }
.dm-col-calendar     .dm-mega-link:hover { background: rgba(255, 107, 0, 0.10); }
.dm-col-extras       .dm-mega-link:hover { background: rgba(200, 92, 219, 0.10); }
.dm-col-neutral      .dm-mega-link:hover { background: rgba(0, 58, 97, 0.10); }

.dm-col-neutral      .dm-mega-link:hover .dm-mega-ico { background: var(--dm-mod-neutral); color: #fff; }
.dm-col-neutral      .dm-mega-link:hover .dm-mega-label { color: var(--dm-mod-neutral); }
.dm-col-consultation .dm-mega-link:hover .dm-mega-ico { background: var(--dm-mod-consultation); color: #fff; }
.dm-col-services     .dm-mega-link:hover .dm-mega-ico { background: var(--dm-mod-services);     color: #fff; }
.dm-col-calendar     .dm-mega-link:hover .dm-mega-ico { background: var(--dm-mod-calendar);     color: #fff; }
.dm-col-extras       .dm-mega-link:hover .dm-mega-ico { background: var(--dm-mod-extras);       color: #fff; }

.dm-col-consultation .dm-mega-link:hover .dm-mega-label { color: var(--dm-mod-consultation); }
.dm-col-services     .dm-mega-link:hover .dm-mega-label { color: var(--dm-mod-services); }
.dm-col-calendar     .dm-mega-link:hover .dm-mega-label { color: var(--dm-mod-calendar); }
.dm-col-extras       .dm-mega-link:hover .dm-mega-label { color: var(--dm-mod-extras); }

/* ---- Illustrative frame ---- */
.dm-mega-frame { position: relative; }
.dm-frame-card {
    position: relative;
    height: 100%;
    min-height: 232px;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    padding: 24px;
    background: var(--dm-bg-indigo-dye);
    transition: background .3s ease;
}
.dm-frame-card::after { /* subtle medical pattern overlay */
    content: "";
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 16px 16px;
    pointer-events: none;
}
.dm-frame-idle, .dm-frame-hover { display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; z-index: 1; width: 100%; }
.dm-frame-logo { width: 200px; max-width: 78%; height: auto; position: relative; z-index: 1; filter: brightness(0) invert(1); }
.dm-frame-card.bg-bright-white .dm-frame-logo { filter: none; }
.dm-frame-slogan { position: relative; z-index: 1; margin-top: 10px; font-size: 14px; font-weight: 600; opacity: .92; }
.dm-frame-icon { font-size: 56px; position: relative; z-index: 1; margin-bottom: 14px; }
.dm-frame-title { position: relative; z-index: 1; font-size: 19px; font-weight: 800; }

/* brand background sets (Loïc) — CSS gradients standing in for .jpg until delivered */
:root {
    --dm-bg-bright-white:   linear-gradient(151deg, #eaf4fd 0%, #cfe6fb 100%);
    --dm-bg-celestial-blue: linear-gradient(151deg, #38a3f5 0%, #1f7fd0 100%);
    --dm-bg-royal-blue:     linear-gradient(151deg, #1e6fb8 0%, #0e4f8c 100%);
    --dm-bg-indigo-dye:     linear-gradient(151deg, #06304f 0%, #003a61 55%, #042036 100%);
    --dm-bg-dark-denim:     linear-gradient(151deg, #16384f 0%, #0c2536 100%);
}
.dm-frame-card.bg-bright-white   { background: var(--dm-bg-bright-white);   color: #003a61; }
.dm-frame-card.bg-celestial-blue { background: var(--dm-bg-celestial-blue); }
.dm-frame-card.bg-royal-blue     { background: var(--dm-bg-royal-blue); }
.dm-frame-card.bg-indigo-dye     { background: var(--dm-bg-indigo-dye); }
.dm-frame-card.bg-dark-denim     { background: var(--dm-bg-dark-denim); }

/* ---- Megamenu footer (6 slots, divider above) ---- */
.dm-mega-foot {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid #e7eef5;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0 22px;
}
.dm-foot-item { grid-column: span 2; }
.dm-foot-item .dm-mega-link { }
.dm-foot-empty { grid-column: span 2; }

/* =====================================================================
   Breakpoints — hide the whole wrap (incl. its blur strip) per device
   ===================================================================== */
@media (max-width: 991px) { .dm-wrap-desktop { display: none; } }
@media (min-width: 992px) { .dm-wrap-mobile  { display: none; } }

/* =====================================================================
   Mobile drawer
   ===================================================================== */
.dm-m-bar {
    position: relative;
    height: var(--dm-nav-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 12px 0 16px;
}
.dm-m-logo { flex: 0 1 auto; min-width: 0; }
.dm-m-logo img { height: clamp(26px, 8vw, 38px); width: auto; max-width: 100%; display: block; } /* shrinks on narrow viewports */
.dm-m-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
@media (max-width: 380px) { .dm-nav-mobile .dm-nav-btn { padding: 8px 11px; font-size: 13px; } .dm-m-burger { width: 38px; height: 38px; flex-basis: 38px; } }
/* compact Contactez-nous on mobile so it doesn't crowd the bar */
.dm-nav-mobile .dm-nav-btn { padding: 9px 14px; font-size: 14px; }
.dm-m-burger {
    appearance: none; border: 0;
    width: 42px; height: 42px;
    flex: 0 0 42px;
    border-radius: 10px;
    background: var(--dm-mod-consultation-subtle);
    color: var(--dm-mod-consultation);
    font-size: 18px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.dm-m-burger .fa-xmark { display: none; }
.dm-nav.is-open .dm-m-burger .fa-bars { display: none; }
.dm-nav.is-open .dm-m-burger .fa-xmark { display: block; }

.dm-m-panel {
    display: none;
    max-height: calc(100vh - 2 * var(--dm-nav-gap) - var(--dm-nav-h));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 18px 0;
    position: relative;
}
.dm-nav.is-open .dm-m-panel { display: block; }
.dm-nav.is-open.dm-nav-mobile {
    border-bottom: 4px solid var(--dm-mod-neutral);
}

.dm-m-utility {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #eef3f8;
}
.dm-m-langs { display: flex; gap: 8px; flex: 0 0 auto; }
.dm-m-lang { width: 28px; height: 28px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; border: 2px solid transparent; box-shadow: 0 0 0 1px rgba(0,58,97,.08); flex: 0 0 auto; opacity: .55; transition: opacity .15s ease; }
.dm-m-lang img { width: 100%; height: 100%; object-fit: cover; }
.dm-m-lang.is-active { border-color: var(--dm-mod-consultation); opacity: 1; }
.dm-m-lang:hover { opacity: 1; }
.dm-m-tabs {
    display: flex; gap: 6px;
    padding: 14px 0 6px;
}
.dm-m-tabs .dm-nav-item { padding: 9px 14px; }
.dm-m-section { padding: 14px 0 4px; }
.dm-m-section .dm-mega-head { margin-bottom: 12px; }
/* reset desktop grid/centering/negative-margin leaks → clean left-aligned list */
.dm-m-section .dm-mega-links { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.dm-m-section .dm-mega-link { margin-left: 0; min-height: 0; }
.dm-m-scrollcue {
    position: sticky;
    bottom: 0;
    display: flex; justify-content: center;
    padding: 14px 0 16px;
    color: var(--dm-mod-consultation);
    font-size: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,0), #fff 60%);
}

/* prevent body scroll when mobile drawer open */
body.dm-nav-locked { overflow: hidden; }
