/* Dynaparts 2026-10-19 — véhicule choisi :
   bandeau du header (modules/vehiclecompatibility16/…/hook/search_widget.tpl surchargé dans le thème),
   en-tête de la page « pièces compatibles » et des résultats AS4 dans ce contexte (dp-veh-head.tpl),
   filtres actifs des résultats AS4 (dp-as4-head.tpl), badge « Compatible » des miniatures.
   Sélecteurs préfixés par un id : le CSS du module est dans le regroupement CCC, chargé après ce fichier. */

/* ---------- Bandeau du véhicule choisi (header) ---------- */
#vehicle-search-widget .dp-vbar {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 14px;
  min-height: 56px;
  padding: 8px 0;
  background: transparent;
  font-size: 13px;
}
#vehicle-search-widget .dp-vbar__car {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: #ffffff;
  text-decoration: none;
}
#vehicle-search-widget .dp-vbar__car:hover .dp-vbar__name,
#vehicle-search-widget .dp-vbar__car:focus .dp-vbar__name { text-decoration: underline; text-underline-offset: 3px; }
#vehicle-search-widget .dp-vbar__icon {
  display: inline-flex;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #e9271a;
  color: #ffffff;
}
#vehicle-search-widget .dp-vbar__icon .fa { font-size: 20px; line-height: 1; }
#vehicle-search-widget .dp-vbar__info {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 1px;
  width: auto;
  min-width: 0;
}
#vehicle-search-widget .dp-vbar__kicker { color: rgba(255, 255, 255, .6); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; line-height: 1.2; text-transform: uppercase; }
#vehicle-search-widget .dp-vbar__name { overflow: hidden; color: #ffffff; font-size: 14px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
#vehicle-search-widget .dp-vbar__name .vehicle-bar__brand { color: #ffffff; font-size: inherit; font-weight: 800; }
#vehicle-search-widget .dp-vbar__name .vehicle-bar__model { color: #ffffff; font-size: inherit; }
#vehicle-search-widget .dp-vbar__engine { overflow: hidden; color: rgba(255, 255, 255, .72); font-size: 12.5px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
#vehicle-search-widget .dp-vbar__actions { display: flex; flex: 0 0 auto; flex-wrap: nowrap; align-items: center; gap: 8px; width: auto; }
#vehicle-search-widget .dp-vbar__btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  margin: 0;
  padding: 0 14px;
  border: 1.5px solid rgba(255, 255, 255, .22);
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1;
  text-decoration: none;
  text-transform: none;
  white-space: nowrap;
}
#vehicle-search-widget .dp-vbar__btn:hover,
#vehicle-search-widget .dp-vbar__btn:focus-visible { border-color: rgba(255, 255, 255, .6); background: rgba(255, 255, 255, .08); color: #ffffff; }
#vehicle-search-widget .dp-vbar__btn--main { border-color: #e9271a; background: #e9271a; }
#vehicle-search-widget .dp-vbar__btn--main:hover,
#vehicle-search-widget .dp-vbar__btn--main:focus-visible { border-color: #c41f13; background: #c41f13; }
#vehicle-search-widget .dp-vbar__btn--clear { width: 38px; padding: 0; border-color: transparent; color: rgba(255, 255, 255, .65); }
#vehicle-search-widget .dp-vbar__btn--clear:hover { border-color: rgba(255, 255, 255, .22); color: #ffffff; }
#vehicle-search-widget .dp-vbar #vehicle-save-btn.saved { border-color: rgba(255, 255, 255, .15); color: rgba(255, 255, 255, .5); }
#vehicle-search-widget .dp-vbar .vehicle-garage-dropdown__arrow { margin-left: 2px; }

/* formulaire ouvert par « Changer » : bouton « Annuler » */
#vehicle-search-widget .vehicle-search-cancel {
  height: 42px;
  padding: 0 14px;
  border: 1.5px solid rgba(255, 255, 255, .25);
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
#vehicle-search-widget .vehicle-search-cancel:hover { border-color: rgba(255, 255, 255, .6); }

@media (max-width: 767px) {
  #vehicle-search-widget .dp-vbar { gap: 10px; min-height: 0; padding: 10px 12px; }
  #vehicle-search-widget .dp-vbar__car { gap: 10px; }
  #vehicle-search-widget .dp-vbar__icon { flex-basis: 36px; width: 36px; height: 36px; border-radius: 9px; }
  #vehicle-search-widget .dp-vbar__icon .fa { font-size: 18px; }
  #vehicle-search-widget .dp-vbar__kicker { display: none; }
  #vehicle-search-widget .dp-vbar__name { font-size: 13.5px; }
  #vehicle-search-widget .dp-vbar__engine { font-size: 12px; }
  /* le véhicule mène aux pièces compatibles : chevron à la place du bouton */
  #vehicle-search-widget .dp-vbar:not(.dp-vbar--results) .dp-vbar__info { padding-right: 14px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.4' stroke-linecap='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") no-repeat right center; }
  #vehicle-search-widget .dp-vbar__actions { gap: 6px; }
  #vehicle-search-widget .dp-vbar__btn { height: 36px; padding: 0 10px; font-size: 12px; }
  #vehicle-search-widget .dp-vbar__btn--main,
  #vehicle-search-widget .dp-vbar__btn--share,
  #vehicle-search-widget .dp-vbar .dp-vbar__lbl { display: none; }
  #vehicle-search-widget .dp-vbar__btn--clear { width: 32px; padding: 0; }
  #vehicle-search-widget .vehicle-search-cancel { width: 100%; min-height: 46px; }
}
@media (max-width: 420px) {
  /* client connecté (bouton « Sauvegarder ») : « Changer » en icône pour laisser la place au véhicule */
  #vehicle-search-widget .dp-vbar__actions:has(#vehicle-save-btn, #vehicle-garage-toggle) #vehicle-change-btn { width: 36px; padding: 0; }
  #vehicle-search-widget .dp-vbar__actions:has(#vehicle-save-btn, #vehicle-garage-toggle) #vehicle-change-btn span { display: none; }
}
@media (min-width: 768px) and (max-width: 1199px) {
  #vehicle-search-widget .dp-vbar__btn--share .dp-vbar__lbl,
  #vehicle-search-widget .dp-vbar .dp-vbar__lbl { display: none; }
}

/* ---------- Bandeau sombre du header (ordinateur) : la recherche prend toute la place laissée par le véhicule ---------- */
@media (min-width: 992px) {
  #header #bordered #vehicle-search-widget { flex: 0 1 auto; min-width: 0; }
  #header #bordered > .ApColumn:has(#search_block_top) { flex: 1 1 340px; width: auto; min-width: 300px; max-width: none; padding-right: 0; }
  #header #bordered #search_block_top { float: none; width: 100%; padding-right: 0; }
  #header #bordered #search_block_top #searchbox { width: 100%; max-width: none; }
}

/* ---------- En-tête « pièces compatibles » (page du module + résultats AS4 filtrés) ---------- */
#center_column .dp-veh-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
  margin: 0 0 18px;
  padding: 22px 24px;
  border: 1px solid #e6e8eb;
  border-radius: 14px;
  background: #f5f6f7;
  color: #282b2f;
}
#center_column .dp-veh-head__main { display: flex; flex: 1 1 380px; align-items: center; gap: 16px; min-width: 0; }
#center_column .dp-veh-head__icon {
  display: inline-flex;
  flex: 0 0 56px;
  align-items: center;
  justify-content: center;
  height: 56px;
  border-radius: 14px;
  background: #e9271a;
  color: #ffffff;
}
#center_column .dp-veh-head__icon .fa { font-size: 27px; line-height: 1; }
#center_column .dp-veh-head__text { min-width: 0; }
#center_column .dp-veh-head__kicker { margin: 0 0 4px; color: #e9271a; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
#center_column .dp-veh-head__title {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #282b2f;
  font-family: 'DP Saira', Verdana, Geneva, sans-serif;
  font-size: 30px;
  font-style: italic;
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
}
#center_column .dp-veh-head__title::after,
#center_column .dp-veh-head__title::before { display: none; }
#center_column .dp-veh-head__spec { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
#center_column .dp-veh-head__spec span {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 11px;
  border: 1px solid #dfe2e6;
  border-radius: 999px;
  background: #ffffff;
  color: #282b2f;
  font-size: 12.5px;
  font-weight: 600;
}
#center_column .dp-veh-head__side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
#center_column .dp-veh-head__count { margin: 0; color: #5d636a; font-size: 13px; font-weight: 600; }
#center_column .dp-veh-head__count strong { color: #282b2f; font-family: 'DP Saira', Verdana, Geneva, sans-serif; font-size: 22px; font-style: italic; font-weight: 800; }
#center_column .dp-veh-head__actions,
#center_column .dp-veh-empty__actions { display: flex; flex-wrap: wrap; gap: 8px; }
#center_column .dp-veh-head__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  margin: 0;
  padding: 0 14px;
  border: 1.5px solid #dfe2e6;
  border-radius: 10px;
  background: #ffffff;
  color: #282b2f;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
#center_column .dp-veh-head__btn:hover,
#center_column .dp-veh-head__btn:focus-visible { border-color: #282b2f; color: #e9271a; }
#center_column .dp-veh-head__btn--main { border-color: #e9271a; background: #e9271a; color: #ffffff; }
#center_column .dp-veh-head__btn--main:hover { border-color: #c41f13; background: #c41f13; color: #ffffff; }

/* raccourcis par famille (1er critère du filtre AS4) */
#center_column .dp-veh-fam { margin: 0 0 16px; }
#center_column .dp-veh-fam[hidden] { display: none; }
#center_column .dp-veh-fam__list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
#center_column .dp-veh-fam__list li { margin: 0; padding: 0; }
#center_column .dp-veh-fam__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  margin: 0;
  padding: 0 14px;
  border: 1.5px solid #dfe2e6;
  border-radius: 999px;
  background: #ffffff;
  color: #282b2f;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
#center_column .dp-veh-fam__chip small { color: #8a9097; font-size: 11.5px; font-weight: 600; }
#center_column .dp-veh-fam__chip:hover { border-color: #282b2f; }
#center_column .dp-veh-fam__chip.is-active { border-color: #282b2f; background: #282b2f; color: #ffffff; }
#center_column .dp-veh-fam__chip.is-active small { color: rgba(255, 255, 255, .7); }

/* aucun produit */
#center_column .dp-veh-empty { margin: 0 0 30px; padding: 26px 24px; border: 1.5px dashed #dfe2e6; border-radius: 14px; text-align: center; }
#center_column .dp-veh-empty__title { margin: 0 0 6px; color: #282b2f; font-size: 17px; font-weight: 800; }
#center_column .dp-veh-empty__text { margin: 0 0 16px; color: #5d636a; font-size: 14px; }
#center_column .dp-veh-empty__actions { justify-content: center; }

/* page véhicule : chaque pièce est compatible, le badge serait répété sur toutes les miniatures */
#center_column .dp-veh ~ #vehicle-search-results .vehicle-listing-badge:not(.vehicle-listing-badge--universal),
#center_column .dp-veh #vehicle-search-results .vehicle-listing-badge:not(.vehicle-listing-badge--universal),
#center_column #PM_ASearchResults:has(.dp-veh-head) .vehicle-listing-badge:not(.vehicle-listing-badge--universal) { display: none; }

/* lien « Partager cette recherche » ajouté par le module sous le filtre AS4 */
#left_column .PM_ASBlockOutput .vehicle-as4-share {
  display: inline-flex;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  background: none;
  color: #e9271a !important;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-decoration: underline !important;
  text-transform: none;
  text-underline-offset: 3px;
}
#left_column .PM_ASBlockOutput .vehicle-as4-share:hover { background: none; color: #c41f13 !important; }
#left_column .PM_ASBlockOutput .PM_ASResetSearch { margin-right: 14px; }

/* ---------- Résultats AS4 : filtres actifs ---------- */
#center_column .dp-as4-sel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
#center_column .dp-as4-sel:not(:has(.PM_ASSelectionsRemoveLink)) { display: none; }
/* formulaire d'AS4 conservé (ses liens de retrait le soumettent) mais aplati : pastilles côte à côte */
#center_column .dp-as4-sel .PM_ASSelectionsResults,
#center_column .dp-as4-sel .PM_ASSelectionsResults ul,
#center_column .dp-as4-sel .PM_ASSelectionsResults ul li.PM_ASSelectionsCriterionsGroupName { display: contents; }
#center_column .dp-as4-sel .PM_ASSelectionsResults > p { margin: 0 4px 0 0; color: #5d636a; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
#center_column .dp-as4-sel .PM_ASSelectionsResults > p strong { font-weight: 700; }
#center_column .dp-as4-sel .PM_ASSelectionsResults ul li.PM_ASSelectionsCriterionsGroupName > strong { display: none; }
#center_column .dp-as4-sel .PM_ASSelectionsResults ul li.PM_ASSelectionsSelectedCriterion { display: block; margin: 0; padding: 0; background: none; }
#center_column .dp-as4-sel a.PM_ASSelectionsRemoveLink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px 0 14px;
  border-radius: 999px;
  background: #282b2f;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
#center_column .dp-as4-sel a.PM_ASSelectionsRemoveLink::before { display: none; }
#center_column .dp-as4-sel a.PM_ASSelectionsRemoveLink::after { content: "\00d7"; font-size: 17px; font-weight: 400; line-height: 1; opacity: .7; }
#center_column .dp-as4-sel a.PM_ASSelectionsRemoveLink:hover,
#center_column .dp-as4-sel a.PM_ASSelectionsRemoveLink:focus-visible { background: #e9271a; color: #ffffff; text-decoration: none !important; }
#center_column .dp-as4-sel__reset { height: 34px; padding: 0 6px; border: 0; background: none; color: #e9271a; font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
#center_column .dp-as4-sel__reset[hidden] { display: none; }

/* ---------- Badge « Compatible » des miniatures (injecté par le JS du module) ----------
   19/10/2026 après remarque (« je ne vois plus les badges ») : vert plein en haut à droite + liseré vert de la carte */
.dp-card .product-image-container > .vehicle-listing-badge {
  top: 10px;
  right: 10px;
  bottom: auto;
  left: auto;
  z-index: 3;
  padding: 6px 9px;
  border: 0;
  border-radius: 6px;
  background: #1f8a4c;
  box-shadow: 0 2px 8px rgba(31, 138, 76, .35);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  line-height: 1;
  text-transform: uppercase;
}
.dp-card .product-image-container > .vehicle-listing-badge--universal { background: #282b2f; box-shadow: 0 2px 8px rgba(40, 43, 47, .3); }
.product_list .ajax_block_product.vehicle-compatible .product-container.product-block.dp-card { border-color: #1f8a4c !important; box-shadow: 0 0 0 1px #1f8a4c; }
/* page véhicule et ses résultats filtrés : tout est compatible, pas de liseré */
#center_column .dp-veh .product_list .ajax_block_product.vehicle-compatible .product-container.product-block.dp-card,
#center_column #PM_ASearchResults:has(.dp-veh-head) .product_list .ajax_block_product.vehicle-compatible .product-container.product-block.dp-card { border-color: #e6e8eb !important; box-shadow: none; }

/* ---------- Mobile ---------- */
@media (max-width: 767px) {
  #center_column .dp-veh-head { gap: 14px; margin: 0 0 14px; padding: 16px; }
  #center_column .dp-veh-head__main { flex-basis: 100%; gap: 12px; }
  #center_column .dp-veh-head__icon { flex-basis: 46px; height: 46px; border-radius: 12px; }
  #center_column .dp-veh-head__icon .fa { font-size: 22px; }
  #center_column .dp-veh-head__kicker { font-size: 11px; }
  #center_column .dp-veh-head__title { font-size: 23px; }
  #center_column .dp-veh-head__spec { margin-top: 8px; }
  #center_column .dp-veh-head__spec span { height: 26px; font-size: 12px; }
  #center_column .dp-veh-head__side { align-items: stretch; width: 100%; }
  #center_column .dp-veh-head__actions { display: grid; grid-template-columns: auto minmax(0, 1fr); }
  #center_column .dp-veh-head__btn { height: 42px; padding: 0 12px; font-size: 12.5px; }
  #center_column .dp-veh-fam { margin: 0 -15px 12px 0; }
  #center_column .dp-veh-fam__list { flex-wrap: nowrap; padding-right: 15px; overflow-x: auto; scrollbar-width: none; }
  #center_column .dp-veh-fam__list::-webkit-scrollbar { display: none; }
  #center_column .dp-veh-fam__list li { flex-shrink: 0; }
  #center_column .dp-veh-fam__chip { height: 36px; padding: 0 12px; }
  #center_column .dp-as4-sel { margin-bottom: 12px; }
  #center_column .dp-as4-sel .PM_ASSelectionsResults > p { display: none; }
  /* sans majuscules sur 2 colonnes : laisse la place au badge de remise à gauche */
  .dp-card .product-image-container > .vehicle-listing-badge { top: 8px; right: 8px; padding: 5px 7px; font-size: 11px; letter-spacing: 0; text-transform: none; }
}
