/* ============================================================
   AVA CONFIGURATEUR — Styles frontend (popup plein écran)
   ============================================================ */

.ald-config-trigger {
  --ald-primary: #d63b6f;
  --ald-primary-dark: #b52e5a;
  --ald-btn-text: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  background: linear-gradient(135deg, var(--ald-primary) 0%, var(--ald-primary-dark) 100%);
  color: var(--ald-btn-text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  /* Ombre neutre plutôt que teintée : reste cohérente quelle que soit la couleur choisie en
     admin (une ombre teintée en dur ne matcherait qu'un seul coloris possible). */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.18);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  cursor: pointer;
  border: none;
}
.ald-config-trigger:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  transform: translateY(-2px);
}
.ald-config-trigger:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}
.ald-config-trigger-icon {
  flex-shrink: 0;
  animation: ald-pulse-soft 2s infinite ease-in-out;
}
@keyframes ald-pulse-soft {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.ald-config-overlay {
  --ald-primary: #d63b6f;
  --ald-primary-dark: #b52e5a;
  --ald-btn-text: #ffffff;
  --ald-bg: #ffffff;
  --ald-text: #2b2b2b;
  --ald-muted: #8a8a8a;
  --ald-border: #ececec;

  display: none;
  position: fixed;
  inset: 0;
  background: var(--ald-bg);
  z-index: 999999; /* au-dessus de la barre d'admin WP (z-index: 99999) */
  opacity: 0;
  transition: opacity 0.25s ease;
}
.ald-config-overlay.ald-open { display: flex; }
.ald-config-overlay.ald-visible { opacity: 1; }

.ald-config-popup {
  background: var(--ald-bg);
  width: 100%;
  height: 100%;
  overflow-y: auto;
  position: relative;
  font-family: inherit;
  color: var(--ald-text);
  display: flex;
  flex-direction: column;
}

.ald-config-close {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #f4f4f4;
  color: #555;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.ald-config-close:hover { background: #e8e8e8; }

.ald-header {
  padding: 32px clamp(20px, 8vw, 80px) 16px;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}
.ald-eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ald-muted);
  font-weight: 600;
  margin: 0 0 6px;
}
.ald-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 18px;
  padding-right: 30px;
}
.ald-progress-track {
  height: 6px;
  background: var(--ald-border);
  border-radius: 4px;
  overflow: hidden;
}
.ald-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--ald-primary);
  border-radius: 4px;
  transition: width 0.35s ease;
}
.ald-body {
  padding: 8px clamp(20px, 8vw, 80px) 40px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ald-step { display: none; }
.ald-step.ald-active {
  display: block;
  animation: ald-fade 0.3s ease;
}
@keyframes ald-fade {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

.ald-question {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 700;
  margin: 0 0 6px;
}
.ald-question-sub {
  font-size: 14px;
  color: var(--ald-muted);
  margin: 0 0 26px;
}

.ald-question-hint {
  font-size: 13px;
  font-weight: 600;
  color: var(--ald-primary-dark);
  margin: 0 0 14px;
}

.ald-options,
.ald-levels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ald-option {
  border: 2px solid var(--ald-border);
  border-radius: 12px;
  padding: 18px 20px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease;
  color: var(--ald-text);
}
.ald-option:hover {
  /* Neutre plutôt que teinté en dur : reste cohérent quelle que soit la couleur principale
     choisie en admin (une teinte figée ne s'accorderait qu'avec un seul coloris possible). */
  border-color: var(--ald-muted);
  background: #f7f7f7;
}
.ald-option.ald-selected {
  border-color: var(--ald-primary);
  background: #f7f7f7;
  color: var(--ald-primary-dark);
}
.ald-option .ald-option-desc {
  display: block;
  font-weight: 400;
  font-size: 12px;
  color: var(--ald-muted);
  margin-top: 3px;
}

/* Grande zone photo au-dessus de la question, dans l'espace disponible en haut du popup.
   Tant qu'aucune option n'est choisie, toutes les photos illustrées sont visibles côte à côte ;
   choisir une option (bouton texte plus bas) resserre la zone sur la seule photo correspondante
   (voir updateVisualSelection dans configurateur.js). */
.ald-visual {
  display: grid;
  grid-template-columns: repeat(var(--ald-visual-count, 1), 1fr);
  grid-template-rows: 1fr;
  gap: 10px;
  width: 100%;
  max-height: 420px;
  min-height: 200px;
  margin-bottom: 24px;
  overflow: hidden;
}
.ald-visual-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 16px;
  background: var(--ald-border);
}
.ald-visual.ald-visual-collapsed .ald-visual-img {
  display: none;
}
.ald-visual.ald-visual-collapsed .ald-visual-img.ald-visual-img-selected {
     display: block;
    grid-column: 1 / -1;
    height: 350px;
    object-fit: cover;
    width: auto;
    margin: auto;
}

/* Choix multiple : plusieurs médias retenus se partagent la rangée (colonnes fixées par le JS)
   au lieu de s'empiler chacun en pleine largeur comme le fait le cas "un seul média retenu". */
.ald-visual.ald-visual-multi .ald-visual-img.ald-visual-img-selected,
.ald-visual.ald-visual-multi video.ald-visual-img.ald-visual-img-selected {
  grid-column: auto;
  width: 100%;
  height: 350px;
  margin: 0;
  object-fit: cover;
}

/* Option "Peu importe" : visuellement en retrait par rapport aux vrais choix */
.ald-option.ald-option-skip {
  border-style: dashed;
  color: var(--ald-muted);
  text-align: center;
  justify-content: center;
  display: flex;
  align-items: center;
}
.ald-option.ald-option-skip:hover {
  border-color: var(--ald-muted);
  background: #f7f7f7;
}
.ald-option.ald-option-skip.ald-selected {
  border-color: var(--ald-muted);
  background: #f2f2f2;
  color: var(--ald-text);
}

.ald-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(20px, 8vw, 80px);
  padding-right: clamp(20px, 8vw, 80px);
  padding-bottom: 28px;
}
.ald-btn {
  border: none;
  border-radius: 50px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.ald-btn-back {
  background: transparent;
  color: var(--ald-muted);
  padding: 14px 8px;
}
.ald-btn-back:hover { color: var(--ald-text); }
.ald-btn-next {
  background: var(--ald-primary);
  color: var(--ald-btn-text);
}
.ald-btn-next:hover { background: var(--ald-primary-dark); }
.ald-btn-next:disabled { opacity: 0.4; cursor: not-allowed; }
.ald-btn-next:disabled:hover { background: var(--ald-primary); }

.ald-result-icon {
  font-size: 40px;
  text-align: center;
  margin-bottom: 10px;
}
.ald-result-text {
  text-align: center;
  font-size: 14px;
  color: var(--ald-muted);
  margin-bottom: 20px;
}
.ald-recap {
  background: #faf7f8;
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 13px;
  margin-bottom: 22px;
}
.ald-recap-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--ald-border);
}
.ald-recap-row:last-child { border-bottom: none; }
.ald-recap-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ald-recap-text strong { color: var(--ald-text); }
.ald-recap-value { color: var(--ald-primary-dark); font-weight: 600; }
.ald-recap-edit {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--ald-muted);
  padding: 6px;
  border-radius: 6px;
  line-height: 1;
}
.ald-recap-edit:hover { background: var(--ald-border); color: var(--ald-text); }

.ald-btn-submit {
  width: 100%;
  background: var(--ald-primary);
  color: var(--ald-btn-text);
  padding: 15px;
  font-size: 15px;
  border-radius: 50px;
  border: none;
  font-weight: 700;
  cursor: pointer;
}
.ald-btn-submit:hover { background: var(--ald-primary-dark); }

@media (max-width: 480px) {
  .ald-options, .ald-levels { grid-template-columns: 1fr; }
  .ald-visual { height: 28vh; min-height: 160px; max-height: 260px; }
}

video.ald-visual-img {
    width: auto;
    height: 350px;
    margin: auto;
}