/* =========================================================
   MOBILE NAVIGATION (< 992px)
   Header fixe + Bottom navigation "app-like" pour Odish.app.
   Ce fichier ne touche jamais l'affichage desktop (>= 992px),
   il ne fait que réutiliser les couleurs/variables de app.css.
========================================================= */

.mobile-app-header,
.mobile-menu-panel,
.mobile-bottom-nav {
    display: none;
}

@media (min-width: 992px) {
    .mobile-app-header,
    .mobile-menu-panel,
    .mobile-bottom-nav {
        display: none !important;
    }
}

@media (max-width: 991.98px) {

    :root {
        --mobile-header-height: 70px;
        --navbar-height: var(--mobile-header-height);
    }

    /* ---------------------------------------------------
       On masque la navbar desktop : le menu mobile a son propre panneau.
    --------------------------------------------------- */
    .premium-navbar {
        background: transparent;
        border-bottom: none;
        box-shadow: none;
        padding: 0;
    }

    .premium-navbar > .container {
        padding: 0;
    }

    .premium-navbar > .container > .navbar-brand,
    .premium-navbar > .container > .navbar-toggler {
        display: none;
    }

    .premium-navbar .navbar-collapse {
        display: none !important;
    }

    /* ---------------------------------------------------
       HEADER
    --------------------------------------------------- */
    .mobile-app-header {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: var(--mobile-header-height);
        padding-top: env(safe-area-inset-top);
        background: #ffffff;
        box-shadow: 0 6px 24px rgba(0, 0, 0, .06);
        z-index: 10030;
        transition: box-shadow .25s ease;
    }

    .mobile-app-header.is-scrolled {
        box-shadow: 0 10px 30px rgba(0, 0, 0, .10);
    }

    .mobile-app-header__inner {
        height: var(--mobile-header-height);
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        padding: 0 16px;
        min-width: 0;
    }

    .mobile-app-header__brand {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        flex: 1 1 auto;
        min-width: 0;
    }

    .mobile-app-header__brand img {
        height: 36px;
        width: auto;
        object-fit: contain;
        display: block;
    }

    .mobile-app-header__brand .odish-brand-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    .mobile-app-header__brand .odish-brand-icon img {
        width: 60px;
        height: 48px;
        max-width: none;
        object-fit: cover;
    }

    .mobile-app-header__brand .odish-brand-wordmark {
        font-size: 24px;
    }

    .mobile-app-header__env {
        display: inline-flex;
        align-items: center;
        flex: 0 0 auto;
        font-size: 0;
        line-height: 0;
    }

    .mobile-app-header__env .badge {
        margin-left: 0 !important;
        font-size: 0.78rem !important;
        line-height: 1 !important;
        padding: .34rem .62rem !important;
    }

    .mobile-env-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: #ffc107;
        color: #111111;
        font-size: 11px;
        font-weight: 800;
        letter-spacing: .04em;
        padding: 6px 12px;
        border-radius: 999px;
        white-space: nowrap;
    }

    .mobile-env-badge__dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #111111;
        display: inline-block;
    }

    .mobile-app-header__actions {
        display: flex;
        align-items: center;
        gap: 4px;
        margin-left: auto;
        flex-shrink: 0;
    }

    .mobile-header-icon-btn {
        position: relative;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 0;
        background: transparent;
        border-radius: 12px;
        color: var(--odish-text, #1c1c1c);
        font-size: 22px;
        text-decoration: none;
        transition: background .2s ease, color .2s ease;
    }

    .mobile-header-icon-btn:hover,
    .mobile-header-icon-btn:active {
        background: #fff1f2;
        color: var(--odish-red, #e50914);
    }

    .mobile-nav-toggle {
        width: 44px;
        height: 44px;
        margin-left: 4px;
        border: 1px solid rgba(229, 9, 20, .16);
        border-radius: 16px;
        background: #111111;
        color: #ffffff;
        box-shadow: 0 12px 28px rgba(17, 17, 17, .18);
        transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
    }

    @media (max-width: 340px) {
        .mobile-app-header__inner {
            gap: 6px;
            padding: 0 10px;
        }

        .mobile-app-header__brand {
            gap: 5px;
        }

        .mobile-app-header__brand .odish-brand-icon {
            width: 30px;
            height: 30px;
            flex-basis: 30px;
        }

        .mobile-app-header__brand .odish-brand-icon img {
            width: 53px;
            height: 42px;
        }

        .mobile-app-header__brand .odish-brand-wordmark {
            font-size: 21px;
        }

        .mobile-app-header__env .badge {
            font-size: 0.68rem !important;
            padding: .3rem .48rem !important;
        }

        .mobile-nav-toggle {
            width: 40px;
            height: 40px;
            margin-left: 2px;
            border-radius: 14px;
        }

        .mobile-nav-toggle i {
            font-size: 19px;
        }
    }

    .mobile-nav-toggle i {
        font-size: 21px;
        line-height: 1;
    }

    .mobile-nav-toggle:hover,
    .mobile-nav-toggle:active,
    .mobile-nav-toggle[aria-expanded="true"] {
        background: var(--odish-red, #e50914);
        border-color: rgba(229, 9, 20, .3);
        color: #ffffff;
        box-shadow: 0 16px 34px rgba(229, 9, 20, .24);
        transform: translateY(-1px);
    }

    .mobile-nav-toggle:focus-visible {
        outline: 3px solid rgba(229, 9, 20, .22);
        outline-offset: 3px;
    }

    .mobile-header-icon-btn .navbar-badge {
        border: 2px solid #ffffff;
    }

    /* ---------------------------------------------------
       DASHBOARD MOBILE
       Le menu burger reprend les acces sidebar, donc on masque
       la sidebar normale sous le breakpoint mobile.
    --------------------------------------------------- */
    .dashboard-layout {
        display: block;
        min-height: auto;
    }

    .dashboard-sidebar {
        display: none !important;
    }

    body.dashboard-shell .page-ribbon {
        display: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .dashboard-content {
        width: 100%;
        padding-top: calc(var(--mobile-header-height) + 18px);
        padding-left: 18px;
        padding-right: 18px;
        padding-bottom: calc(116px + env(safe-area-inset-bottom));
    }

    body.dashboard-shell .dashboard-content > * {
        margin-top: 0 !important;
    }

    body.dashboard-shell .dashboard-card,
    body.dashboard-shell .premium-card,
    body.dashboard-shell .premium-card:hover,
    body.dashboard-shell .section-box,
    body.dashboard-shell .artist-profile-hero,
    body.dashboard-shell .audition-hero-content {
        margin-top: 0 !important;
        transform: none !important;
    }

    body.dashboard-shell .media-dashboard-page,
    body.dashboard-shell .media-dashboard-page .container,
    body.dashboard-shell .media-dashboard-page .artist-edit-card {
        max-width: 100%;
        overflow-x: clip;
    }

    body.dashboard-shell .media-dashboard-page .artist-edit-card::before {
        display: none;
    }

    /* ---------------------------------------------------
       MENU BURGER
    --------------------------------------------------- */
    .mobile-menu-panel {
        position: fixed;
        top: calc(var(--mobile-header-height) + 10px);
        left: 14px;
        right: 14px;
        z-index: 10040;
        max-height: calc(100vh - var(--mobile-header-height) - 96px);
        overflow: hidden;
        border: 1px solid rgba(17, 17, 17, .08);
        border-radius: 24px;
        background: rgba(255, 255, 255, .98);
        box-shadow: 0 22px 70px rgba(12, 16, 24, .18);
        backdrop-filter: blur(18px);
    }

    .mobile-menu-panel.collapse:not(.show) {
        display: none;
    }

    .mobile-menu-panel.collapsing,
    .mobile-menu-panel.show {
        display: block;
    }

    .mobile-menu-panel__scroll {
        max-height: calc(100vh - var(--mobile-header-height) - 96px);
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 12px;
        padding-bottom: calc(22px + env(safe-area-inset-bottom));
        scrollbar-width: thin;
        scrollbar-color: rgba(229, 9, 20, .32) transparent;
    }

    .mobile-menu-user,
    .mobile-menu-auth {
        display: flex;
        gap: 14px;
        align-items: center;
        margin-bottom: 18px;
        padding: 16px;
        border: 1px solid rgba(17, 17, 17, .08);
        border-radius: 20px;
        background:
            radial-gradient(circle at top left, rgba(229, 9, 20, .08), transparent 38%),
            #ffffff;
        box-shadow: 0 12px 28px rgba(12, 16, 24, .06);
    }

    .mobile-menu-user__avatar-wrap {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 72px;
        height: 72px;
        flex: 0 0 72px;
        border-radius: 50%;
    }

    .mobile-menu-user__avatar {
        width: 72px;
        height: 72px;
        border-radius: 50%;
        object-fit: cover;
        object-position: center;
        display: block;
        background: #f3f4f6;
    }

    .mobile-menu-user__badge {
        position: absolute;
        right: -7px;
        bottom: -3px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        z-index: 2;
    }

    .mobile-menu-user__badge:empty {
        display: none;
    }

    .mobile-menu-user__badge .user-badge {
        min-width: 28px;
        min-height: 28px;
        width: 28px;
        height: 28px;
        padding: 0;
        justify-content: center;
        border-width: 3px;
        box-shadow: 0 8px 18px rgba(12, 16, 24, .24);
    }

    .mobile-menu-user__badge .user-badge i {
        font-size: 11px;
    }

    .mobile-menu-user__body {
        min-width: 0;
        flex: 1 1 auto;
    }

    .mobile-menu-user__body strong {
        display: block;
        color: var(--odish-black, #111111);
        font-size: 18px;
        font-weight: 800;
        line-height: 1.2;
    }

    .mobile-menu-user__body > span {
        display: block;
        margin-top: 4px;
        color: var(--odish-muted, #707070);
        font-size: 14px;
        line-height: 1.25;
    }

    .mobile-menu-profile-btn {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        margin-top: 12px;
        min-height: 38px;
        padding: 8px 18px;
        border: 1px solid rgba(229, 9, 20, .12);
        border-radius: 999px;
        background: #fff1f2;
        color: var(--odish-red, #e50914);
        text-decoration: none;
        font-size: 14px;
        font-weight: 800;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .7);
    }

    .mobile-menu-auth {
        justify-content: stretch;
        flex-direction: column;
        align-items: stretch;
    }

    .mobile-menu-auth a {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 46px;
        border-radius: 999px;
        font-weight: 800;
        text-decoration: none;
    }

    .mobile-menu-auth__primary {
        background: var(--odish-red, #e50914);
        color: #ffffff;
    }

    .mobile-menu-auth__secondary {
        border: 1px solid rgba(17, 17, 17, .12);
        color: var(--odish-black, #111111);
        background: #ffffff;
    }

    .mobile-menu-section {
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin-top: 16px;
    }

    .mobile-menu-section h2 {
        margin: 0 0 8px;
        padding: 0 8px;
        color: var(--odish-black, #111111);
        font-size: 12px;
        font-weight: 900;
        line-height: 1;
        text-transform: uppercase;
        letter-spacing: .04em;
    }

    .mobile-menu-link {
        display: flex;
        align-items: center;
        gap: 16px;
        width: 100%;
        min-height: 48px;
        padding: 12px 14px;
        border: 0;
        border-radius: 14px;
        background: transparent;
        color: var(--odish-text, #1c1c1c);
        text-align: left;
        text-decoration: none;
        font-size: 15px;
        font-weight: 750;
        line-height: 1.25;
        transition: background .2s ease, color .2s ease;
    }

    .mobile-menu-link i {
        width: 22px;
        flex: 0 0 22px;
        text-align: center;
        font-size: 17px;
    }

    .mobile-menu-link span {
        min-width: 0;
    }

    .mobile-menu-link:hover,
    .mobile-menu-link:active,
    .mobile-menu-link.active {
        background: #fff1f2;
        color: var(--odish-red, #e50914);
    }

    .mobile-menu-link--danger {
        margin-top: 8px;
        color: var(--odish-red, #e50914);
    }

    .mobile-menu-badge {
        margin-left: auto;
        min-width: 22px;
        height: 22px;
        padding: 0 7px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 999px;
        background: var(--odish-red, #e50914);
        color: #ffffff;
        font-size: 11px;
        font-weight: 900;
        line-height: 1;
    }

    .mobile-menu-group {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .mobile-menu-group__title {
        cursor: pointer;
        box-shadow: 0 8px 20px rgba(12, 16, 24, .04);
        border: 1px solid rgba(17, 17, 17, .06);
        background: #ffffff;
    }

    .mobile-menu-group__title.active,
    .mobile-menu-group__title[aria-expanded="true"] {
        background: #fff1f2;
        color: var(--odish-red, #e50914);
        border-color: rgba(229, 9, 20, .08);
    }

    .mobile-menu-group__chevron {
        margin-left: auto;
        transition: transform .2s ease;
    }

    .mobile-menu-group__title[aria-expanded="true"] .mobile-menu-group__chevron {
        transform: rotate(180deg);
    }

    .mobile-menu-submenu {
        margin: 0 4px 2px;
        padding: 8px 6px;
        border-radius: 18px;
        background: rgba(255, 255, 255, .88);
        box-shadow: inset 0 0 0 1px rgba(17, 17, 17, .04);
    }

    .mobile-menu-submenu.collapse:not(.show) {
        display: none;
    }

    .mobile-menu-submenu.collapsing,
    .mobile-menu-submenu.show {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .mobile-menu-submenu .mobile-menu-link {
        min-height: 42px;
        padding: 10px 12px;
        font-size: 14px;
    }

    /* ---------------------------------------------------
       CONTENU : ne jamais laisser la bottom nav masquer
       les dernières cartes de la page.
    --------------------------------------------------- */
    #layout-content {
        padding-bottom: 10px;
    }

    /* ---------------------------------------------------
       BOTTOM NAVIGATION
    --------------------------------------------------- */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        left: 16px;
        right: 16px;
        bottom: 16px;
        width: calc(100% - 32px);
        justify-content: space-between;
        align-items: stretch;
        gap: 2px;
        background: #ffffff;
        border-radius: 32px;
        box-shadow: 0 20px 50px rgba(0, 0, 0, .14);
        padding: 8px 6px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
        z-index: 10020;
    }

    .mobile-bottom-nav__item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 8px 2px 6px;
        border-radius: 22px;
        text-decoration: none;
        color: var(--odish-muted, #707070);
        position: relative;
    }

    button.mobile-bottom-nav__item {
        border: 0;
        background: transparent;
        font: inherit;
        cursor: pointer;
    }

    .mobile-bottom-nav__icon {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 19px;
        color: var(--odish-black, #111111);
        transition: transform .2s ease, color .2s ease;
    }

    .mobile-bottom-nav__label {
        font-size: 10.5px;
        font-weight: 600;
        color: inherit;
        transition: color .2s ease;
    }

    .mobile-bottom-nav__item.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 22px;
        height: 3px;
        border-radius: 999px;
        background: var(--odish-red, #e50914);
    }

    .mobile-bottom-nav__menu[aria-expanded="true"]::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 22px;
        height: 3px;
        border-radius: 999px;
        background: var(--odish-red, #e50914);
    }

    .mobile-bottom-nav__item.active .mobile-bottom-nav__icon,
    .mobile-bottom-nav__item.active .mobile-bottom-nav__label,
    .mobile-bottom-nav__menu[aria-expanded="true"] .mobile-bottom-nav__icon,
    .mobile-bottom-nav__menu[aria-expanded="true"] .mobile-bottom-nav__label {
        color: var(--odish-red, #e50914);
    }

    .mobile-bottom-nav__item.active .mobile-bottom-nav__label,
    .mobile-bottom-nav__menu[aria-expanded="true"] .mobile-bottom-nav__label {
        font-weight: 800;
    }

    .mobile-bottom-nav__item.is-tapped .mobile-bottom-nav__icon {
        transform: scale(1.08) translateY(-2px);
    }

    /* ---------------------------------------------------
       Bandeau "Installer Odish.app" (pwa-install.htm) :
       on le remonte pour qu'il ne chevauche pas la bottom nav.
    --------------------------------------------------- */
    .pwa-install-banner {
        bottom: calc(var(--mobile-header-height) + 26px + env(safe-area-inset-bottom)) !important;
    }

    /* ---------------------------------------------------
       BOUTONS — hero de la page d'accueil
    --------------------------------------------------- */
    .hero-actions .btn-primary-premium,
    .hero-actions .btn-secondary-premium {
        height: 56px;
        border-radius: 18px;
        font-size: 16px;
    }

    /* ---------------------------------------------------
       CARTES STATISTIQUES (hero de la page d'accueil)
       Icône carrée rose clair + chevron rouge, sans jamais
       toucher à l'affichage desktop (icône/chevron cachés
       au-dessus de 992px, voir règle par défaut plus haut).
    --------------------------------------------------- */
    .hero-stats {
        gap: 14px;
    }

    .stat-card-app {
        display: flex;
        align-items: center;
        gap: 16px;
        width: 100%;
        text-decoration: none;
        color: inherit;
    }

    .stat-card-app__icon,
    .stat-card-app__chevron {
        display: inline-flex;
    }

    .stat-card-app__icon {
        position: relative;
        z-index: 1;
        width: 52px;
        height: 52px;
        align-items: center;
        justify-content: center;
        border-radius: 16px;
        background: #fff1f2;
        color: var(--odish-red, #e50914);
        font-size: 20px;
        flex-shrink: 0;
    }

    .stat-card-app__body {
        position: relative;
        z-index: 1;
        flex: 1;
        min-width: 0;
        text-align: left;
    }

    .stat-card-app__chevron {
        position: relative;
        z-index: 1;
        width: 34px;
        height: 34px;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        background: #fff1f2;
        color: var(--odish-red, #e50914);
        font-size: 13px;
        flex-shrink: 0;
    }
}

/* Icône/chevron des cartes stats : invisibles par défaut (desktop),
   affichés uniquement sous 992px via la règle ci-dessus. */
.stat-card-app__icon,
.stat-card-app__chevron {
    display: none;
}
.mobile-market-selector {
    align-items: center;
    display: inline-flex;
}

.mobile-market-selector__button,
.mobile-market-selector__static {
    align-items: center;
    border: 1px solid rgba(20, 20, 20, .12);
    border-radius: 999px;
    background: #fff;
    color: #1b1b1b;
    display: inline-flex;
    font-size: 15px;
    gap: 4px;
    height: 34px;
    justify-content: center;
    min-width: 42px;
    padding: 0 9px;
}
