/* =====================================================
   EDW THEME v3 — ecoles-du-web.fr
   Patch ciblé sur 5 problèmes (ne remplace pas le CSS inline)
   ===================================================== */

/* === FIX 1 : GRILLE CARDS HOMEPAGE (vc_col-sm-1/5 → 4 colonnes) === */
/* Le CSS inline met les vc_col-sm-1/5 en float:left + width:20% (5 col)
   On convertit la row VC en CSS Grid pour un vrai layout responsive */

.vc_row .wpb_column.vc_column_container.vc_col-sm-1\/5 {
  float: none !important;
  width: auto !important;
}
.vc_row:has(.vc_col-sm-1\/5) .vc_column-inner {
  padding: 8px !important;
}
/* Utiliser le parent vc_row comme grid container */
.vc_row.col_wrap_five,
.woocommerce ul.products.columns-5,
.woocommerce ul.products.columns-4,
.woocommerce ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 16px !important;
  margin: 0 !important;
  padding: 0 !important;
  float: none !important;
}
.woocommerce ul.products > li {
  float: none !important;
  width: auto !important;
  margin: 0 !important;
}

/* Cards école dans la homepage (contenant VC) */
.wpb_column.vc_column_container.vc_col-sm-1\/5 {
  display: inline-block;
  vertical-align: top;
  width: 23% !important;
  margin: 0 1% 16px !important;
  float: none !important;
  box-sizing: border-box;
}

/* === FIX 2 : STYLE CARD (bordure + ombre) === */
.product.col_item.offer_grid.woo_compact_grid,
.product.col_item.woo_compact_grid,
.woocommerce .products .product {
  background: #fff !important;
  border: 1px solid #e4e8ec !important;
  border-radius: 6px !important;
  box-shadow: 0 2px 8px rgba(0,0,0,.07) !important;
  overflow: hidden !important;
  transition: box-shadow .2s, transform .15s !important;
  position: relative;
}
.product.col_item.offer_grid.woo_compact_grid:hover,
.woocommerce .products .product:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,.12) !important;
  transform: translateY(-2px) !important;
}

/* Image dans card */
.product.col_item.offer_grid figure,
.product.col_item.offer_grid .img-centered-flex {
  background: #f8f9fa !important;
  min-height: 100px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 10px !important;
}
.product.col_item.offer_grid figure img,
.product.col_item.offer_grid .img-centered-flex img {
  max-height: 80px !important;
  width: auto !important;
  object-fit: contain !important;
}

/* Titre dans card */
.product.col_item.offer_grid h3 {
  font-size: 13px !important;
  font-weight: 600 !important;
  margin: 0 0 4px !important;
  padding: 0 10px 8px !important;
  line-height: 1.3 !important;
  color: #263844 !important;
}
.product.col_item.offer_grid h3 a { color: #263844 !important; }
.product.col_item.offer_grid h3 a:hover { color: #1bbc9b !important; }

/* Boutons actions (comparer, wishlist) → masquer */
.re_actions_for_grid,
.compare_for_grid,
.cell_wishlist,
.wishremovedwrap,
.wishaddedwrap,
.button_action .wpsm-button.wpsm-button-new-compare,
.button_action .heart_thumb_wrap { display: none !important; }

/* === FIX 3 : SIDEBAR STYLÉE === */
.sidebar {
  background: #fff !important;
}
.sidebar .widget {
  border: 1px solid #e4e8ec !important;
  border-radius: 6px !important;
  padding: 16px !important;
  margin-bottom: 20px !important;
  background: #fff !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.05) !important;
}
.sidebar .widget .title,
.sidebar h3.widget-title,
.sidebar .widget_title {
  font-size: 13px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .6px !important;
  color: #263844 !important;
  margin: 0 0 12px !important;
  padding-bottom: 8px !important;
}
.sidebar .widget ul li {
  padding: 5px 0 !important;
  font-size: 13px !important;
  border-bottom: 1px solid #f5f5f5 !important;
  list-style: none !important;
}
.sidebar .widget ul li:last-child { border-bottom: none !important; }
.sidebar .widget ul li a { color: #444 !important; }
.sidebar .widget ul li a:hover { color: #1bbc9b !important; }

/* === FIX 4 : MENU ITEMS SANS HREF (Actu Startups, etc.) === */
/* Ces items ont le HTML : <li class="menu-item">Actu Startups</li> (pas de <a>)
   Le CSS inline les affiche en inline-block mais sans lien → on les cache */
nav.top_menu > ul > li.menu-item-type-custom:not(:has(> a)) {
  display: none !important;
}
/* Rendu grisé pour les navigateurs sans :has() — acceptable */

/* === FIX 5 : MENU MOBILE EN BAS DE PAGE (dl-menuwrapper dupliqué) === */
/* Le dl-menuwrapper hors du #main_header est le résidu en bas de page */
body > .dl-menuwrapper,
.footer-bottom .dl-menuwrapper,
footer .dl-menuwrapper,
#theme_footer .dl-menuwrapper,
.footer_most_bottom .dl-menuwrapper,
/* Masquer aussi le nav dupliqué en dehors du header */
body > nav.top_menu { display: none !important; }

/* Le dl-menuwrapper DANS le header reste visible sur mobile */
#main_header .dl-menuwrapper { display: block; }
#main_header .responsive_nav_wrap { display: block !important; }

/* === MASQUER ÉLÉMENTS JUNK === */
.adsbygoogle,
ins.adsbygoogle,
.ai-adb,
.ai-adb-container,
.ai-check-adblock,
.login-popup,
#login-popup,
[id*="login-popup"],
.mediad,
.megatop_mediad,
.mediad_footer,
#re-compare-bar,
#re-compare-icon-fixed,
.re-compare-notice { display: none !important; }

/* === ANNUAIRE GRILLE (pages /annuaire-formations-web/) === */
.col_wrap_three {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 20px !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.col_wrap_three .col_item,
.col_wrap_three > li {
  background: #fff !important;
  border: 1px solid #e4e8ec !important;
  border-radius: 6px !important;
  padding: 16px !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.05) !important;
  float: none !important;
  width: auto !important;
  margin: 0 !important;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .woocommerce ul.products,
  .col_wrap_five {
    grid-template-columns: repeat(3, 1fr) !important;
  }
  .wpb_column.vc_column_container.vc_col-sm-1\/5 {
    width: 31% !important;
  }
}

@media (max-width: 768px) {
  .woocommerce ul.products,
  .col_wrap_five,
  .col_wrap_three {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .wpb_column.vc_column_container.vc_col-sm-1\/5 {
    width: 48% !important;
    margin: 0 1% 12px !important;
  }
}

@media (max-width: 480px) {
  .woocommerce ul.products,
  .col_wrap_five,
  .col_wrap_three {
    grid-template-columns: 1fr !important;
  }
  .wpb_column.vc_column_container.vc_col-sm-1\/5 {
    width: 100% !important;
    margin: 0 0 12px !important;
  }
}
