/**
 * GazExpress — Layout public V2 (mobile-first)
 */
*, *::before, *::after { box-sizing: border-box; }

.gx-public-html {
    -webkit-text-size-adjust: 100%;
    max-width: 100%;
    overflow-x: clip;
}

.gx-public-body {
    margin: 0;
    min-height: 100dvh;
    max-width: 100%;
    font-family: var(--gx-font-sans);
    font-size: 15px;
    line-height: 1.5;
    color: var(--gx-text);
    background: var(--gx-bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

.gx-glass {
    /* glass : gx-app-bg.css */
}

.gx-public-app {
    min-height: 100dvh;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    overflow-x: clip;
}

/* ——— Header ——— */
.gx-public-header {
    position: sticky;
    top: 0;
    z-index: 100;
    /* glass : gx-app-bg.css */
}

.gx-public-header__inner {
    display: grid;
    grid-template-columns: var(--gx-touch-min) 1fr auto;
    align-items: center;
    min-height: var(--gx-header-h);
    padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
    max-width: var(--gx-content-max);
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.gx-public-header__menu,
.gx-public-header__back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--gx-touch-min);
    height: var(--gx-touch-min);
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: var(--gx-radius-sm);
    cursor: pointer;
    color: var(--gx-night);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.gx-public-header__menu:active,
.gx-public-header__back:active {
    background: var(--gx-card-group);
}

[data-theme="dark"] .gx-public-header__menu,
[data-theme="dark"] .gx-public-header__back {
    color: #fff;
}

[data-theme="dark"] .gx-public-header__menu .gx-v2-icon,
[data-theme="dark"] .gx-public-header__back .gx-v2-icon {
    filter: brightness(0) invert(1);
}

.gx-public-header__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
}

.gx-public-header__brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: inherit;
}

.gx-public-header__logo {
    display: block;
    height: 28px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
}

.gx-public-header__logo--wordmark {
    height: 22px;
}

.gx-public-header__position {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    max-width: 100%;
    padding: 2px 4px;
    border: 0;
    background: transparent;
    font-family: var(--gx-font-sans);
    font-size: 13px;
    font-weight: 500;
    color: var(--gx-primary);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-tap-highlight-color: transparent;
}

.gx-public-header__position-label {
    overflow: hidden;
    text-overflow: ellipsis;
}

.gx-public-header__spacer {
    width: var(--gx-touch-min);
}

.gx-public-header__end {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: end;
    min-width: 0;
    height: var(--gx-touch-min);
}

/* Bouton soleil/lune (navbar app — même UX que vitrine) */
.gx-theme-btn {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--gx-border, #e2e8f0);
    background: var(--gx-card-group, #f8fafc);
    color: var(--gx-night, #0d1b2a);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.gx-theme-btn:hover {
    background: color-mix(in srgb, var(--gx-accent) 10%, #fff);
    border-color: color-mix(in srgb, var(--gx-accent) 35%, transparent);
}

.gx-theme-btn:active {
    transform: scale(0.96);
}

.gx-theme-btn__input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.gx-theme-btn i {
    font-size: 1.05rem;
    line-height: 1;
}

[data-theme="dark"] .gx-theme-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fdba74;
}

[data-theme="dark"] .gx-theme-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(251, 146, 60, 0.35);
}

.gx-public-header__vitrine {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: var(--gx-accent);
    text-decoration: none;
    white-space: nowrap;
    border: 1.5px solid color-mix(in srgb, var(--gx-accent) 35%, transparent);
    background: color-mix(in srgb, var(--gx-accent) 8%, #fff);
    transition: background 0.15s ease, border-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.gx-public-header__vitrine:hover {
    background: color-mix(in srgb, var(--gx-accent) 14%, #fff);
    border-color: color-mix(in srgb, var(--gx-accent) 50%, transparent);
}

.gx-public-header__vitrine:active {
    background: color-mix(in srgb, var(--gx-accent) 20%, #fff);
}

.gx-public-main--account {
    max-width: min(560px, 100%);
}

.gx-public-flash {
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    animation: gx-app-rise 0.35s ease both;
}

.gx-public-flash--success {
    background: #ecfdf5;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.gx-public-flash--warning {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

/* ——— Main ——— */
.gx-public-main {
    flex: 1;
    width: 100%;
    max-width: min(var(--gx-content-max), 100%);
    margin: 0 auto;
    padding: var(--gx-page-pad);
    padding-left: max(var(--gx-page-pad), env(safe-area-inset-left));
    padding-right: max(var(--gx-page-pad), env(safe-area-inset-right));
    padding-bottom: max(var(--gx-page-pad), env(safe-area-inset-bottom));
    box-sizing: border-box;
    overflow-x: visible;
}

.gx-public-main--commander {
    max-width: min(var(--gx-commander-max), 100%);
}

.gx-public-main--flush {
    padding-left: 0;
    padding-right: 0;
    max-width: none;
}

/* ——— Icônes V2 ——— */
.gx-v2-icon {
    display: block;
    flex-shrink: 0;
    object-fit: contain;
}

.gx-v2-icon--muted {
    opacity: 0.72;
}

.gx-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 991.98px) {
    .gx-public-body.gx-page-commander .gx-public-main--commander {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
    }

    .gx-public-main--commander .gx-hub--pro,
    .gx-menu-page,
    .gx-chercher,
    .gx-adresse {
        max-width: 100%;
    }

    .gx-hub__hero,
    .gx-hub__cta,
    .gx-hub__active-pill,
    .gx-hub__banniere,
    .gx-menu-card,
    .gx-menu-promo,
    .gx-adresse-card,
    .gx-chercher__field {
        max-width: 100%;
        box-sizing: border-box;
    }
}

@media (min-width: 768px) {
    .gx-public-main:not(.gx-public-main--flush) {
        padding: var(--gx-page-pad-md);
        padding-left: max(var(--gx-page-pad-md), env(safe-area-inset-left));
        padding-right: max(var(--gx-page-pad-md), env(safe-area-inset-right));
    }
}

.gx-public-header--menu .gx-public-header__inner,
.gx-public-header--back .gx-public-header__inner {
    grid-template-columns: var(--gx-touch-min) 1fr auto;
}

@media (min-width: 992px) {
    .gx-public-header__inner {
        padding-left: 24px;
        padding-right: 24px;
        max-width: none;
        width: 100%;
    }

    .gx-public-body {
        /* fond + orbes : gx-app-bg.css */
    }

    .gx-public-app {
        position: relative;
        z-index: 1;
    }

    .gx-public-header {
        /* glass : gx-app-bg.css */
    }

    /* Desktop : contenu pleine largeur (toute l'app publique) */
    .gx-public-main {
        max-width: none;
        width: 100%;
        padding-left: max(28px, env(safe-area-inset-left));
        padding-right: max(28px, env(safe-area-inset-right));
    }

    .gx-public-main--commander {
        background: transparent;
        border-radius: 0;
        box-shadow: none;
        margin-bottom: 32px;
        min-height: calc(100dvh - var(--gx-header-h) - 12px);
        max-width: none;
        width: 100%;
    }

    .gx-public-body.gx-page-commander .gx-public-main--commander {
        max-width: none;
        width: 100%;
        background: transparent;
        border-radius: 0;
        box-shadow: none;
        margin-bottom: 0;
        min-height: auto;
        padding-top: 20px;
        padding-bottom: 40px;
        padding-left: max(28px, env(safe-area-inset-left));
        padding-right: max(28px, env(safe-area-inset-right));
    }

    .gx-public-body.gx-page-commander:has(.gx-chercher) .gx-public-main--commander {
        max-width: none;
        width: 100%;
        padding-left: 28px;
        padding-right: 28px;
    }

    .gx-public-body.gx-page-commander .gx-public-header__inner {
        max-width: none;
        width: 100%;
    }

    .gx-public-header__vitrine {
        min-height: 40px;
        height: 40px;
        padding: 0 14px;
        font-size: 13px;
    }
}

/* ——— Confirmation sortie vitrine ——— */
body.gx-vitrine-exit-open {
    overflow: hidden;
}

.gx-vitrine-exit {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
    pointer-events: auto;
}

.gx-vitrine-exit[hidden] {
    display: none !important;
    pointer-events: none !important;
}

.gx-vitrine-exit__backdrop {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: rgba(13, 27, 42, 0.48);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
}

.gx-vitrine-exit__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 380px);
    padding: 22px 20px;
    border-radius: 22px;
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.98), rgba(236, 244, 255, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 24px 64px rgba(13, 27, 42, 0.22);
}

.gx-vitrine-exit__title {
    margin: 0 0 10px;
    font-family: var(--gx-font-display, 'Poppins', sans-serif);
    font-size: 1.2rem;
    font-weight: 700;
    color: #0d1b2a;
}

.gx-vitrine-exit__body {
    margin: 0 0 18px;
    font-size: 15px;
    line-height: 1.55;
    color: #64748b;
}

.gx-vitrine-exit__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.gx-vitrine-exit__btn {
    min-height: 48px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.gx-vitrine-exit__btn--ghost {
    background: #f1f5f9;
    color: #0d1b2a;
    border: 1.5px solid #e2e8f0;
}

.gx-vitrine-exit__btn--ghost:hover {
    background: #e2e8f0;
}

.gx-vitrine-exit__btn--primary {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.35);
}

.gx-vitrine-exit__btn--primary:hover {
    filter: brightness(1.05);
}

[data-theme="dark"] .gx-vitrine-exit__panel {
    background: linear-gradient(155deg, #1e293b, #0f172a);
    border-color: rgba(148, 163, 184, 0.25);
}

[data-theme="dark"] .gx-vitrine-exit__title {
    color: #f8fafc;
}

[data-theme="dark"] .gx-vitrine-exit__body {
    color: #94a3b8;
}

[data-theme="dark"] .gx-vitrine-exit__btn--ghost {
    background: #334155;
    color: #f8fafc;
    border-color: #475569;
}

[data-theme="dark"] .gx-vitrine-exit__btn--ghost:hover {
    background: #475569;
}
