
:root{
  --atc-black:#101010;
  --atc-white:#fff;
  --atc-line:#ececec;
  --atc-muted:#666;
  --atc-accent:#e31e24;
  --atc-shadow:0 7px 24px rgba(0,0,0,.10);
  --atc-header-h:62px;
}

.atc-mobile-shell{display:none}

@media (max-width: 767px){
  /* Masque uniquement le header desktop du thème Tousuit sur mobile. */
  body.atc-mobile-header-enabled #masthead,
  body.atc-mobile-header-enabled .site-header:not(.atc-mobile-header),
  body.atc-mobile-header-enabled .header-main,
  body.atc-mobile-header-enabled .header-wrapper:not(.atc-mobile-shell),
  body.atc-mobile-header-enabled .opal-header,
  body.atc-mobile-header-enabled .elementor-location-header{
    display:none !important;
  }

  body.atc-menu-open{overflow:hidden}

  .atc-mobile-shell{
    display:block;
    position:relative;
    z-index:99990;
    width:100%;
    background:var(--atc-white);
  }

  .atc-mobile-topbar{
    height:28px;
    padding:0 14px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    font-size:10px;
    font-weight:700;
    letter-spacing:.45px;
    text-transform:uppercase;
    color:#fff;
    background:var(--atc-black);
    white-space:nowrap;
  }

  .atc-mobile-topbar a{color:#fff;text-decoration:none}
  .atc-mobile-topbar .atc-dot{opacity:.45}

  .atc-mobile-header{
    min-height:var(--atc-header-h);
    display:grid;
    grid-template-columns:86px minmax(0,1fr) 86px;
    align-items:center;
    padding:0 10px;
    background:#fff;
    border-bottom:1px solid var(--atc-line);
    box-shadow:0 2px 10px rgba(0,0,0,.04);
    position:relative;
  }

  .atc-mobile-header svg,
  .atc-mobile-drawer svg,
  .atc-mobile-search-panel svg{
    width:23px;
    height:23px;
    fill:none;
    stroke:currentColor;
    stroke-width:1.8;
    stroke-linecap:round;
    stroke-linejoin:round;
  }

  .atc-mobile-icon-btn{
    width:42px;
    height:42px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    appearance:none;
    border:0;
    padding:0;
    background:transparent;
    color:var(--atc-black);
    text-decoration:none;
    cursor:pointer;
    position:relative;
    border-radius:50%;
    -webkit-tap-highlight-color:transparent;
  }

  .atc-mobile-icon-btn:active{background:#f5f5f5}

  .atc-mobile-logo{
    min-width:0;
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
  }

  .atc-mobile-logo .custom-logo-link{
    display:flex;
    align-items:center;
    justify-content:center;
    width:100%;
  }

  .atc-mobile-logo img{
    display:block;
    width:auto;
    max-width:142px;
    max-height:46px;
    object-fit:contain;
  }

  .atc-mobile-text-logo{
    color:var(--atc-black);
    font-size:21px;
    font-weight:900;
    text-decoration:none;
    letter-spacing:-.5px;
  }

  .atc-mobile-actions{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:2px;
  }

  .atc-cart-count{
    position:absolute;
    top:4px;
    right:1px;
    min-width:18px;
    height:18px;
    padding:0 4px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:20px;
    background:var(--atc-accent);
    color:#fff;
    font-size:10px;
    line-height:1;
    font-weight:800;
    border:2px solid #fff;
  }

  .atc-mobile-search-panel{
    padding:10px 12px 12px;
    background:#fff;
    border-bottom:1px solid var(--atc-line);
    box-shadow:0 7px 16px rgba(0,0,0,.06);
  }

  .atc-mobile-search-panel[hidden]{display:none!important}

  .atc-mobile-search-form{
    display:flex;
    height:46px;
    background:#f5f5f5;
    border-radius:8px;
    overflow:hidden;
  }

  .atc-mobile-search-form input[type=search]{
    min-width:0;
    flex:1;
    height:46px;
    padding:0 14px;
    border:0!important;
    outline:0!important;
    box-shadow:none!important;
    background:transparent;
    font-size:14px;
    color:#111;
  }

  .atc-mobile-search-form button{
    width:50px;
    flex:0 0 50px;
    border:0;
    background:var(--atc-black);
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
  }

  .atc-mobile-overlay{
    position:fixed;
    z-index:99996;
    inset:0;
    background:rgba(0,0,0,.54);
    backdrop-filter:blur(1px);
  }
  .atc-mobile-overlay[hidden]{display:none!important}

  .atc-mobile-drawer{
    position:fixed;
    z-index:99999;
    top:0;
    bottom:0;
    left:0;
    width:min(88vw,360px);
    background:#fff;
    box-shadow:var(--atc-shadow);
    transform:translateX(-102%);
    transition:transform .26s ease;
    display:flex;
    flex-direction:column;
    overflow:hidden;
  }

  .atc-mobile-drawer.is-open{transform:translateX(0)}

  .atc-mobile-drawer-head{
    min-height:70px;
    padding:10px 12px 10px 18px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    border-bottom:1px solid var(--atc-line);
  }

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

  .atc-mobile-drawer-tools{
    display:grid;
    grid-template-columns:1fr 1fr;
    border-bottom:1px solid var(--atc-line);
  }

  .atc-mobile-drawer-tools>a{
    min-height:60px;
    padding:8px 10px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    color:#111;
    text-decoration:none;
    font-size:12px;
    font-weight:700;
    position:relative;
  }

  .atc-mobile-drawer-tools>a:first-child{border-right:1px solid var(--atc-line)}
  .atc-mobile-drawer-tools .atc-cart-count{top:6px;right:10px}

  .atc-mobile-nav{
    flex:1 1 auto;
    overflow:auto;
    -webkit-overflow-scrolling:touch;
    padding:6px 0 14px;
  }

  .atc-mobile-nav ul{
    list-style:none;
    margin:0;
    padding:0;
  }

  .atc-mobile-nav li{
    position:relative;
    margin:0;
    padding:0;
    border-bottom:1px solid #f0f0f0;
  }

  .atc-mobile-nav li>a{
    min-height:49px;
    padding:12px 46px 12px 18px;
    display:flex;
    align-items:center;
    color:#111;
    text-decoration:none;
    font-size:14px;
    font-weight:700;
    line-height:1.35;
  }

  .atc-mobile-nav .sub-menu{
    display:none;
    background:#fafafa;
    border-top:1px solid #f0f0f0;
  }

  .atc-mobile-nav li.submenu-open>.sub-menu{display:block}

  .atc-mobile-nav .sub-menu li>a{
    padding-left:30px;
    font-size:13px;
    font-weight:600;
    min-height:44px;
  }

  .atc-mobile-nav .sub-menu .sub-menu li>a{padding-left:43px}

  .atc-submenu-toggle{
    position:absolute;
    top:5px;
    right:7px;
    width:38px;
    height:38px;
    display:flex;
    align-items:center;
    justify-content:center;
    border:0;
    background:transparent;
    color:#555;
    border-radius:6px;
  }

  .atc-submenu-toggle svg{
    width:18px;
    height:18px;
    transition:transform .2s ease;
  }

  li.submenu-open>.atc-submenu-toggle svg{transform:rotate(90deg)}

  .atc-mobile-drawer-bottom{
    padding:14px 16px calc(14px + env(safe-area-inset-bottom));
    border-top:1px solid var(--atc-line);
    background:#fff;
  }

  .atc-mobile-shop-btn{
    height:46px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:7px;
    background:var(--atc-black);
    color:#fff!important;
    text-decoration:none!important;
    text-transform:uppercase;
    letter-spacing:.3px;
    font-size:12px;
    font-weight:800;
  }

  .atc-mobile-phone{
    margin-top:12px;
    display:flex;
    align-items:center;
    justify-content:center;
    gap:10px;
    color:#111!important;
    text-decoration:none!important;
    font-size:15px;
    font-weight:800;
  }

  .atc-mobile-phone svg{width:21px;height:21px}
  .atc-mobile-phone span{display:flex;flex-direction:column;line-height:1.15}
  .atc-mobile-phone small{
    margin-bottom:2px;
    color:var(--atc-muted);
    font-size:10px;
    font-weight:600;
    text-transform:uppercase;
    letter-spacing:.4px;
  }

  body.admin-bar .atc-mobile-drawer{top:46px}

  @media (min-width: 600px){
    body.admin-bar .atc-mobile-drawer{top:46px}
  }

  @supports (position: sticky){
    .atc-mobile-shell.atc-is-sticky{
      position:sticky;
      top:0;
    }
    body.admin-bar .atc-mobile-shell.atc-is-sticky{top:46px}
  }
}

@media (min-width:768px){
  .atc-mobile-shell{display:none!important}
}


/* ===== ATC Mobile Header v1.1 fixes ===== */
@media (max-width: 767px){

  /* Cache la navigation mobile basse du thème pour éviter les doublons
     Recherche / Compte / Panier avec le nouveau header. */
  body.atc-mobile-header-enabled .mobile-navigation,
  body.atc-mobile-header-enabled .mobile-nav,
  body.atc-mobile-header-enabled .bottom-mobile-menu,
  body.atc-mobile-header-enabled .bottom-nav,
  body.atc-mobile-header-enabled .footer-mobile-nav,
  body.atc-mobile-header-enabled .handheld-footer-bar,
  body.atc-mobile-header-enabled .mobile-footer,
  body.atc-mobile-header-enabled .site-mobile-footer,
  body.atc-mobile-header-enabled .opal-handheld-footer-bar,
  body.atc-mobile-header-enabled .tousuit-mobile-menu,
  body.atc-mobile-header-enabled [class*="handheld-footer"],
  body.atc-mobile-header-enabled [class*="mobile-bottom"],
  body.atc-mobile-header-enabled [class*="bottom-mobile"]{
    display:none !important;
  }

  /* Logo plus lisible et mieux centré */
  .atc-mobile-header{
    grid-template-columns:72px minmax(0,1fr) 82px;
    min-height:66px;
    padding-left:8px;
    padding-right:8px;
  }

  .atc-mobile-logo img{
    max-width:160px;
    max-height:52px;
  }

  .atc-mobile-logo .custom-logo-link{
    overflow:visible;
  }

  .atc-mobile-actions{
    gap:0;
  }

  .atc-mobile-icon-btn{
    width:40px;
    height:40px;
  }

  /* Un peu plus d'espace entre le header et le contenu */
  .atc-mobile-search-panel{
    position:relative;
    z-index:2;
  }
}


/* ===== ATC Mobile Header v1.2 - Header noir ===== */
@media (max-width: 767px){

  .atc-mobile-header{
    background:#000 !important;
    border-bottom-color:#000 !important;
    box-shadow:0 2px 12px rgba(0,0,0,.18);
  }

  .atc-mobile-header .atc-mobile-icon-btn,
  .atc-mobile-header .atc-mobile-text-logo{
    color:#fff !important;
  }

  .atc-mobile-header .custom-logo-link,
  .atc-mobile-header .custom-logo{
    background:transparent !important;
  }

  .atc-mobile-header .atc-cart-count{
    background:#e31e24;
    color:#fff;
    border-color:#000;
  }

  .atc-mobile-header .atc-mobile-icon-btn:active{
    background:rgba(255,255,255,.10);
  }
}


/* ===== ATC Mobile Header v1.2.1 - Logo complet ===== */
@media (max-width: 767px){

  /* Donner plus d'espace visuel au logo */
  .atc-mobile-header{
    position:relative;
    display:flex !important;
    align-items:center;
    justify-content:space-between;
    min-height:68px;
    padding:0 10px;
  }

  .atc-open-menu{
    flex:0 0 40px;
    position:relative;
    z-index:2;
  }

  .atc-mobile-actions{
    flex:0 0 auto;
    min-width:78px;
    display:flex;
    align-items:center;
    justify-content:flex-end;
    position:relative;
    z-index:2;
  }

  .atc-mobile-logo{
    position:absolute;
    left:50%;
    top:50%;
    transform:translate(-50%, -50%);
    width:calc(100% - 150px); /* réserve la place pour menu + actions */
    max-width:220px;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:visible !important;
    z-index:1;
    pointer-events:none;
  }

  .atc-mobile-logo .custom-logo-link{
    max-width:100%;
    width:100%;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:visible !important;
    pointer-events:auto;
  }

  .atc-mobile-logo img,
  .atc-mobile-logo .custom-logo{
    display:block;
    width:auto !important;
    max-width:100% !important;
    max-height:54px !important;
    object-fit:contain;
  }

  /* Si le logo texte est utilisé */
  .atc-mobile-text-logo{
    white-space:nowrap;
    font-size:24px;
    line-height:1;
  }
}


/* ===== ATC Mobile Header v1.3 - Logo officiel ATC Sport ===== */
@media (max-width: 767px){
  .atc-mobile-logo{
    position:absolute !important;
    left:50% !important;
    top:50% !important;
    transform:translate(-50%,-50%) !important;
    width:190px !important;
    max-width:calc(100vw - 180px) !important;
    height:58px !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    overflow:visible !important;
    pointer-events:none;
  }

  .atc-mobile-custom-logo-link{
    width:100% !important;
    height:100% !important;
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;
    overflow:visible !important;
    pointer-events:auto;
    background:transparent !important;
  }

  .atc-mobile-custom-logo{
    display:block !important;
    width:100% !important;
    height:100% !important;
    max-width:100% !important;
    max-height:100% !important;
    object-fit:contain !important;
    object-position:center center !important;
    margin:0 !important;
    padding:0 !important;
    border:0 !important;
  }

  .atc-mobile-drawer-logo{
    width:190px !important;
    max-width:70% !important;
    height:52px !important;
    overflow:visible !important;
  }

  .atc-mobile-drawer-logo .atc-mobile-custom-logo-link{
    width:100% !important;
    height:100% !important;
  }

  .atc-mobile-drawer-logo .atc-mobile-custom-logo{
    width:100% !important;
    height:100% !important;
    object-fit:contain !important;
    object-position:left center !important;
  }
}

/* Keep it hidden on desktop with the rest of the mobile header */
@media (min-width:768px){
  .atc-mobile-custom-logo{display:block}
}
