/* RUNPOTEC Maroc: en-tête et menu mobile / tablette (jusqu'à 991 px). Chargé après main.min.css. */

/* éléments propres au mobile : masqués sur ordinateur */
.header-logo-mobile,
.header-search-toggle,
.header-wa,
.offcanvas-close,
.offcanvas-actions { display: none; }

@media (max-width: 991px) {
  body { padding-top: 56px; }

  /* barre unique de 56 px : menu · logo · recherche · panier · WhatsApp */
  .page-header--top {
    position: fixed !important; top: 0; left: 0; right: 0;
    height: 56px !important; background: #0a0a0b !important; z-index: 10001;
  }
  .page-header--top > .container-fluid { padding: 0 !important; }
  .page-header--top > .container-fluid .page-header--top--right {
    float: none !important; height: 56px; padding: 0 !important;
    background: #0a0a0b !important; border-bottom: 1px solid #26262b !important;
  }
  .header-meta { height: 56px; }
  .header-meta--contact, .language-menu, .bookmarks { display: none !important; }
  .header-meta--other {
    display: flex !important; align-items: center; height: 56px;
    padding: 0 4px 0 2px; margin: 0; position: static !important;
    -webkit-tap-highlight-color: transparent;
  }

  /* le logo du bandeau de page est remplacé par celui de la barre */
  .logo-container { display: none !important; }
  .header-slider { padding-top: 0 !important; }

  /* bouton menu */
  .main-nav--toggle {
    order: 1; float: none !important; flex: none; position: relative;
    display: flex !important; align-items: center; justify-content: center;
    width: 48px; height: 48px; margin: 0 !important; padding: 0 !important;
    touch-action: manipulation;
  }
  .main-nav--toggle .bars { position: relative; width: 22px; height: 2px; background: #fff; }
  .main-nav--toggle .bars:before, .main-nav--toggle .bars:after {
    content: ""; position: absolute; left: 0; width: 100%; height: 2px; background: #fff;
  }
  .main-nav--toggle .bars:before { top: -7px; bottom: auto; }
  .main-nav--toggle .bars:after { bottom: -7px; top: auto; }

  /* logo */
  .header-logo-mobile {
    order: 2; display: flex; align-items: center; flex: 1 1 auto; min-width: 0;
    height: 48px; padding: 0 8px;
  }
  .header-logo-mobile img { display: block; height: 22px; width: auto; max-width: 100%; }

  /* boutons d'action */
  .header-search-toggle {
    order: 3; display: flex; align-items: center; justify-content: center; flex: none;
    width: 44px; height: 44px; margin: 0; padding: 0; border: 0; background: none;
    color: #fff; font-size: 20px; cursor: pointer; touch-action: manipulation;
  }
  .header-cart {
    order: 4; float: none !important; flex: none; position: relative;
    display: flex !important; align-items: center; justify-content: center;
    width: 44px; height: 44px; margin: 0 !important; padding: 0 !important;
    color: #fff; touch-action: manipulation;
  }
  .header-cart .text { display: none !important; }
  .header-cart .fa { margin: 0 !important; font-size: 22px; color: #fff; }
  .header-cart .cart-badge {
    position: absolute; top: 3px; right: 0; min-width: 18px; height: 18px;
    padding: 0 5px; line-height: 18px; border-radius: 9px;
    background: #c51b1b; color: #fff; font-size: 11px; font-weight: 700; text-align: center;
  }
  .header-wa {
    order: 5; display: flex; align-items: center; justify-content: center; flex: none;
    width: 40px; height: 40px; margin: 0 4px 0 6px; border-radius: 50%;
    background: #25d366; color: #fff; font-size: 24px; line-height: 1; text-decoration: none;
    touch-action: manipulation;
  }

  /* recherche : barre qui se déplie sous l'en-tête */
  .header-meta--search {
    order: 9; position: fixed !important; top: 56px; left: 0; right: 0;
    width: auto !important; margin: 0 !important; padding: 10px 12px; float: none !important; overflow: visible !important;
    background: #0a0a0b; border-bottom: 1px solid #26262b;
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .18s, transform .18s, visibility .18s;
  }
  .page-header--top.search-open .header-meta--search { opacity: 1; visibility: visible; transform: none; }
  .header-meta--search .search-form, .header-meta--search .form-search { position: relative; display: block; width: 100%; }
  .header-meta--search .search-field {
    width: 100% !important; height: 46px; padding: 0 48px 0 14px; box-sizing: border-box;
    font-size: 16px !important; color: #fff; background: #17171a;
    border: 1px solid #3a3a42; border-radius: 10px; -webkit-appearance: none;
  }
  .header-meta--search button[type="submit"] {
    position: absolute; right: 0; top: 0; width: 48px; height: 46px;
    border: 0; background: none; color: #fff; font-size: 18px;
  }
  .search-autocomplete-dropdown {
    width: auto !important; left: 0 !important; right: 0 !important; top: calc(100% + 6px) !important;
    max-height: 60vh !important; border-radius: 10px !important; border-color: #3a3a42 !important;
  }

  /* menu latéral */
  .offcanvas-menu {
    width: 86% !important; max-width: 360px; left: 0 !important;
    background: #0a0a0b !important; background-image: none !important;
    z-index: 10050 !important; padding-bottom: 28px; -webkit-overflow-scrolling: touch;
  }
  .offcanvas-menu--overlay { z-index: 10040 !important; }
  .offcanvas-menu--logo { display: block; text-align: left; padding: 20px 64px 14px 20px; }
  .offcanvas-menu--logo img { width: 160px; max-width: 100%; }
  .offcanvas-close {
    display: flex; align-items: center; justify-content: center; position: absolute; top: 8px; right: 8px;
    width: 44px; height: 44px; padding: 0; border: 0; background: none; color: #fff; font-size: 26px; cursor: pointer;
  }
  .offcanvas-menu > ul > li { border-bottom: 1px solid #26262b; }
  .offcanvas-menu > ul > li > a {
    display: block; margin: 0; padding: 15px 20px; min-height: 48px; box-sizing: border-box;
    color: #f4f4f2; font-size: 15px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  }
  .offcanvas-menu > ul > li > a:not(:only-child):after { color: #9a9aa0 !important; }
  .offcanvas-menu > ul > li > ul { background: #141417 !important; }
  .offcanvas-menu > ul > li > ul > li { border-top: 1px solid #26262b; }
  .offcanvas-menu > ul > li > ul > li > a {
    display: block; padding: 13px 20px 13px 34px; color: #d8d8dc !important; font-size: 14px; font-weight: 600;
  }
  .offcanvas-menu > ul > li.is-active > a, .offcanvas-menu > ul > li > ul > li.is-active > a { color: #e3192d !important; }
  .offcanvas-menu .offcanvas-cart-item a { color: #fff; }
  .offcanvas-menu .offcanvas-cart-item .fa { margin-right: 8px; color: #e3192d; }
  .offcanvas-actions { display: flex; flex-direction: column; gap: 10px; padding: 20px; }
  .offcanvas-actions .btn { display: block; margin: 0; padding: 14px; border-radius: 10px; text-align: center; font-weight: 700; }
  .offcanvas-actions .offcanvas-wa { background: #25d366; border-color: #25d366; color: #06210f; }
  .offcanvas-actions .offcanvas-wa .fa { margin-right: 8px; }
  .offcanvas-actions .offcanvas-pdf { background: transparent; border: 1px solid #3a3a42; color: #f4f4f2; }
}

@media (max-width: 991px) {
  /* anneau de focus discret dans le menu (au lieu du cadre blanc après un tap) */
  .offcanvas-menu a:focus, .header-meta--other a:focus, .header-meta--other button:focus { outline: none; }
  .offcanvas-menu a:focus-visible, .header-meta--other a:focus-visible, .header-meta--other button:focus-visible { outline: 2px solid #e3192d; outline-offset: -2px; }
}

/* computers up to 1599 px also use the side menu (design of runpotec.com): it needs its close button too */
@media (min-width: 992px) and (max-width: 1599px) {
  .offcanvas-close {
    display: flex; align-items: center; justify-content: center; position: absolute; top: 10px; right: 12px;
    width: 44px; height: 44px; padding: 0; border: 0; background: none; color: #111; font-size: 26px; cursor: pointer; z-index: 2;
  }
  .offcanvas-close:hover, .offcanvas-close:focus-visible { color: #c51b1b; }
}

/* floating WhatsApp button, every page */
.wa-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 9990;
  width: 58px; height: 58px; border-radius: 50%; background: #25d366; color: #fff !important;
  display: flex; align-items: center; justify-content: center; font-size: 32px; text-decoration: none !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .28); transition: transform .15s ease, box-shadow .15s ease;
}
.wa-float:hover, .wa-float:focus-visible { transform: scale(1.06); box-shadow: 0 8px 24px rgba(0, 0, 0, .35); color: #fff; }
.wa-float:focus-visible { outline: 3px solid #0a0a0b; outline-offset: 3px; }
@media (max-width: 600px) { .wa-float { right: 14px; bottom: 14px; width: 54px; height: 54px; font-size: 30px; } }
