/* ══════════════════════════════════════════════════════════════
   STRASSELEC — RESPONSIVE DESIGN COMPLET
   Tablette MD : 768px–991px  |  Mobile : ≤767px  |  Nano : ≤479px
   ══════════════════════════════════════════════════════════════ */

/* ── 1. TABLETTE (768px – 991px) ──────────────────────────────── */
@media (min-width: 768px) and (max-width: 991px) {

  /* Nav bar : scroll horizontal tactile invisible */
  #stras-nav-bar > .container {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0;
  }
  #stras-nav-bar > .container::-webkit-scrollbar { display: none; }
  #stras-nav-bar #_desktop_top_menu { width: max-content !important; }
  #stras-nav-bar #top-menu { flex-wrap: nowrap !important; }
  #stras-nav-bar #top-menu > li > a {
    font-size: .63rem !important;
    padding: 10px 7px !important;
  }

  #_desktop_logo .logo { max-height: 110px !important; }
  #search_widget { max-width: 310px; }

  #left-column { flex: 0 0 28% !important; max-width: 28% !important; }
  .js-content-wrapper.left-column { flex: 0 0 72% !important; max-width: 72% !important; }

  ul.subcategories-list { display: grid !important; grid-template-columns: 1fr 1fr 1fr !important; gap: 10px !important; list-style: none !important; padding: 0 !important; margin: 0 !important; }
  ul.subcategories-list > li { width: auto !important; max-width: none !important; flex: none !important; }

  body.page-index .products .js-product,
  body.page-search .products .js-product {
    flex: 0 0 33.333% !important; max-width: 33.333% !important;
  }

  .footer-container .links .col-md-3 {
    flex: 0 0 50% !important; max-width: 50% !important; margin-bottom: .8rem;
  }
}

/* ── 2. MOBILE (<=767px) — GENERAL ────────────────────────────── */
@media (max-width: 767px) {

  /* Barres horizontales masquées : nav catégories + barre recherche/desktop */
  #stras-nav-bar { display: none !important; }
  .header-top { display: none !important; }

  .header-nav { background: #fff; border-bottom: 1px solid #dce8f0; box-shadow: 0 2px 6px rgba(0,0,0,.07); }
  .header-nav .container { padding: 0 8px; }
  .header-nav .mobile { display: flex !important; align-items: center; min-height: 56px; padding: 4px 0; }

  #menu-icon { order: 1; flex-shrink: 0; display: flex; align-items: center; padding: 8px 8px 8px 2px; cursor: pointer; }
  .header-nav .top-logo { order: 2; flex: 1; display: flex; align-items: center; justify-content: center; padding: 4px 8px; }
  #_mobile_user_info { order: 3; flex-shrink: 0; }
  #_mobile_cart { order: 4; flex-shrink: 0; }

  /* Barre header plus haute pour accueillir le logo agrandi */
  .header-nav .mobile { min-height: 72px !important; padding: 6px 0; }

  #menu-icon .material-icons { color: #1a2b4a; font-size: 1.9rem; line-height: 1; }

  /* Logo : bien visible, centré, pas rogné */
  .header-nav .top-logo img {
    max-height: 62px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
  }

  #_mobile_cart a, #_mobile_user_info a { display: flex; align-items: center; padding: 8px 5px; color: #1a2b4a; }
  #_mobile_cart .material-icons, #_mobile_user_info .material-icons { color: #1a2b4a; font-size: 1.5rem; }
  #_mobile_cart .body { display: none !important; }
  #_mobile_cart .cart-products-count { font-size: .72rem; font-weight: 700; color: #24b9d7; }

  .header-top { padding: 8px 0 10px !important; }
  .header-top-right { width: 100% !important; max-width: 100% !important; padding: 0 10px !important; }
  #search_widget { max-width: 100% !important; width: 100% !important; margin: 0 !important; }

  #left-column { display: none !important; }
  .js-content-wrapper.left-column,
  #content-wrapper { flex: 0 0 100% !important; max-width: 100% !important; padding-left: 10px !important; padding-right: 10px !important; }

  .products .js-product { flex: 0 0 50% !important; max-width: 50% !important; padding-left: 6px !important; padding-right: 6px !important; }
  .product-miniature .thumbnail-container { border-radius: 4px; }
  .product-miniature .product-title a { font-size: .82rem; }
  .product-miniature .price { font-size: .9rem; }
  .product-miniature .highlighted-informations { display: none; }

  nav.breadcrumb-container { overflow-x: auto; white-space: nowrap; padding: .3rem 10px; }
  .breadcrumb { flex-wrap: nowrap; font-size: .75rem; padding: .3rem 0; margin: 0; background: transparent; }

  h1.h1, .h1 { font-size: 1.3rem !important; }
  .products-section-title { font-size: 1rem; }

  ul.subcategories-list { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 8px !important; list-style: none !important; padding: 0 !important; margin: 0 !important; }
  ul.subcategories-list > li { width: auto !important; max-width: none !important; flex: none !important; }
  .subcategory-image img { width: 100%; height: auto; border-radius: 4px; }
  .subcategory-name { font-size: .8rem; font-weight: 600; text-align: center; }

  .total-products.col-lg-5 { display: none; }
  .products-sort-order .select-title { font-size: .82rem; padding: 6px 10px; }

  .pagination { justify-content: center; flex-wrap: wrap; gap: 3px; }
  .page-link { padding: .4rem .65rem; font-size: .84rem; min-width: 34px; text-align: center; }

  .product-cover img { width: 100%; height: auto; }
  .product-prices .current-price { font-size: 1.5rem; }
  .product-add-to-cart .btn.add-to-cart { width: 100%; padding: 13px; font-size: .95rem; }
  .product-quantity .qty { width: 64px; }
  .product-tabs .nav-tabs .nav-link { font-size: .82rem; padding: .5rem .75rem; }

  .page-content table, .product-description table, .product-description-short table {
    display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%;
  }

  .page-content img, .product-description img, .product-description-short img {
    max-width: 100% !important; height: auto !important;
  }

  .block_newsletter .input-group { display: flex; flex-direction: row; }
  .block_newsletter .form-control { flex: 1; min-width: 0; border-radius: 4px 0 0 4px !important; }
  .block_newsletter .btn { flex-shrink: 0; border-radius: 0 4px 4px 0 !important; padding: 10px 14px; }

  .store-notice { flex-direction: column; gap: .4rem; padding: .9rem 1rem; }

  .checkout-step .content { padding: 1rem !important; }
  .checkout-step .step-title { font-size: 1rem; }
  #payment-confirmation .btn { width: 100%; padding: 14px; font-size: 1rem; }

  .page-home #content > * { margin-bottom: 1.5rem; }
}

/* ── 3. MENU HAMBURGER (<=767px) ──────────────────────────────── */
@media (max-width: 767px) {

  #mobile_top_menu_wrapper { background-color: #1a2b4a !important; border-top: 3px solid #24b9d7 !important; margin: 0 -15px !important; padding: 0 !important; }

  #_mobile_top_menu,
  #mobile_top_menu_wrapper .js-top-menu,
  #mobile_top_menu_wrapper .menu,
  #mobile_top_menu_wrapper .top-menu,
  #mobile_top_menu_wrapper ul,
  #mobile_top_menu_wrapper li { background-color: transparent !important; }

  #mobile_top_menu_wrapper .top-menu > li > a {
    background-color: transparent !important;
    color: rgba(255,255,255,.92) !important;
    display: block !important;
    padding: 14px 20px !important;
    font-size: .88rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: .06em !important;
    border-bottom: 1px solid rgba(255,255,255,.1) !important;
    white-space: normal !important;
  }
  #mobile_top_menu_wrapper .top-menu > li > a:hover { background-color: rgba(255,255,255,.07) !important; color: #24b9d7 !important; text-decoration: none !important; }

  #mobile_top_menu_wrapper .collapse-icons { float: right; cursor: pointer; }
  #mobile_top_menu_wrapper .collapse-icons .material-icons { color: #24b9d7 !important; font-size: 1.3rem; }

  #mobile_top_menu_wrapper .sub-menu,
  #mobile_top_menu_wrapper .collapse { background-color: rgba(0,0,0,.2) !important; box-shadow: none !important; border: none !important; border-radius: 0 !important; position: static !important; min-width: auto !important; padding: 0 0 0 10px !important; top: auto !important; left: auto !important; }
  #mobile_top_menu_wrapper .collapse.in,
  #mobile_top_menu_wrapper .collapse.show { display: block !important; }

  #mobile_top_menu_wrapper .sub-menu a,
  #mobile_top_menu_wrapper .collapse a { background-color: transparent !important; color: rgba(255,255,255,.75) !important; display: block !important; padding: 10px 20px !important; font-size: .83rem !important; font-weight: 500 !important; text-transform: none !important; letter-spacing: 0 !important; border-bottom: 1px solid rgba(255,255,255,.06) !important; white-space: normal !important; }
  #mobile_top_menu_wrapper .sub-menu a:hover,
  #mobile_top_menu_wrapper .collapse a:hover { color: #24b9d7 !important; background-color: rgba(255,255,255,.05) !important; text-decoration: none !important; }

  #mobile_top_menu_wrapper .js-top-menu-bottom { background-color: rgba(0,0,0,.15) !important; border-top: 1px solid rgba(255,255,255,.12) !important; padding: 10px 0 !important; }
  #mobile_top_menu_wrapper .js-top-menu-bottom a { color: rgba(255,255,255,.6) !important; font-size: .8rem !important; padding: 7px 20px !important; display: block !important; }
  #mobile_top_menu_wrapper .js-top-menu-bottom a:hover { color: #24b9d7 !important; }
}

/* ── 4. TRES PETITS ECRANS (<480px) ───────────────────────────── */
@media (max-width: 479px) {
  /* Produits : 1 colonne (assez de place pour les détails) */
  .products .js-product { flex: 0 0 100% !important; max-width: 100% !important; }
  /* Logo légèrement réduit sur très petits écrans */
  .header-nav .top-logo img { max-height: 52px; max-width: 160px; }
  .header-nav .mobile { min-height: 64px !important; }
  /* Sous-catégories : 2 colonnes même sur petit écran (grid = pas de calcul padding) */
  ul.subcategories-list { grid-template-columns: 1fr 1fr !important; gap: 6px !important; }
}
