/* RMP Compatibility — finder.css */

/* ── Variables ─────────────────────────────────────────────── */
/* Chaque valeur est overridable depuis le thème actif en redéfinissant
   --rmpc-* sur :root (voir themes/repairmacparts/style.css) — aligné sur
   le design system unifié (--rmp-*) plutôt que codé en dur ici. */
:root {
  --rmpc-accent:       var(--rmp-brand, #0071e3);
  --rmpc-accent-hover: var(--rmp-brand-hover, #0077ed);
  --rmpc-accent-active: var(--rmp-brand-active, #006edb);
  --rmpc-bg:           var(--rmp-bg-gray, #f9fafb);
  --rmpc-border:       var(--rmp-border, rgb(229, 231, 235));
  --rmpc-text:         var(--rmp-text, #1d1d1f);
  --rmpc-muted:        var(--rmp-text-soft, #6e6e73);
  --rmpc-radius:       var(--rmp-radius, 10px);
}

/* ── Finder widget ─────────────────────────────────────────── */

.rmpc-finder {
  font-family: var(--rmp-font, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
  color: var(--rmpc-text);
}

.rmpc-finder-form {}

.rmpc-finder-field {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.rmpc-finder-input {
  flex: 1 1 180px;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--rmpc-border);
  border-radius: var(--rmpc-radius);
  font-size: var(--rmp-fs-body, 1rem);
  background: #fff;
  color: var(--rmpc-text);
  outline: none;
  transition: border-color 0.15s;
}

.rmpc-finder-input:focus {
  border-color: var(--rmpc-accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.18);
}

.rmpc-finder-btn {
  height: 44px;
  padding: 0 20px;
  border: none;
  border-radius: var(--rmpc-radius);
  background: var(--rmpc-accent);
  color: #fff;
  font-size: var(--rmp-fs-body, 0.9375rem);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, opacity 0.15s;
}

.rmpc-finder-btn:hover {
  background: var(--rmpc-accent-hover);
}

.rmpc-finder-btn:active {
  background: var(--rmpc-accent-active);
}

.rmpc-finder-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 0;
  font-size: var(--rmp-fs-body, 0.8125rem);
  color: var(--rmpc-muted);
  white-space: nowrap;
  flex-wrap: wrap;
}

.rmpc-finder-hint-where {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--rmpc-accent);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

.rmpc-finder-hint-where::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230071e3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  vertical-align: middle;
}

.rmpc-finder-hint-where:hover {
  text-decoration: underline;
}

.rmpc-finder-result {
  margin-top: 12px;
}

.rmpc-finder-match {
  font-size: var(--rmp-fs-body, 0.9375rem);
  padding: 10px 14px;
  background: var(--rmpc-bg);
  border-radius: var(--rmpc-radius);
  border: 1px solid var(--rmpc-border);
}

.rmpc-finder-match-label {
  color: var(--rmpc-muted);
  font-size: var(--rmp-fs-body, 0.875rem);
}

.rmpc-finder-match-model {
  color: var(--rmpc-text);
}

.rmpc-finder-match-cta {
  color: var(--rmpc-accent);
  font-weight: 500;
  text-decoration: none;
}

.rmpc-finder-match-cta:hover {
  text-decoration: underline;
}

.rmpc-finder-error {
  color: #c0392b;
  font-size: var(--rmp-fs-body, 0.9rem);
}

/* ── Panneau "Identifier mon Mac" (sidebar droite) ─────────── */

.rmp-finder-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.rmp-finder-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

body.rmp-finder-locked {
  overflow: hidden;
}

.rmp-finder-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  width: min(420px, 100vw);
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.14);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.25, 0, 0, 1), visibility 0s linear 0.3s;
}

.rmp-finder-panel.is-open {
  transform: translateX(0);
  visibility: visible;
  transition: transform 0.3s cubic-bezier(0.25, 0, 0, 1);
}

.rmp-finder-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--rmpc-border);
  flex-shrink: 0;
}

.rmp-finder-panel-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1d1d1f;
}

.rmp-finder-panel-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #f0f0f0;
  color: #1d1d1f;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.rmp-finder-panel-close:hover { background: #e0e0e0; }

.rmp-finder-panel-close svg {
  width: 14px;
  height: 14px;
}

.rmp-finder-panel-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.rmp-finder-panel-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rmp-finder-panel-label {
  font-size: var(--rmp-fs-body, 0.875rem);
  font-weight: 500;
  color: #1d1d1f;
}

.rmp-finder-panel-subtitle {
  margin: 0;
  font-size: var(--rmp-fs-body, 0.9375rem);
  font-weight: 600;
  color: #1d1d1f;
}

.rmp-finder-panel-field {
  display: flex;
  gap: 8px;
}

.rmp-finder-hint-where {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--rmpc-accent);
  font-size: var(--rmp-fs-body, 0.8125rem);
  font-weight: 500;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.rmp-finder-hint-where:hover { color: var(--rmpc-accent-active); }

.rmp-finder-hint-where svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.rmp-finder-panel-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--rmpc-border);
  border-radius: var(--rmpc-radius);
  background: #fff !important;
  font-size: var(--rmp-fs-body, 0.9375rem);
  color: var(--rmpc-text);
  outline: none;
  box-shadow: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.rmp-finder-panel-input:focus {
  border-color: var(--rmpc-accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.18);
  background: #fff !important;
}

.rmp-finder-panel-input:disabled {
  background: var(--rmpc-bg);
  color: var(--rmpc-muted);
  cursor: default;
  border-color: var(--rmpc-border);
}

.rmp-finder-panel-btn {
  flex-shrink: 0;
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--rmpc-accent);
  border-radius: var(--rmpc-radius);
  background: var(--rmpc-accent);
  color: #fff;
  font-size: var(--rmp-fs-body, 0.875rem);
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, opacity 0.15s;
}

.rmp-finder-panel-btn:hover { background: var(--rmpc-accent-hover); border-color: var(--rmpc-accent-hover); }
.rmp-finder-panel-btn:active { background: var(--rmpc-accent-active); border-color: var(--rmpc-accent-active); }
.rmp-finder-panel-btn:disabled { opacity: 0.5; cursor: default; }

.rmp-finder-panel-error {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #fff5f5;
  border-radius: var(--rmpc-radius);
  border: 1px solid #ffd0d0;
  font-size: var(--rmp-fs-body, 0.875rem);
  color: #c0392b;
}

.rmp-finder-panel-error[hidden] { display: none; }

.rmp-finder-panel-error svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── Vos appareils (liste multi-Mac) ───────────────────────── */

.rmp-finder-devices-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rmp-finder-devices-hint {
  margin: -2px 0 0;
  font-size: var(--rmp-fs-sm, 0.875rem);
  line-height: 1.4;
  color: var(--rmpc-muted);
}

.rmp-finder-devices-hint[hidden] { display: none; }

.rmp-finder-device-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 12px;
  background: var(--rmpc-bg);
  border: 1px solid var(--rmpc-border);
  border-radius: var(--rmpc-radius);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

/* Plusieurs appareils : celui qui sert à vérifier la compatibilité est repéré (contour + pastille). */
.rmp-finder-devices-list:not(.is-single) .rmp-finder-device-item.is-active {
  background: #f0f6ff;
  border-color: var(--rmpc-accent);
  box-shadow: 0 0 0 1px var(--rmpc-accent);
}

/* Zone de sélection : radio + vignette + nom. Tout le <label> est cliquable (44 px de haut au moins). */
.rmp-finder-device-pick {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 0;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  cursor: pointer;
}

.rmp-finder-devices-list.is-single .rmp-finder-device-pick { cursor: default; }

/* Le vrai radio reste dans le DOM (clavier, lecteurs d'écran) mais n'est pas dessiné. */
.rmp-finder-device-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.rmp-finder-device-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 22px;
  height: 22px;
  box-sizing: border-box;
  background: #fff;
  border: 2px solid #c7c7cc;
  border-radius: 50%;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.rmp-finder-device-pick:hover .rmp-finder-device-mark { border-color: var(--rmpc-accent); }

.rmp-finder-device-radio:checked + .rmp-finder-device-mark {
  background: var(--rmpc-accent);
  border-color: var(--rmpc-accent);
  box-shadow: inset 0 0 0 3px #fff;
}

.rmp-finder-device-radio:focus-visible + .rmp-finder-device-mark {
  outline: 2px solid var(--rmpc-accent);
  outline-offset: 2px;
}

/* Un seul appareil : rien à choisir. */
.rmp-finder-devices-list.is-single .rmp-finder-device-mark { display: none; }

/* Vignette de la catégorie : posée directement sur la carte, sans bordure ni fond. « multiply » fond les
   fonds blancs des JPG dans la carte teintée de l'appareil actif. */
.rmp-finder-device-thumb {
  flex: none;
  width: 40px;
  height: 40px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

/* Catégorie sans vignette : repère neutre, pour garder les cartes alignées. */
.rmp-finder-device-thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a1a1a6;
}

.rmp-finder-device-thumb--empty svg {
  width: 22px;
  height: 22px;
}

.rmp-finder-device-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  flex: 1 1 0;
}

/* Nom du Mac : texte courant du site ; sur deux lignes plutôt que tronqué à « … ». */
.rmp-finder-device-model {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: var(--rmp-fs-body, 0.96rem);
  line-height: 1.3;
  color: #1d1d1f;
}

/* « (EMC 2632) » : en retrait du nom, sans jamais se couper en deux. */
.rmp-finder-device-emc {
  color: var(--rmpc-muted);
  white-space: nowrap;
}

.rmp-finder-device-state {
  display: none;
  padding: 0 8px;
  font-size: var(--rmp-fs-badge, 0.6875rem);
  font-weight: 600;
  line-height: 1.6;
  color: var(--rmpc-accent);
  background: #dceaff;
  border-radius: 999px;
}

.rmp-finder-devices-list:not(.is-single) .rmp-finder-device-item.is-active .rmp-finder-device-state {
  display: inline-block;
}

/* Actions : une rangée de boutons pleine largeur sous le nom. 44 px de haut = zone tactile
   minimale ; la taille de texte est celle du bouton « Identifier » du panneau. */
.rmp-finder-device-actions {
  display: flex;
  flex: 1 1 100%;
  gap: 8px;
}

.rmp-finder-device-link,
.rmp-finder-device-recycle {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--rmpc-border);
  border-radius: var(--rmpc-radius);
  font-size: var(--rmp-fs-sm, 0.875rem);
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, border-color 0.15s;
}

.rmp-finder-device-link { color: var(--rmpc-accent); }
.rmp-finder-device-recycle { color: #248a3d; }

.rmp-finder-device-link:hover,
.rmp-finder-device-link:active {
  background: #f0f6ff;
  border-color: var(--rmpc-accent);
  text-decoration: none;
}

.rmp-finder-device-recycle:hover,
.rmp-finder-device-recycle:active {
  background: #f0faf3;
  border-color: #248a3d;
  text-decoration: none;
}

/* Croix de retrait : zone tactile de 44 px (l'icône reste petite), débordant dans le
   padding de la carte pour ne pas l'agrandir. */
.rmp-finder-device-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -6px -6px -6px 0;
  padding: 0;
  flex-shrink: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--rmpc-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.rmp-finder-device-remove:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #c0392b;
}

.rmp-finder-device-remove svg {
  width: 14px;
  height: 14px;
}

.rmp-finder-devices-empty {
  margin: 0;
  font-size: var(--rmp-fs-body, 0.875rem);
  color: var(--rmpc-muted);
}

.rmp-finder-devices-empty[hidden] { display: none; }

/* ── Invitation à se connecter (invité) ────────────────────── */

.rmp-finder-login-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--rmpc-bg);
  border: 1px solid var(--rmpc-border);
  border-radius: var(--rmpc-radius);
  text-align: center;
}

.rmp-finder-login-cta[hidden] { display: none; }

.rmp-finder-login-cta p {
  margin: 0;
  font-size: var(--rmp-fs-body, 0.875rem);
  color: var(--rmpc-muted);
  line-height: 1.5;
}

.rmp-finder-login-cta .ch-sl-icon-buttons {
  justify-content: center;
}

.rmp-finder-login-email {
  font-size: var(--rmp-fs-body, 0.8125rem);
  font-weight: 500;
  color: var(--rmpc-accent);
  text-decoration: none;
}

.rmp-finder-login-email:hover {
  text-decoration: underline;
}

@media (max-width: 480px) {
  .rmp-finder-panel { width: 100vw; }
}

/* ── Modale EMC ────────────────────────────────────────────── */

.rmp-emc-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.rmp-emc-modal[hidden] { display: none; }

.rmp-emc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.rmp-emc-modal-box {
  position: relative;
  background: #fff;
  border-radius: 18px;
  padding: 28px 28px 24px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rmp-emc-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: #f0f0f0;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  color: #1d1d1f;
  line-height: 1;
  font-size: 0;
  transition: background 0.15s;
}

.rmp-emc-modal-close:hover { background: #e0e0e0; }

.rmp-emc-modal-close svg {
  width: 14px;
  height: 14px;
  display: block;
  flex-shrink: 0;
}

.rmp-emc-modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1d1d1f;
  margin: 0;
  padding-right: 32px;
  letter-spacing: -0.01em;
}

.rmp-emc-modal-desc {
  font-size: var(--rmp-fs-body, 0.9rem);
  color: #6e6e73;
  margin: 0;
  line-height: 1.5;
}

.rmp-emc-modal-img {
  width: 100%;
  border-radius: var(--rmpc-radius);
  display: block;
  margin-top: 4px;
}

/* ── Badge de compatibilité produit ───────────────────────── */

.rmpc-product-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 10px 0 4px;
  padding: 0;
  font-family: var(--rmp-font, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
  font-size: var(--rmp-fs-meta, 0.875rem);
  line-height: 1.4;
  color: var(--rmpc-muted, #6e6e73);
  background: none;
  border: none;
  cursor: default;
}

.rmpc-product-badge__icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.rmpc-product-badge__icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.rmpc-product-badge__text {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;   /* le texte occupe toute la largeur : sans ça, un <button> le centre */
}

.rmpc-product-badge__text strong {
  font-weight: 600;
}

/* « Changer » : rouvre le panneau pour choisir un autre appareil. Les marges négatives donnent une
   zone tactile de 44 px sans agrandir le badge ; !important : le thème stylise tous les <button>. */
.rmpc-product-badge .rmpc-product-badge__change {
  flex: none;
  align-self: center;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin: -10px -6px -10px auto;
  padding: 0 6px 0 14px;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  color: var(--rmpc-accent, #0071e3) !important;
  font: inherit;
  font-size: var(--rmp-fs-meta, 0.875rem);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.rmpc-product-badge .rmpc-product-badge__change:hover,
.rmpc-product-badge .rmpc-product-badge__change:focus-visible {
  color: var(--rmpc-accent-active, #006edb) !important;
}

/* État : vérifier (cliquable) */
.rmpc-product-badge--check,
.rmpc-product-badge--check:hover,
.rmpc-product-badge--check:focus,
.rmpc-product-badge--check:active {
  color: var(--rmpc-accent, #0071e3) !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.rmpc-product-badge--check { font-weight: 400; }
.rmpc-product-badge--check:hover { font-weight: 600; }

.rmpc-product-badge--check .rmpc-product-badge__icon {
  color: var(--rmpc-accent, #0071e3);
}

/* État compatible */
.rmpc-product-badge--compatible .rmpc-product-badge__text {
  color: #1d1d1f;
}

/* État incompatible */
.rmpc-product-badge--incompatible .rmpc-product-badge__text {
  color: #1d1d1f;
}

/* ── Tableau de compatibilité ──────────────────────────────── */

.rmpc-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0;
}

.rmpc-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--rmp-font, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
  font-size: var(--rmp-fs-body, 0.9375rem);
  background: var(--rmpc-bg);
}

.rmpc-table th,
.rmpc-table td {
  padding: 8px 12px;
  border: 1px solid var(--rmpc-border);
  text-align: left;
  background: var(--rmpc-bg);
}

.rmpc-table th {
  font-weight: 600;
  font-size: var(--rmp-fs-body, 0.875rem);
  color: #1d1d1f;
}

.rmpc-table .rmpc-col-model {
  color: #315c99;
  font-weight: 500;
}

.rmpc-table .rmpc-col-model a {
  color: inherit;
  font-weight: inherit;
  text-decoration: none;
}

.rmpc-table .rmpc-col-model a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .rmpc-table th,
  .rmpc-table td {
    padding: 6px 8px;
    font-size: var(--rmp-fs-body, 0.8125rem);
  }
}

/* ── Page catégorie filtrée sur le modèle identifié (variantes) ── */

.rmpc-model-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0 0 16px;
  font-size: var(--rmp-fs-body, .96rem);
  color: #1d1d1f;
}

.rmpc-model-filter a {
  color: #315c99;
  white-space: nowrap;
}
