/* ============================================================
   Tractoshop — MEGA-MENU CSS  (adapté de tractoland)
   Couleurs : Bleu #1A64B7 + Vert #5EB229
   ============================================================ */

:root {
  --ts-mm-primary: #1A64B7;
  --ts-mm-green:   #5EB229;
  --ts-mm-navy:    #1A3A5C;
  --ts-mm-bg:      #ffffff;
  --ts-mm-border:  #e5e7eb;
  --ts-mm-col-gap: 2rem;
  --ts-mm-z:       9999;
}

/* ── Masquer les dropdowns natifs Hummingbird en desktop ── */
@media (min-width: 992px) {
  #top-menu .menu-container,
  #top-menu .js-sub-menu,
  .main-menu__tree .menu-container,
  .main-menu__tree .js-sub-menu {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
  }
}

/* ── Panneau méga-menu ── */
.ts-mega-panel {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--ts-mm-z);
  background: var(--ts-mm-bg);
  border-top: 3px solid var(--ts-mm-green);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
  animation: tsFadeDown 0.15s ease;
}
.ts-mega-panel.is-open { display: block; }

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

.ts-mega-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 32px 20px;
  display: flex;
  gap: 0;
}

/* ── Colonnes ── */
.ts-mega-cols {
  flex: 1;
  display: grid;
  gap: 0 var(--ts-mm-col-gap);
}

.ts-mega-col-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--ts-mm-green);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 0 0 10px;
  padding-bottom: 7px;
  border-bottom: 2px solid rgba(94, 178, 41, 0.2);
}

.ts-mega-col ul { list-style: none; margin: 0; padding: 0; }

.ts-mega-col ul li a {
  display: block;
  padding: 4px 0;
  font-size: 13px;
  color: #374151;
  text-decoration: none;
  transition: color 0.12s;
  line-height: 1.4;
}
.ts-mega-col ul li a:hover { color: var(--ts-mm-primary); }

.ts-mega-col ul li.ts-see-all a { color: var(--ts-mm-green); font-weight: 600; margin-top: 4px; }
.ts-mega-col ul li.ts-see-all a:hover { color: #448a1e; }

/* ── Sidebar highlights ── */
.ts-mega-sidebar {
  width: 200px;
  margin-left: 28px;
  padding-left: 24px;
  border-left: 1px solid var(--ts-mm-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ts-mega-sidebar-title {
  font-size: 10px;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.ts-highlight-card {
  display: block;
  padding: 12px 14px;
  background: rgba(26, 100, 183, 0.05);
  border: 1px solid rgba(26, 100, 183, 0.12);
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s;
}
.ts-highlight-card:hover { background: rgba(26, 100, 183, 0.1); }
.ts-highlight-card .hc-icon  { font-size: 20px; margin-bottom: 4px; display: block; }
.ts-highlight-card .hc-label { font-size: 13px; font-weight: 600; color: var(--ts-mm-primary); display: block; }
.ts-highlight-card .hc-desc  { font-size: 11.5px; color: #6b7280; margin-top: 2px; display: block; }

.ts-facet-hint {
  display: block;
  margin-top: auto;
  padding: 10px 12px;
  background: rgba(94, 178, 41, 0.07);
  border: 1px solid rgba(94, 178, 41, 0.2);
  border-radius: 8px;
  font-size: 11.5px;
  color: #6b7280;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.ts-facet-hint strong { display: block; color: var(--ts-mm-green); font-size: 12px; margin-bottom: 2px; }

/* ── Footer recherches populaires ── */
.ts-mega-footer {
  background: rgba(26, 100, 183, 0.04);
  border-top: 1px solid var(--ts-mm-border);
  padding: 8px 32px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.ts-mega-footer-label { font-size: 12px; color: #9ca3af; white-space: nowrap; }

.ts-tag {
  display: inline-block;
  font-size: 12px;
  color: var(--ts-mm-primary);
  background: rgba(26, 100, 183, 0.08);
  padding: 3px 12px;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.15s;
}
.ts-tag:hover { background: rgba(26, 100, 183, 0.16); color: var(--ts-mm-primary); }

/* ── Overlay ── */
.ts-overlay { display: none; position: fixed; inset: 0; z-index: calc(var(--ts-mm-z) - 1); background: transparent; }
.ts-overlay.is-active { display: block; }

/* ── Indicateur actif sur le nav-link ── */
@media (min-width: 992px) {
  #top-menu > li:hover > a,
  #top-menu > li.ts-active > a,
  .main-menu__tree > li:hover > a,
  .main-menu__tree > li.ts-active > a,
  .js-menu-desktop > li:hover > a,
  .js-menu-desktop > li.ts-active > a {
    color: var(--ts-mm-green) !important;
  }
  #top-menu > li.ts-active > a,
  .main-menu__tree > li.ts-active > a,
  .js-menu-desktop > li.ts-active > a {
    border-bottom: 3px solid var(--ts-mm-green);
  }
}

/* ── Mobile : méga-menu désactivé, Hummingbird reprend la main ── */
@media (max-width: 991px) {
  .ts-mega-panel, .ts-overlay { display: none !important; }
  #top-menu .menu-container,
  #top-menu .js-sub-menu,
  .main-menu__tree .menu-container,
  .main-menu__tree .js-sub-menu {
    display: block !important;
    pointer-events: auto !important;
    visibility: visible !important;
  }
}
