/*
 * Tennis2Table - En-tête responsive 2026
 * Thème enfant Extra - T2T.14
 */

:root {
    --t2t-red: #e63237;
    --t2t-red-dark: #cf252c;
    --t2t-blue: #074879;
    --t2t-blue-deep: #063b68;
    --t2t-blue-darker: #052f55;
    --t2t-white: #ffffff;
    --t2t-line: rgba(255,255,255,.22);
    --t2t-shadow: 0 8px 24px rgba(0, 28, 56, .18);
}

/* =========================================================
   DESKTOP : compléments dans la barre rouge Extra
   ========================================================= */
@media (min-width: 981px) {
    .t2t-auth-link-hidden,
    .t2t-native-socials-hidden,
    #top-header .t2t-desktop-search-hidden,
    #top-header .et-top-search,
    #top-header .et-search-form,
    #top-header .et-search-field,
    #top-header #et-search-icon,
    #top-header .et-search-icon {
        display: none !important;
    }

    #top-header .container {
        position: relative;
    }

    /* Bloc généré par le thème enfant, calé à droite après suppression de la recherche. */
    #top-header .t2t-desktop-actions {
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        float: none !important;
        display: inline-flex;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        min-height: 34px;
        margin: 0;
        padding: 0;
        vertical-align: middle;
        white-space: nowrap;
        z-index: 5;
    }

    #top-header .t2t-desktop-socials {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        margin: 0;
        padding: 0;
    }

    #top-header a.t2t-desktop-social {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        padding: 0 !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        border: 0 !important;
        border-radius: 4px;
        box-sizing: border-box;
        background: rgba(255,255,255,.14) !important;
        color: #fff !important;
        line-height: 1 !important;
        opacity: 1 !important;
        text-decoration: none !important;
        transition: background-color .18s ease, transform .18s ease;
    }

    #top-header a.t2t-desktop-social:hover,
    #top-header a.t2t-desktop-social:focus-visible {
        background: rgba(255,255,255,.23) !important;
        color: #fff !important;
        transform: translateY(-1px);
        outline: none;
    }

    #top-header a.t2t-desktop-social svg {
        display: block;
        width: 17px;
        height: 17px;
        flex: 0 0 17px;
        fill: currentColor;
    }

    /* Mon Espace : largeur automatique, texte jamais écrasé par les règles des icônes Extra. */
    #top-header a.t2t-desktop-myspace {
        width: auto !important;
        min-width: 118px !important;
        height: 32px !important;
        min-height: 32px !important;
        padding: 0 12px !important;
        margin: 0 !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        gap: 7px;
        box-sizing: border-box;
        border: 1px solid rgba(255,255,255,.72) !important;
        border-radius: 5px;
        background: var(--t2t-blue-deep) !important;
        color: #fff !important;
        font-size: 13px !important;
        font-weight: 700 !important;
        line-height: 1 !important;
        text-transform: none !important;
        white-space: nowrap !important;
        text-decoration: none !important;
        box-shadow: 0 2px 8px rgba(0,0,0,.08);
        transition: background-color .18s ease, transform .18s ease;
    }

    #top-header a.t2t-desktop-myspace:hover,
    #top-header a.t2t-desktop-myspace:focus-visible {
        background: var(--t2t-blue-darker) !important;
        color: #fff !important;
        transform: translateY(-1px);
        outline: none;
    }

    #top-header a.t2t-desktop-myspace svg {
        width: 16px;
        height: 16px;
        flex: 0 0 16px;
        fill: currentColor;
    }

    #top-header a.t2t-desktop-myspace span {
        display: inline-block !important;
        width: auto !important;
        max-width: none !important;
        overflow: visible !important;
        white-space: nowrap !important;
    }
}

/* L'en-tête spécifique mobile n'existe visuellement que sous 981px. */
.t2t-mobile-header {
    display: none;
}

/* =========================================================
   MOBILE : barre sociale + ligne logo/actions + menu structuré
   ========================================================= */
@media (max-width: 980px) {
    body.t2t-mobile-ready #top-header,
    body.t2t-mobile-ready #main-header,
    body.t2t-mobile-ready header#main-header,
    body.t2t-mobile-ready .et-l--header {
        display: none !important;
    }

    body.t2t-mobile-ready.et_fixed_nav #page-container,
    body.t2t-mobile-ready.et_non_fixed_nav.et_transparent_nav #page-container,
    body.t2t-mobile-ready #page-container {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    .t2t-mobile-header {
        position: sticky;
        top: 0;
        z-index: 99990;
        display: block;
        width: 100%;
        background: var(--t2t-blue-deep);
        box-shadow: var(--t2t-shadow);
        font-family: inherit;
    }

    body.admin-bar .t2t-mobile-header {
        top: 46px;
    }

    .t2t-mobile-socials {
        min-height: 45px;
        padding: 5px 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        background: var(--t2t-red);
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .t2t-mobile-socials::-webkit-scrollbar {
        display: none;
    }

    .t2t-mobile-socials a {
        width: 34px;
        height: 34px;
        flex: 0 0 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 !important;
        margin: 0 !important;
        line-height: 1 !important;
        background: rgba(255,255,255,.14) !important;
        color: #fff !important;
        border-radius: 4px;
        box-sizing: border-box;
        text-decoration: none !important;
        box-shadow: inset 0 0 0 1px rgba(255,255,255,.04);
        transition: background-color .18s ease, transform .18s ease, opacity .18s ease;
    }

    .t2t-mobile-socials a:hover,
    .t2t-mobile-socials a:focus-visible {
        background: rgba(255,255,255,.20) !important;
        color: #fff !important;
        outline: none;
    }

    .t2t-mobile-socials a:active {
        background: rgba(255,255,255,.20) !important;
        transform: scale(.96);
    }

    .t2t-mobile-socials a::before,
    .t2t-mobile-socials a::after {
        color: inherit !important;
    }

    .t2t-mobile-socials svg {
        display: block;
        width: 18px;
        height: 18px;
        fill: currentColor;
        flex: 0 0 18px;
    }

    .t2t-mobile-socials .et-extra-icon,
    .t2t-mobile-socials .et-social-icon,
    .t2t-mobile-socials .social-icon,
    .t2t-mobile-socials .fa,
    .t2t-mobile-socials .fab,
    .t2t-mobile-socials .fas,
    .t2t-mobile-socials .far,
    .t2t-mobile-socials i {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 18px !important;
        height: 18px !important;
        font-size: 18px !important;
        line-height: 1 !important;
        color: inherit !important;
    }

    .t2t-mobile-mainrow {
        min-height: 72px;
        padding: 9px 12px;
        display: grid;
        grid-template-columns: minmax(108px, 1fr) auto auto auto;
        gap: 8px;
        align-items: center;
        background: linear-gradient(90deg, var(--t2t-blue-deep), var(--t2t-blue));
        border-bottom: 1px solid var(--t2t-line);
    }

    .t2t-mobile-logo {
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        text-decoration: none !important;
    }

    .t2t-mobile-logo img {
        display: block;
        max-width: 145px;
        width: auto;
        max-height: 52px;
        height: auto;
        object-fit: contain;
    }

    .t2t-mobile-logo-text {
        color: #fff;
        font-size: 20px;
        font-weight: 900;
        letter-spacing: -.5px;
    }

    .t2t-mobile-space {
        min-height: 40px;
        padding: 0 11px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        border: 1px solid rgba(255,255,255,.78);
        border-radius: 7px;
        background: rgba(3, 45, 80, .5);
        color: #fff !important;
        font-size: 14px;
        font-weight: 700;
        line-height: 1;
        white-space: nowrap;
        text-decoration: none !important;
    }

    .t2t-mobile-space svg {
        width: 16px;
        height: 16px;
        fill: currentColor;
        flex: 0 0 auto;
    }

    .t2t-mobile-iconbutton {
        -webkit-appearance: none !important;
        appearance: none !important;
        width: 46px !important;
        height: 46px !important;
        min-width: 46px !important;
        min-height: 46px !important;
        padding: 0 !important;
        margin: 0 !important;
        display: grid !important;
        place-items: center !important;
        border: 2px solid rgba(255,255,255,.95) !important;
        border-radius: 50% !important;
        background: transparent !important;
        color: #fff !important;
        line-height: 0 !important;
        font-size: 0 !important;
        box-sizing: border-box !important;
        cursor: pointer;
        overflow: hidden;
        -webkit-tap-highlight-color: transparent;
    }

    .t2t-mobile-iconbutton::before,
    .t2t-mobile-iconbutton::after {
        content: none !important;
        display: none !important;
    }

    .t2t-mobile-iconbutton:active,
    .t2t-mobile-iconbutton[aria-expanded="true"] {
        background: rgba(255,255,255,.10) !important;
    }

    .t2t-mobile-iconbutton svg {
        position: static !important;
        display: block !important;
        width: 24px !important;
        height: 24px !important;
        margin: 0 !important;
        padding: 0 !important;
        transform: none !important;
        stroke: currentColor;
        fill: none;
        stroke-width: 2.2;
        stroke-linecap: round;
        stroke-linejoin: round;
        box-sizing: content-box;
    }

    .t2t-mobile-searchrow {
        display: none;
        padding: 10px 12px 12px;
        background: var(--t2t-blue-deep);
        border-bottom: 1px solid var(--t2t-line);
    }

    .t2t-mobile-searchrow.is-open {
        display: block;
    }

    .t2t-mobile-searchform {
        display: flex;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
        background: #fff;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 4px 14px rgba(0,0,0,.12);
    }

    .t2t-mobile-searchform input[type="search"] {
        min-width: 0;
        flex: 1 1 auto;
        height: 44px;
        margin: 0 !important;
        padding: 0 13px !important;
        border: 0 !important;
        outline: none !important;
        background: #fff !important;
        color: #1c2c3a !important;
        font-size: 16px !important;
        box-shadow: none !important;
    }

    .t2t-mobile-searchform button {
        width: 48px;
        flex: 0 0 48px;
        border: 0;
        background: var(--t2t-red);
        color: #fff;
        cursor: pointer;
    }

    .t2t-mobile-searchform button svg {
        width: 21px;
        height: 21px;
        stroke: currentColor;
        fill: none;
        stroke-width: 2.3;
    }

    .t2t-mobile-drawer {
        display: none;
        max-height: calc(100vh - 117px);
        overflow-y: auto;
        overscroll-behavior: contain;
        background: linear-gradient(180deg, #0b4b80 0%, #05355f 100%);
        color: #fff;
        box-shadow: 0 12px 28px rgba(0, 25, 50, .22);
    }

    .t2t-mobile-drawer.is-open {
        display: block;
        animation: t2tMenuIn .18s ease-out both;
    }

    @keyframes t2tMenuIn {
        from { opacity: 0; transform: translateY(-5px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .t2t-mobile-nav {
        margin: 0;
        padding: 12px 14px 18px;
        list-style: none;
    }

    .t2t-mobile-nav > li {
        margin: 0;
        padding: 0;
        border-bottom: 1px solid rgba(255,255,255,.06);
    }

    .t2t-mobile-nav > li:last-child {
        border-bottom: 0;
    }

    .t2t-mobile-nav-link,
    .t2t-mobile-nav-toggle {
        position: relative;
        min-height: 56px;
        width: 100%;
        margin: 0;
        padding: 7px 4px;
        display: grid;
        gap: 8px;
        align-items: center;
        border: 0;
        background: transparent;
        color: #fff !important;
        text-align: left;
        text-decoration: none !important;
        font-size: 17px;
        font-weight: 600;
        line-height: 1.2;
        cursor: pointer;
    }

    .t2t-mobile-nav-link {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .t2t-mobile-nav-toggle {
        grid-template-columns: 38px minmax(0, 1fr) 28px;
    }

    .t2t-mobile-nav-link::before,
    .t2t-mobile-nav-toggle::before {
        content: "";
        position: absolute;
        left: -14px;
        top: 9px;
        bottom: 9px;
        width: 3px;
        border-radius: 3px;
        background: transparent;
    }

    .t2t-mobile-nav-link.is-active::before {
        background: var(--t2t-red);
    }

    .t2t-mobile-nav-link.is-active {
        color: #fff !important;
        background: rgba(255,255,255,.055);
    }

    .t2t-mobile-nav-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #fff;
    }

    .t2t-mobile-nav-icon svg {
        width: 24px;
        height: 24px;
        fill: currentColor;
        stroke: currentColor;
    }

    .t2t-mobile-chevron {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        transition: transform .18s ease;
    }

    .t2t-mobile-chevron svg {
        width: 18px;
        height: 18px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2.2;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .t2t-mobile-nav-toggle[aria-expanded="true"] .t2t-mobile-chevron,
    .t2t-mobile-nav-arrow[aria-expanded="true"] .t2t-mobile-chevron,
    .t2t-mobile-tree-arrow[aria-expanded="true"] .t2t-mobile-chevron {
        transform: rotate(90deg);
    }

    /* Ligne à deux zones cliquables : texte = page, flèche = sous-menu. */
    .t2t-mobile-nav-split {
        min-height: 56px;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 48px;
        align-items: stretch;
    }

    .t2t-mobile-nav-main {
        position: relative;
        min-width: 0;
        padding: 7px 4px;
        display: grid;
        grid-template-columns: 38px 1fr;
        gap: 8px;
        align-items: center;
        color: #fff !important;
        text-decoration: none !important;
        font-size: 17px;
        font-weight: 600;
        line-height: 1.2;
    }

    .t2t-mobile-nav-main::before {
        content: "";
        position: absolute;
        left: -14px;
        top: 9px;
        bottom: 9px;
        width: 3px;
        border-radius: 3px;
        background: transparent;
    }

    .t2t-mobile-nav-main.is-active::before {
        background: var(--t2t-red);
    }

    .t2t-mobile-nav-main.is-active {
        background: rgba(255,255,255,.055);
    }

    .t2t-mobile-nav-arrow {
        width: 48px;
        min-height: 56px;
        margin: 0;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 0;
        border-left: 1px solid rgba(255,255,255,.07);
        background: transparent;
        color: #fff;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .t2t-mobile-nav-arrow:active,
    .t2t-mobile-nav-arrow[aria-expanded="true"] {
        background: rgba(255,255,255,.08);
    }

    .t2t-mobile-nav-arrow .t2t-mobile-chevron {
        transition: transform .18s ease;
    }

    .t2t-mobile-submenu {
        display: none;
        margin: 0 0 8px 46px;
        padding: 0 0 4px;
        list-style: none;
    }

    .t2t-mobile-submenu.is-open {
        display: block;
    }

    /* Arbre de sous-menus : les feuilles n'ont aucune flèche. */
    .t2t-mobile-submenu-tree {
        margin-left: 46px;
        padding-right: 2px;
    }

    .t2t-mobile-tree-item,
    .t2t-mobile-tree-children {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .t2t-mobile-tree-item {
        border-bottom: 1px solid rgba(255,255,255,.045);
    }

    .t2t-mobile-tree-item:last-child {
        border-bottom: 0;
    }

    .t2t-mobile-tree-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 44px;
        align-items: stretch;
    }

    .t2t-mobile-tree-link {
        position: relative;
        display: flex;
        min-height: 44px;
        align-items: center;
        padding: 9px 12px;
        border-left: 1px solid rgba(255,255,255,.28);
        color: rgba(255,255,255,.90) !important;
        text-decoration: none !important;
        font-size: 15px;
        font-weight: 500;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .t2t-mobile-tree-item.has-children > .t2t-mobile-tree-row > .t2t-mobile-tree-link {
        font-weight: 700;
        color: #fff !important;
        background: rgba(255,255,255,.035);
    }

    .t2t-mobile-tree-link.is-active {
        border-left-color: var(--t2t-red);
        background: rgba(255,255,255,.07) !important;
        color: #fff !important;
    }

    .t2t-mobile-tree-arrow {
        -webkit-appearance: none;
        appearance: none;
        width: 44px;
        min-height: 44px;
        margin: 0;
        padding: 0;
        display: grid;
        place-items: center;
        border: 0;
        border-left: 1px solid rgba(255,255,255,.08);
        background: rgba(255,255,255,.025);
        color: #fff;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }

    .t2t-mobile-tree-arrow:active,
    .t2t-mobile-tree-arrow[aria-expanded="true"] {
        background: rgba(255,255,255,.09);
    }

    .t2t-mobile-tree-children {
        display: none;
        margin: 0 0 5px 12px;
        padding: 0;
    }

    .t2t-mobile-tree-children.is-open {
        display: block;
    }

    .t2t-mobile-tree-level-2 > .t2t-mobile-tree-link,
    .t2t-mobile-tree-level-2 > .t2t-mobile-tree-row > .t2t-mobile-tree-link {
        min-height: 40px;
        padding-top: 8px;
        padding-bottom: 8px;
        font-size: 14px;
        color: rgba(255,255,255,.82) !important;
        border-left-color: rgba(255,255,255,.16);
    }

    .t2t-mobile-tree-level-3 > .t2t-mobile-tree-link,
    .t2t-mobile-tree-level-3 > .t2t-mobile-tree-row > .t2t-mobile-tree-link {
        min-height: 38px;
        padding-top: 7px;
        padding-bottom: 7px;
        font-size: 13.5px;
        color: rgba(255,255,255,.78) !important;
    }

    .t2t-mobile-footerlink {
        margin: 5px 14px 16px;
        padding-top: 12px;
        border-top: 1px solid rgba(255,255,255,.30);
    }

    .t2t-mobile-footerlink a {
        min-height: 48px;
        padding: 0 4px;
        display: flex;
        align-items: center;
        gap: 12px;
        color: #fff !important;
        text-decoration: none !important;
        font-size: 16px;
        font-weight: 700;
    }

    .t2t-mobile-footerlink svg {
        width: 22px;
        height: 22px;
        fill: currentColor;
    }

    body.t2t-menu-open {
        overflow: hidden;
    }
}

@media (max-width: 460px) {
    .t2t-mobile-mainrow {
        grid-template-columns: minmax(92px, 1fr) auto auto auto;
        gap: 4px;
        padding-left: 9px;
        padding-right: 7px;
    }

    .t2t-mobile-logo img {
        max-width: 126px;
        max-height: 47px;
    }

    .t2t-mobile-space {
        padding: 0 8px;
        font-size: 13px;
    }

    .t2t-mobile-iconbutton {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
    }

    .t2t-mobile-iconbutton svg {
        width: 23px !important;
        height: 23px !important;
    }

    .t2t-mobile-socials {
        justify-content: flex-start;
        padding-left: max(10px, calc((100vw - 320px) / 2));
    }
}

@media (max-width: 365px) {
    .t2t-mobile-space span {
        display: none;
    }

    .t2t-mobile-space {
        width: 40px;
        padding: 0;
    }
}
