/* ==============================================
   NAVBAR ULTRA — Bande rouge / noir / blanc
============================================== */

.ultra-header {
    width: 100%;
    font-family: "Oswald", sans-serif;
    letter-spacing: 0.031rem;
    position: relative;
    z-index: 3000;
}

/* Bande Ultra (écharpe) */
.ultra-topband {
    background: linear-gradient(
        to bottom,
        #D40000 0%,
        #D40000 33%,
        #000000 33%,
        #000000 67%,
        #FFFFFF 67%,
        #FFFFFF 100%
    );
    padding: 0.8rem 0;
    border-bottom: 0.187rem solid #111;
    box-shadow: 0 0.25rem 0.625rem rgba(0,0,0,0.6);
    overflow: visible;
    position: relative;
    z-index: 3000;
}

/* ==============================================
   LOGO
============================================== */

.ultra-brand {
    display: flex;
    align-items: center;
}

.ultra-logo {
    width: 12rem;
    max-width: 45vw;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 0 0.25rem rgba(0,0,0,0.4));
    padding-right: 2rem;
}

/* ==============================================
   NAVIGATION DESKTOP
============================================== */

.ultra-nav {
    display: none;
    height: 3.5rem;
    min-width: 0;
}

@media (min-width: 62rem) { /* 992px */
    .ultra-topband .container {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        min-width: 0;
    }

    .ultra-nav {
        display: flex !important;
        gap: 0.25rem;
        margin-left: auto;
        min-width: 0;
        flex: 1 1 auto;
        justify-content: flex-end;
    }

    .ultra-burger {
        display: none;
    }
}

/* ==============================================
   OUTLINE V4 — ÉCHARPE ULTRA / TIFO PEINT
============================================== */

.ultra-link {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3.5rem;
    padding: 0 1.2rem;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    transition: 0.2s;
    text-decoration: none;
    text-align: center;
    text-shadow: 0 0 0.999rem #000;
}

/* Prevent desktop nav labels from wrapping */
.ultra-nav .ultra-link {
    white-space: nowrap;
    min-width: 0;
    padding: 0 0.85rem;
    font-size: 1rem;
}

.ultra-nav .dropdown > .ultra-link {
    gap: 0.35rem;
}

.ultra-nav .dropdown-toggle::after {
    margin-left: 0.35rem;
}

.ultra-nav .user-nav {
    min-width: 0;
    max-width: 14rem;
    margin-left: auto;
}

.ultra-nav .user-nav .ultra-link {
    min-width: 0;
}

/* Hover / actif (outline renforcé) */
.ultra-link:hover,
.ultra-link.active {
    background: #D40000;
}

/* ==============================================
   ADAPTATION TABLETTES
============================================== */

@media (max-width: 62rem) {
    .ultra-link {
        height: 3.2rem;
        padding: 0 1rem;
    }
}

@media (max-width: 48rem) {
    .ultra-link {
        height: 3rem;
        padding: 0 0.8rem;
    }
}

/* ==============================================
   BURGER MOBILE
============================================== */

.ultra-burger {
    width: 3rem;
    height: 3rem;
    background: rgba(0, 0, 0, 0.72);
    border: 0.0625rem solid rgba(255,255,255,0.55);
    border-radius: 0.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    flex: 0 0 auto;
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,0.35);
}

.ultra-burger span {
    width: 1.65rem;
    height: 0.2rem;
    background: #fff;
    border-radius: 999px;
}

/* ==============================================
   NAVIGATION MOBILE
============================================== */

.ultra-nav-mobile {
    display: none;
    flex-direction: column;
    width: 100%;
    background: #050505;
    padding: 0.5rem 1rem 1.25rem;
    margin-top: 0.8rem;
    max-height: calc(100vh - 6.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-top: 0.0625rem solid rgba(255,255,255,0.18);
    box-shadow: inset 0 0.25rem 0.75rem rgba(0,0,0,0.35);
    -webkit-overflow-scrolling: touch;
}

.ultra-nav-mobile .ultra-link {
    height: auto;
    min-height: 3.15rem;
    padding: 0.85rem 0.75rem;
    font-size: 1.05rem;
    border-bottom: 0.0625rem solid rgba(255,255,255,0.15);
    justify-content: flex-start;
    text-align: left;
    line-height: 1.2;
    width: 100%;
    color: #fff;
    background: transparent;
    text-shadow: none;
}

.ultra-nav-mobile .ultra-link:hover,
.ultra-nav-mobile .ultra-link.active {
    background: #D40000;
    color: #fff;
}

.mobile-nav-inner {
    display: grid;
    gap: 0;
}

.mobile-nav-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 0 0.75rem;
    border-bottom: 0.0625rem solid rgba(255,255,255,0.15);
}

.mobile-cart-link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 2.35rem;
    padding: 0.45rem 0.7rem;
    color: #fff;
    border: 0.0625rem solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.05);
    text-transform: uppercase;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 800;
}

.mobile-cart-link:hover,
.mobile-cart-link.active {
    background: #D40000;
    color: #fff;
}

.mobile-cart-link strong {
    display: inline-grid;
    place-items: center;
    min-width: 1.45rem;
    height: 1.45rem;
    padding: 0 0.35rem;
    background: #D40000;
    color: #fff;
    border-radius: 999px;
    font-size: 0.8rem;
    line-height: 1;
}

.mobile-cart-link.active strong,
.mobile-cart-link:hover strong {
    background: #050505;
}

.mobile-language-flags {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
    margin-left: auto;
}

.mobile-language-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.3rem;
    height: 2rem;
    border: 0.0625rem solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.05);
    text-decoration: none;
}

.mobile-language-flag:hover,
.mobile-language-flag.active {
    border-color: #D40000;
    background: rgba(212,0,0,0.28);
}

.mobile-language-flag .flag-icon {
    width: 1.55rem;
}

.ultra-nav-mobile .mobile-submenu .sub {
    display: none;
    min-height: 2.7rem;
    padding: 0.7rem 0.75rem 0.7rem 1.6rem;
    font-size: 0.98rem;
    color: rgba(255,255,255,0.86);
    background: #111;
    border-bottom-color: rgba(255,255,255,0.08);
}

.ultra-nav-mobile .mobile-submenu.open .sub {
    display: flex;
}

.ultra-nav-mobile .submenu-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 3.15rem;
    padding: 0.85rem 0.75rem;
    background: transparent;
    border: 0;
    color: #fff;
    font: inherit;
    text-transform: uppercase;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.ultra-nav-mobile .submenu-toggle::after {
    content: "+";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    margin-left: 0.75rem;
    border: 0.0625rem solid rgba(255,255,255,0.35);
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
}

.ultra-nav-mobile .mobile-submenu.open .submenu-toggle::after {
    content: "-";
}

.ultra-nav-mobile .ultra-link:last-child {
    border-bottom: none;
}

.ultra-nav-mobile.open {
    display: flex;
}

.ultra-nav-mobile hr {
    width: 100%;
    margin: 0.6rem 0;
    border: 0;
    border-top: 0.0625rem solid rgba(255,255,255,0.2);
    opacity: 1;
}

.mobile-user-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    min-height: 4rem;
    margin: 0.25rem 0 0.5rem;
    padding: 0.7rem 0.75rem;
    border: 0.0625rem solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.04);
    text-align: left;
    text-decoration: none;
}

.mobile-user-link:hover {
    background: rgba(212,0,0,0.22);
    color: #fff;
}

.mobile-user-link .mobile-avatar {
    flex: 0 0 auto;
    width: 2.75rem;
    height: 2.75rem;
    margin: 0;
    border: 0.125rem solid #D40000;
    border-radius: 50%;
    object-fit: cover;
}

.mobile-user-name {
    min-width: 0;
    margin: 0;
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

@media (max-width: 62rem) {
    .ultra-topband {
        padding: 0.55rem 0 0;
    }

    .ultra-topband .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }

    .ultra-logo {
        width: 10rem;
        max-width: calc(100vw - 5.5rem);
        padding-right: 0;
    }
}

@media (max-width: 30rem) {
    .ultra-nav-mobile {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        max-height: calc(100vh - 5.75rem);
    }

    .mobile-nav-tools {
        align-items: flex-start;
        flex-direction: column;
    }

    .mobile-language-flags {
        justify-content: flex-start;
        margin-left: 0;
    }

    .ultra-logo {
        width: 8.75rem;
    }

    .ultra-burger {
        width: 2.75rem;
        height: 2.75rem;
    }
}

@media (min-width: 62rem) {
    .ultra-burger,
    .ultra-nav-mobile {
        display: none !important;
    }
}

/* Cache la nav desktop < 992px */
@media (max-width: 62rem) {
    .ultra-nav {
        display: none !important;
    }
}

/* Style du dropdown Ultra */
.ultra-user-menu .dropdown-menu {
    background: #111;
    border: 1px solid #D40000;
    padding: 0;
}

.ultra-dropdown .dropdown-item {
    color: white;
    padding: 0.75rem 1.2rem;
    text-transform: uppercase;
    font-weight: 600;
}

.ultra-dropdown .dropdown-item:hover {
    background: #D40000;
    color: #fff;
}

.ultra-dropdown {
    z-index: 3100;
}

/* Sous-menu (saisons) à droite de "Photo de Match" */
.ultra-dropdown .dropdown-submenu {
    position: relative;
}

.ultra-dropdown .dropdown-submenu > .dropdown-menu {
    top: 0;
    left: 100%;
    margin-left: 0.2rem;
    display: none;
}

.ultra-dropdown .dropdown-submenu:hover > .dropdown-menu,
.ultra-dropdown .dropdown-submenu:focus-within > .dropdown-menu {
    display: block;
}

.ultra-dropdown .dropdown-submenu > .dropdown-toggle::after {
    float: right;
    margin-left: 0.6rem;
    font-size: 1.2rem;
    line-height: 1;
}

.user-avatar-menu {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 5px;
    border: 2px solid #fff;
}

.user-nav-trigger {
    min-width: 0;
}

.user-nav-label {
    display: block;
    min-width: 0;
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 62rem) and (max-width: 82rem) {
    .ultra-logo {
        width: 9.5rem;
        padding-right: 0.75rem;
    }

    .ultra-nav {
        gap: 0.1rem;
    }

    .ultra-nav .ultra-link {
        padding: 0 0.55rem;
        font-size: 0.9rem;
        letter-spacing: 0.015rem;
    }

    .ultra-nav .user-nav {
        max-width: 11rem;
    }

    .user-nav-label {
        max-width: 7rem;
    }
}

@media (min-width: 82rem) and (max-width: 92rem) {
    .ultra-nav .ultra-link {
        padding: 0 0.7rem;
        font-size: 0.95rem;
    }
}

.ultra-user-menu .dropdown-menu {
    background: #111;
    border: 1px solid #333;
}
.ultra-user-menu .dropdown-item {
    color: #fff;
}
.ultra-user-menu .dropdown-item:hover {
    background: #D40000;
    color: #fff;
}

.flag-icon {
    display: inline-block;
    width: 1.5rem;
    height: auto;
    aspect-ratio: 4 / 3;
    border-radius: 0.125rem;
    border: 0.0625rem solid rgba(255,255,255,0.2);
    background: transparent;
    object-fit: cover;
    flex: 0 0 auto;
}
