/* ==========================================================================
   Menu mobile en tiroir (moins de 1020 px)
   Vue : components/library/sections/mobile-menu.blade.php
   Comportement : library/partials/mobile-menu-opener.blade.php
   ========================================================================== */

.drw {
    --drw-accent: #EAA451;
    --drw-accent-strong: #e58c23;
    --drw-accent-soft: #fdf3e6;
    --drw-ink: #1f1a16;
    --drw-muted: #7a6f66;
    --drw-line: #efe8e1;
    --drw-bg: #fffdfb;
    --drw-head-1: #241c17;
    --drw-head-2: #3b2c22;
    --drw-head-3: #6a4220;
    --drw-ease: cubic-bezier(.22, 1, .36, 1);
    --drw-width: min(88vw, 400px);
    position: fixed;
    inset: 0;
    z-index: 10050;
    visibility: hidden;
    pointer-events: none;
    font-family: var(--font-family-base, "Open Sans", sans-serif);
}
.drw.is-open { visibility: visible; pointer-events: auto; }

/* Page bloquée derrière le tiroir (sans saut de mise en page) */
html.drw-lock, html.drw-lock body { overflow: hidden; }
html.drw-lock body { padding-right: var(--drw-scrollbar, 0); }

/* ── Voile ─────────────────────────────────────────────────────────────── */
.drw__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(24, 18, 14, .55);
    -webkit-backdrop-filter: blur(4px) saturate(120%);
    backdrop-filter: blur(4px) saturate(120%);
    opacity: 0;
    transition: opacity .38s var(--drw-ease), visibility 0s linear .38s;
}
.drw.is-open .drw__backdrop {
    opacity: calc(1 - var(--drw-drag, 0));
    transition: opacity .38s var(--drw-ease);
}

/* ── Panneau ───────────────────────────────────────────────────────────── */
.drw__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--drw-width);
    display: flex;
    flex-direction: column;
    background: var(--drw-bg);
    border-radius: 24px 0 0 24px;
    box-shadow: -24px 0 60px -20px rgba(20, 12, 4, .45);
    transform: translateX(104%);
    transition: transform .42s var(--drw-ease);
    overflow: hidden;
    outline: none;
    will-change: transform;
}
.drw.is-open .drw__panel { transform: translateX(0); }

/* ── En-tête ───────────────────────────────────────────────────────────── */
.drw__head {
    position: relative;
    padding: calc(14px + env(safe-area-inset-top)) 18px 20px;
    color: #fff;
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(234, 164, 81, .55) 0%, rgba(234, 164, 81, 0) 55%),
        radial-gradient(80% 70% at 0% 100%, rgba(229, 140, 35, .28) 0%, rgba(229, 140, 35, 0) 60%),
        linear-gradient(150deg, var(--drw-head-1) 0%, var(--drw-head-2) 55%, var(--drw-head-3) 100%);
    overflow: hidden;
    isolation: isolate;
}
/* Motif discret (rappel des pages d'un ouvrage) */
.drw__head::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: repeating-linear-gradient(115deg, rgba(255, 255, 255, .045) 0 1px, transparent 1px 14px);
    -webkit-mask-image: linear-gradient(200deg, #000 10%, transparent 75%);
    mask-image: linear-gradient(200deg, #000 10%, transparent 75%);
}
.drw__head::after {
    content: "";
    position: absolute;
    width: 220px;
    height: 220px;
    right: -90px;
    top: -110px;
    z-index: -1;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .12);
    box-shadow: 0 0 0 28px rgba(255, 255, 255, .03), 0 0 0 56px rgba(255, 255, 255, .02);
}

.drw__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.drw__brand { display: flex; align-items: center; gap: 12px; color: #fff !important; text-decoration: none; }
.drw__logo {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .45);
}
.drw__logo img { width: 38px; height: auto; display: block; }
.drw__brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.drw__kicker { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
.drw__brand-text strong {
    font-family: var(--font-family-title, "Noto Sans", serif);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .04em;
}

.drw__close {
    flex: none;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 18px;
    transition: background-color .2s, transform .2s;
}
.drw__close:hover, .drw__close:focus-visible { background: rgba(255, 255, 255, .18); }
.drw__close:active { transform: scale(.92); }

/* Carte de l'abonné */
.drw__user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(255, 255, 255, .14);
    color: #fff !important;
    text-decoration: none;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: background-color .2s;
}
.drw__user:hover { background: rgba(255, 255, 255, .14); }
.drw__user .user-avatar.drw__avatar {
    flex: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .85), 0 0 0 4px rgba(234, 164, 81, .55);
}
.drw__user-text { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.drw__user-name { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drw__user-go { opacity: .6; font-size: 13px; }
.drw__pill {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    background: rgba(255, 255, 255, .14);
    color: rgba(255, 255, 255, .92);
}
.drw__pill--ok { background: rgba(110, 231, 160, .16); color: #b7f5cf; }
.drw__pill--warn { background: rgba(255, 196, 120, .2); color: #ffd9a8; }

.drw__pitch { margin: 16px 0 14px; font-size: 14px; line-height: 1.5; color: rgba(255, 255, 255, .82); }
.drw__auth { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drw__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 14.5px;
    text-decoration: none !important;
    transition: transform .15s, background-color .2s, color .2s;
}
.drw__cta:active { transform: scale(.97); }
.drw__cta--solid {
    background: linear-gradient(135deg, #f3b766 0%, var(--drw-accent) 45%, var(--drw-accent-strong) 100%);
    color: #2a1a08 !important;
    box-shadow: 0 10px 22px -10px rgba(229, 140, 35, .9), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.drw__cta--ghost { border: 1.5px solid rgba(255, 255, 255, .45); color: #fff !important; background: rgba(255, 255, 255, .04); }
.drw__cta--ghost:hover { background: rgba(255, 255, 255, .12); }
.drw__user + .drw__cta { margin-top: 12px; }

/* ── Corps ─────────────────────────────────────────────────────────────── */
.drw__body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 16px 14px 8px;
}

.drw__search {
    position: relative;
    margin: 0 2px 14px;
}
.drw__search i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--drw-muted);
    pointer-events: none;
}
.drw__search input {
    width: 100%;
    height: 50px;
    padding: 0 16px 0 44px;
    border: 1.5px solid var(--drw-line);
    border-radius: 16px;
    background: #fff;
    font-size: 16px; /* iOS : pas de zoom à la saisie */
    color: var(--drw-ink);
    transition: border-color .2s, box-shadow .2s;
}
.drw__search input::placeholder { color: #a99d93; }
.drw__search input:focus { outline: none; border-color: var(--drw-accent); box-shadow: 0 0 0 4px rgba(234, 164, 81, .18); }

/* Navigation */
.drw__nav { display: flex; flex-direction: column; gap: 6px; }

.drw__icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--drw-accent-soft);
    color: var(--drw-accent-strong);
    font-size: 16px;
    transition: background-color .25s, color .25s, transform .25s var(--drw-ease);
}

.drw__home, .drw__group-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 54px;
    padding: 8px 12px 8px 8px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--drw-ink) !important;
    font-size: 16px;
    font-weight: 700;
    text-align: left;
    text-decoration: none !important;
    transition: background-color .2s;
}
.drw__home:hover, .drw__group-btn:hover { background: #faf5ef; }
.drw__home.is-active { background: var(--drw-accent-soft); }
.drw__home.is-active .drw__icon { background: var(--drw-accent); color: #fff; }

.drw__group { border-radius: 18px; transition: background-color .3s; }
.drw__group.is-open { background: #faf5ef; }
.drw__group.is-open .drw__icon { background: var(--drw-accent); color: #fff; transform: rotate(-6deg) scale(1.04); }
.drw__group-label { flex: 1; }
.drw__count {
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: #f1ebe5;
    color: var(--drw-muted);
    font-size: 12px;
    font-weight: 700;
}
.drw__chevron { color: #b3a79c; font-size: 13px; transition: transform .35s var(--drw-ease); }
.drw__group.is-open .drw__chevron { transform: rotate(180deg); color: var(--drw-accent-strong); }

/* Ouverture fluide (hauteur automatique animée) */
.drw__group-body {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .38s var(--drw-ease);
}
.drw__group.is-open .drw__group-body { grid-template-rows: 1fr; }
.drw__group-body > ul {
    min-height: 0;
    overflow: hidden;
    list-style: none;
    margin: 0;
    padding: 0 10px 0 58px;
    position: relative;
}
.drw__group-body > ul::before {
    content: "";
    position: absolute;
    left: 26px;
    top: 4px;
    bottom: 14px;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(var(--drw-accent) 0%, rgba(234, 164, 81, .15) 100%);
}
.drw__group.is-open .drw__group-body > ul { padding-bottom: 10px; }
.drw__group-body li a {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 12px;
    color: #4a3f37 !important;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none !important;
    transition: background-color .2s, color .2s, transform .2s var(--drw-ease);
}
.drw__group-body li a small { font-size: 12px; font-weight: 500; color: var(--drw-muted); margin-top: 2px; }
.drw__group-body li a:hover { background: #fff; transform: translateX(2px); }
.drw__group-body li a.is-active { background: #fff; color: var(--drw-ink) !important; box-shadow: 0 1px 0 var(--drw-line); }
.drw__group-body li a.is-active::before {
    content: "";
    position: absolute;
    left: -36px;
    top: 50%;
    width: 10px;
    height: 10px;
    margin-top: -5px;
    border-radius: 50%;
    background: var(--drw-accent);
    box-shadow: 0 0 0 4px rgba(234, 164, 81, .25);
}

/* Mon espace */
.drw__space { margin-top: 18px; padding: 0 2px; }
.drw__section-title {
    margin: 0 0 10px 6px;
    font-size: 11.5px !important;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--drw-muted) !important;
    font-weight: 700;
}
.drw__tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.drw__tiles a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 76px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--drw-line);
    color: var(--drw-ink) !important;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none !important;
    transition: transform .2s var(--drw-ease), border-color .2s, background-color .2s;
}
.drw__tiles a i { font-size: 19px; color: var(--drw-accent-strong); }
.drw__tiles a:active { transform: scale(.96); }
.drw__tiles a.is-active { border-color: var(--drw-accent); background: var(--drw-accent-soft); }

/* ── Pied ──────────────────────────────────────────────────────────────── */
.drw__foot {
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--drw-line);
    background: #fff;
}
.drw__links { display: flex; gap: 8px; flex-wrap: wrap; }
.drw__links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: #f7f2ec;
    color: #5b4f46 !important;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
}
.drw__links a i { color: var(--drw-accent-strong); font-size: 12px; }
.drw__foot-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.drw__phone { color: var(--drw-muted) !important; font-size: 13px; text-decoration: none !important; }
.drw__phone i { color: var(--drw-accent-strong); margin-right: 4px; }
.drw__foot form { margin: 0; }
.drw__logout {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid #f3d3d0;
    border-radius: 12px;
    background: #fff6f5;
    color: #b42318;
    font-size: 13px;
    font-weight: 700;
}

/* ── Apparition en cascade ─────────────────────────────────────────────── */
@keyframes drw-in {
    from { opacity: 0; transform: translateX(18px); }
    to { opacity: 1; transform: none; }
}
.drw.is-open [style*="--i"] { animation: drw-in .5s var(--drw-ease) both; animation-delay: calc(140ms + var(--i) * 45ms); }
.drw.is-open .drw__head > * { animation: drw-in .5s var(--drw-ease) both; animation-delay: 80ms; }

/* ── Bouton d'ouverture (hamburger) ────────────────────────────────────── */
.drw-opener {
    display: none;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid #f1e3d2;
    border-radius: 14px;
    background: linear-gradient(180deg, #fffaf4, #fdf0e0);
    cursor: pointer;
    transition: transform .15s, border-color .2s;
}
.drw-opener:active { transform: scale(.94); }
.drw-opener:focus-visible { outline: 3px solid rgba(234, 164, 81, .45); outline-offset: 2px; }
.drw-opener__lines { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.drw-opener__lines span { display: block; height: 2.5px; border-radius: 2px; background: #c76f12; transition: width .25s var(--drw-ease, ease); }
.drw-opener__lines span:nth-child(1) { width: 22px; }
.drw-opener__lines span:nth-child(2) { width: 15px; }
.drw-opener__lines span:nth-child(3) { width: 19px; }
.drw-opener:hover .drw-opener__lines span { width: 22px; }
@media (max-width: 1020px) { /* même seuil que .show-md / .hide-md (library.css) */
    .drw-opener.show-md { display: grid; }
}

/* ── Mouvement réduit ──────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .drw__panel, .drw__backdrop, .drw__group-body, .drw__chevron, .drw__icon { transition-duration: .01ms !important; }
    .drw.is-open [style*="--i"], .drw.is-open .drw__head > * { animation: none !important; }
}
