/* ==========================================================================
   ATEQ — comparateur de produits
   Palette : uniquement la charte. #000 · #3c4f5d · #cecece · #fff · #ce003d
   Angles vifs partout. Préfixes .acmp / .acmp- : rien ne fuit ailleurs.
   ========================================================================== */

.acmp, .acmp-tray, .acmp-toggle, .acmp-slot {
  --ac-black: #000000;
  --ac-slate: #3c4f5d;
  --ac-grey:  #cecece;
  --ac-white: #ffffff;
  --ac-red:   #ce003d;
  box-sizing: border-box;
  font-family: "Lato Regular", -apple-system, "Segoe UI", sans-serif;
}
.acmp *, .acmp-tray *, .acmp-toggle * { box-sizing: border-box; }
.acmp-ico { width: 16px; height: 16px; flex: 0 0 auto; fill: currentColor; }
.acmp__sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------- Boutons ---------------- */

.acmp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 0;
  font-family: "Lato Bold", -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.acmp-btn:hover, .acmp-btn:focus { text-decoration: none; }
.acmp-btn--primary { background: var(--ac-red); border-color: var(--ac-red); color: var(--ac-white); }
.acmp-btn--primary:hover, .acmp-btn--primary:focus { background: var(--ac-black); border-color: var(--ac-black); color: var(--ac-white); }
.acmp-btn--primary[aria-disabled="true"] { background: var(--ac-slate); border-color: var(--ac-slate); cursor: not-allowed; }
.acmp-btn--ghost { background: transparent; border-color: var(--ac-slate); color: var(--ac-grey); }
.acmp-btn--ghost:hover { border-color: var(--ac-white); color: var(--ac-white); }

.acmp-btn:focus-visible,
.acmp-toggle:focus-visible,
.acmp__select:focus-visible,
.acmp-tray__remove:focus-visible { outline: 2px solid var(--ac-red); outline-offset: 2px; }

/* ---------------- Bouton « Comparer » ---------------- */

.acmp-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 16px 0 12px;
  border: 1px solid var(--ac-grey);
  border-radius: 0;
  background: var(--ac-white);
  color: var(--ac-slate);
  font-family: "Lato Bold", -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.acmp-toggle:hover { border-color: var(--ac-black); color: var(--ac-black); }
.acmp-toggle__box {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--ac-slate);
  background: var(--ac-white);
  color: transparent;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.acmp-toggle__box .acmp-ico { width: 14px; height: 14px; }
.acmp-toggle[aria-pressed="true"] { border-color: var(--ac-black); color: var(--ac-black); }
.acmp-toggle[aria-pressed="true"] .acmp-toggle__box { background: var(--ac-red); border-color: var(--ac-red); color: var(--ac-white); }
.acmp-toggle[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }

/* Catalogue : le lien de la carte est enveloppé, le bouton posé dessus.
   Dimensions reprises du thème (.productCards : 304 px + 32 px de marge). */
.acmp-slot { position: relative; flex: 0 0 auto; width: calc(304px + 32px); padding-right: 32px; }
.acmp-slot > a.productCards { width: 100%; padding-right: 0; }
.acmp-toggle--card { position: absolute; z-index: 2; top: 12px; left: 12px; height: 34px; padding: 0 12px 0 9px; font-size: 11px; }

/* Fiche produit : aligné sur les boutons du hero. */
.acmp-toggle--page { margin-top: 0; }

/* ---------------- Bandeau de sélection ---------------- */

.acmp-tray {
  position: fixed;
  z-index: 9999;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--ac-black);
  color: var(--ac-white);
  border-top: 3px solid var(--ac-red);
}
.acmp-tray[hidden] { display: none !important; }
body.acmp-has-tray { padding-bottom: 96px; }

.acmp-tray__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1304px;
  margin: 0 auto;
  padding: 14px 32px;
}
.acmp-tray__head { display: flex; flex-direction: column; min-width: 140px; }
.acmp-tray__head strong { font-family: "Lato Bold", -apple-system, "Segoe UI", sans-serif; font-size: 15px; }
.acmp-tray__head span { font-size: 12px; color: var(--ac-grey); }

.acmp-tray__slots { display: flex; flex: 1; gap: 12px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.acmp-tray__slot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 0;
  min-width: 0;
  max-width: 260px;
  height: 58px;
  padding: 0 34px 0 6px;
  border: 1px solid var(--ac-slate);
}
.acmp-tray__slot--empty { justify-content: center; padding: 0; border-style: dashed; color: var(--ac-slate); }
.acmp-tray__thumb { display: grid; place-items: center; flex: 0 0 46px; width: 46px; height: 46px; background: var(--ac-white); }
.acmp-tray__thumb img { width: 100%; height: 100%; padding: 3px; object-fit: contain; }
.acmp-tray__name { overflow: hidden; font-family: "Lato Bold", -apple-system, "Segoe UI", sans-serif; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.acmp-tray__remove {
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ac-grey);
  cursor: pointer;
  transform: translateY(-50%);
}
.acmp-tray__remove:hover { color: var(--ac-white); background: var(--ac-slate); }
.acmp-tray__actions { display: flex; gap: 8px; }

/* ---------------- Page de comparaison ---------------- */

.acmp-page { padding-top: 140px; }
.acmp {
  max-width: 1304px;
  margin: 0 auto;
  padding: 0 32px 120px;
  color: var(--ac-black);
  font-size: 15px;
  line-height: 1.5;
}
.acmp h1, .acmp h2, .acmp h3, .acmp p, .acmp ul { margin: 0; padding: 0; }
.acmp__title {
  margin-bottom: 40px;
  font-family: "Lato Bold", -apple-system, "Segoe UI", sans-serif;
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: -.015em;
  text-transform: none;
  color: var(--ac-black);
}
.acmp__app { --acmp-cols: 3; }

.acmp__row {
  display: grid;
  grid-template-columns: repeat(var(--acmp-cols), minmax(0, 1fr));
  gap: 0 32px;
}
.acmp__cell { min-width: 0; padding: 16px 0; color: var(--ac-black); }

/* En-têtes produit */
.acmp__head { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding-top: 0; }
.acmp__select {
  width: 100%;
  height: 46px;
  padding: 0 40px 0 14px;
  border: 1px solid var(--ac-grey);
  border-radius: 0;
  background: var(--ac-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z' fill='%23000000'/%3E%3C/svg%3E") no-repeat right 12px center / 20px;
  color: var(--ac-black);
  font-size: 15px;
  text-transform: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.acmp__select:hover { border-color: var(--ac-slate); }
.acmp__plate {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--ac-grey);
  background: var(--ac-white);
  color: var(--ac-slate);
  font-family: "Lato Bold", -apple-system, "Segoe UI", sans-serif;
  font-size: 40px;
}
.acmp__plate img { width: 100%; height: 100%; padding: 20px; object-fit: contain; }
.acmp__plate--empty { border-style: dashed; color: var(--ac-grey); }
.acmp__plate--empty .acmp-ico { width: 40px; height: 40px; }
.acmp__name {
  font-family: "Lato Bold", -apple-system, "Segoe UI", sans-serif;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -.01em;
  text-transform: none;
  color: var(--ac-black);
}
.acmp__desc { color: var(--ac-slate); font-size: 15px; }

/* Sections */
.acmp__section,
.acmp__section h3 {
  font-family: "Lato Bold", -apple-system, "Segoe UI", sans-serif;
  font-size: 24px;
  line-height: 1.2;
  text-transform: none;
  color: var(--ac-black);
}
.acmp__section { margin-top: 56px; padding-bottom: 14px; border-bottom: 1px solid var(--ac-black); }
.acmp__section--caps { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }

.acmp__list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.acmp__list li { position: relative; padding-left: 16px; font-size: 14px; line-height: 1.45; }
.acmp__list li::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; background: var(--ac-red); }
.acmp__muted { color: var(--ac-slate); font-size: 14px; }

/* Fonctions : libellé sur toute la largeur, valeurs dessous (comme Apple). */
.acmp__crit {
  padding-top: 20px;
  font-family: "Lato Bold", -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  color: var(--ac-black);
}
.acmp__grid--caps .acmp__row { border-bottom: 1px solid var(--ac-grey); }
.acmp__grid--caps .acmp__cell { padding: 8px 0 18px; }
.acmp__cap { display: flex; align-items: center; min-height: 28px; }
.acmp__cap--yes { color: var(--ac-red); }
.acmp__cap--yes .acmp-ico { width: 26px; height: 26px; }
.acmp__cap--no { color: var(--ac-slate); font-size: 20px; }
.acmp__cap--unknown { color: var(--ac-slate); font-size: 13px; }
.acmp__nocaps { padding: 24px 0; }

.acmp__empty { margin-top: 32px; padding: 32px; border: 1px dashed var(--ac-grey); color: var(--ac-slate); text-align: center; }

/* Interrupteur « différences uniquement » */
.acmp__switch { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-family: "Lato Regular", -apple-system, "Segoe UI", sans-serif; font-size: 14px; font-weight: 400; color: var(--ac-slate); cursor: pointer; }
.acmp__switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.acmp__switch-ui { position: relative; width: 42px; height: 22px; border: 1px solid var(--ac-slate); background: var(--ac-white); transition: background-color .15s ease, border-color .15s ease; }
.acmp__switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; background: var(--ac-slate); transition: transform .15s ease, background-color .15s ease; }
.acmp__switch-input:checked + .acmp__switch-ui { background: var(--ac-black); border-color: var(--ac-black); }
.acmp__switch-input:checked + .acmp__switch-ui::after { transform: translateX(20px); background: var(--ac-white); }
.acmp__switch-input:focus-visible + .acmp__switch-ui { outline: 2px solid var(--ac-red); outline-offset: 2px; }

/* ---------------- Responsive ---------------- */

@media (max-width: 1024px) {
  .acmp-page { padding-top: 104px; }
  .acmp { padding: 0 20px 96px; }
  .acmp__title { font-size: 34px; }
}
/* Sous 760 px : défilement horizontal plutôt que des colonnes illisibles. */
@media (max-width: 760px) {
  .acmp__app { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .acmp__row, .acmp__section, .acmp__crit { min-width: calc(var(--acmp-cols) * 220px); }
  .acmp__name { font-size: 20px; }
  .acmp-tray__inner { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .acmp-tray__head { min-width: 0; flex: 1; }
  .acmp-tray__slots { order: 3; flex-basis: 100%; }
  .acmp-tray__slot { height: 50px; padding-right: 30px; }
  .acmp-tray__name { display: none; }
  body.acmp-has-tray { padding-bottom: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  .acmp *, .acmp-tray *, .acmp-toggle * { transition: none !important; }
}
