/* ========================================
   WIDGET D'AVIS « Quelques retours de nos clients » (includes/lg-avis-widget.php)
   ======================================== */

.lg-avis-pastille[hidden],
.lg-avis-popup[hidden],
.lg-avis-suite[hidden],
.lg-avis-nav[hidden] {
  display: none !important;
}

.lg-avis-etoiles {
  color: #c9a227;
  letter-spacing: 1px;
  font-size: 13px;
  line-height: 1;
}

/* ---------- Pastille ---------- */
.lg-avis-pastille {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9990;
  font-family: var(--font-primary);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .35s ease, transform .35s ease;
}

.lg-avis-pastille--visible {
  opacity: 1;
  transform: none;
}

.lg-avis-pastille-ouvrir {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 9px 18px 9px 10px;
  background: #fff;
  color: var(--color-text-primary);
  border: 1px solid var(--color-line);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(60, 45, 30, .18);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: box-shadow .2s ease, transform .2s ease;
}

.lg-avis-pastille-ouvrir:hover {
  background: #fff;
  color: var(--color-text-primary);
  box-shadow: 0 10px 28px rgba(60, 45, 30, .26);
  transform: translateY(-1px);
}

.lg-avis-initiales {
  display: flex;
}

.lg-avis-initiales span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: -8px;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

.lg-avis-initiales span:first-child {
  margin-left: 0;
}

.lg-avis-pastille-texte strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

.lg-avis-pastille-texte small {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  color: #7a6a58;
}

.lg-avis-pastille-fermer {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--color-line);
  border-radius: 50%;
  background: #fff;
  color: #777;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .12);
}

.lg-avis-pastille-fermer:hover {
  background: #fff;
  color: #333;
}

/* Masquée tant que le configurateur est ouvert */
body:has(#lg-customizer-overlay.lg-open) .lg-avis-pastille {
  display: none !important;
}

/* ---------- Pop-up ---------- */
.lg-avis-popup {
  position: fixed;
  inset: 0;
  z-index: 100001;
  font-family: var(--font-primary);
}

.lg-avis-popup-fond {
  position: absolute;
  inset: 0;
  background: rgba(30, 24, 18, .35);
}

.lg-avis-popup-boite {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 400px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(40, 30, 20, .25);
  animation: lg-avis-entree .25s ease;
}

@keyframes lg-avis-entree {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.lg-avis-popup-entete {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 20px 8px;
}

.lg-avis-popup-entete h2 {
  margin: 6px 0 2px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-text-primary);
}

.lg-avis-popup-entete p {
  margin: 0;
  font-size: 12px;
  color: #888;
}

.lg-avis-popup-fermer {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--color-ivory);
  color: #555;
  font-size: 18px;
  line-height: 32px;
  cursor: pointer;
}

.lg-avis-popup-fermer:hover {
  background: var(--color-line);
  color: #222;
}

body.lg-avis-popup-ouverte {
  overflow: hidden;
}

/* ---------- Carrousel et cartes (pop-up + fiche) ---------- */
.lg-avis-piste {
  display: flex;
  /* Chaque carte garde sa hauteur : sans photo, elle ne s'étire pas sur celle d'à côté. */
  align-items: flex-start;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 6px 20px 4px;
  scroll-padding: 0 20px;
}

.lg-avis-piste::-webkit-scrollbar {
  display: none;
}

.lg-avis-piste:focus-visible {
  outline: 2px solid var(--color-accent-main);
  outline-offset: -2px;
}

.lg-avis-carte {
  flex: 0 0 85%;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: var(--color-ivory);
  border-radius: 14px;
}

.lg-avis-texte {
  margin: 10px 0 6px;
  font-size: 14px;
  line-height: 1.5;
  color: #2a2a2a;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lg-avis-carte--ouverte .lg-avis-texte {
  -webkit-line-clamp: unset;
  display: block;
}

.lg-avis-suite {
  align-self: flex-start;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: none;
  color: #7a6a58;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.lg-avis-suite:hover {
  background: none;
  color: #222;
}

.lg-avis-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
  font-size: 12px;
  color: #777;
}

.lg-avis-meta strong {
  color: var(--color-text-primary);
  font-weight: 600;
}

.lg-avis-produit {
  align-self: flex-start;
  margin-top: 8px;
  padding: 3px 10px;
  background: #fff;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  color: #7a6a58;
  font-size: 11px;
  text-decoration: none;
}

.lg-avis-produit:hover {
  border-color: var(--color-accent-main);
  color: #7a6a58;
}

.lg-avis-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px 18px;
}

.lg-avis-points {
  display: flex;
  gap: 6px;
  align-items: center;
}

.lg-avis-points button {
  width: 7px;
  height: 7px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #e0d9d1;
  cursor: pointer;
  transition: width .2s ease;
}

.lg-avis-points button.actif {
  width: 18px;
  border-radius: 4px;
  background: var(--color-accent-main);
}

.lg-avis-fleches {
  display: flex;
  gap: 8px;
}

.lg-avis-fleches button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--color-line);
  border-radius: 50%;
  background: #fff;
  color: #555;
  font-size: 18px;
  line-height: 32px;
  cursor: pointer;
}

.lg-avis-fleches button:hover {
  background: var(--color-ivory);
  color: #222;
}

.lg-avis-fleches button:disabled {
  opacity: .35;
  cursor: default;
}

/* ---------- Mentions légales près des avis (D111-10) : discrètes ---------- */
.lg-avis-dates {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.4;
  color: #8a8a8a;
}

.lg-avis-mentions {
  margin: 0;
  font-size: 11px;
  font-style: italic;
  line-height: 1.45;
  color: #8a8a8a;
}

.lg-avis-mentions a {
  color: #7a6a58;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

/* Pop-up : ligne en bas du cadre, sous les flèches */
.lg-avis-popup .lg-avis-nav {
  padding-bottom: 10px;
}

.lg-avis-popup .lg-avis-mentions {
  padding: 0 20px 16px;
}

/* Fiche : sous le carrousel */
.lg-avis-section .lg-avis-section-sous-titre {
  margin-bottom: 18px;
}

.lg-avis-section .lg-avis-nav {
  padding-bottom: 8px;
}

.lg-avis-section .lg-avis-mentions {
  font-size: 12px;
}

/* ---------- Photos des clients ---------- */
.lg-avis-photo {
  display: block;
  width: calc(100% + 32px);
  margin: -16px -16px 14px;
  padding: 0;
  border: 0;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #e8e2da;
  cursor: zoom-in;
}

.lg-avis-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}

.lg-avis-photo:hover img {
  transform: scale(1.03);
}

.lg-avis-carte .lg-avis-photo:focus,
.lg-avis-carte .lg-avis-photo:active,
.lg-avis-carte .lg-avis-photo:hover {
  background: #e8e2da !important;
}

.lg-avis-rond-photo {
  overflow: hidden;
  background: #e8e2da;
}

.lg-avis-rond-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lg-avis-zoom[hidden] {
  display: none !important;
}

.lg-avis-zoom {
  position: fixed;
  inset: 0;
  z-index: 100002;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 16, 12, .88);
  cursor: zoom-out;
}

.lg-avis-zoom img {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
  cursor: default;
}

.lg-avis-zoom-fermer,
.lg-avis-zoom .lg-avis-zoom-fermer:focus,
.lg-avis-zoom .lg-avis-zoom-fermer:active,
.lg-avis-zoom .lg-avis-zoom-fermer:hover {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92) !important;
  color: #222 !important;
  font-size: 22px;
  line-height: 40px;
  cursor: pointer;
}

/* ---------- Fiche produit ---------- */
.lg-avis-lien {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  gap: 8px;
  margin-top: -12px;
  font-size: 13px;
  color: var(--color-text-secondary);
  text-decoration: none;
}

.lg-avis-lien .lg-avis-etoiles {
  font-size: 17px;
  letter-spacing: 1.5px;
}

.lg-avis-lien-texte {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lg-avis-section {
  max-width: 1200px;
  margin: 60px auto;
  padding: 0 20px;
  scroll-margin-top: 110px;
  font-family: var(--font-primary);
}

.lg-avis-section h2 {
  margin: 8px 0 4px;
  font-size: var(--fs-h2);
  font-weight: var(--fw-medium);
  color: var(--color-text-primary);
}

.lg-avis-section-sous-titre {
  margin: 0 0 18px;
  font-size: 14px;
  color: #888;
}

.lg-avis-section .lg-avis-piste,
.lg-avis-section .lg-avis-nav {
  padding-left: 0;
  padding-right: 0;
}

.lg-avis-section .lg-avis-piste {
  scroll-padding: 0;
}

.lg-avis-section .lg-avis-carte {
  flex-basis: calc((100% - 24px) / 3);
}

/* ---------- Mobile ---------- */
@media (max-width: 1024px) {
  .lg-avis-section .lg-avis-carte {
    flex-basis: 80%;
  }
}

@media (max-width: 600px) {
  .lg-avis-pastille {
    right: 12px;
    bottom: 12px;
  }

  .lg-avis-pastille-ouvrir {
    padding: 7px 14px 7px 8px;
  }

  .lg-avis-pastille-texte strong {
    font-size: 12px;
  }

  .lg-avis-popup-boite {
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 18px 18px 0 0;
  }
}

/* Le thème donne aux boutons un fond foncé au focus / clic : on garde l'apparence
   du widget, avec un contour visible seulement à la navigation au clavier. */
.lg-avis-pastille button:focus,
.lg-avis-pastille button:active,
.lg-avis-popup button:focus,
.lg-avis-popup button:active,
.lg-avis-section button:focus,
.lg-avis-section button:active {
  outline: none;
}

.lg-avis-pastille .lg-avis-pastille-ouvrir:focus,
.lg-avis-pastille .lg-avis-pastille-ouvrir:active,
.lg-avis-pastille .lg-avis-pastille-fermer:focus,
.lg-avis-pastille .lg-avis-pastille-fermer:active,
.lg-avis-fleches button:focus,
.lg-avis-fleches button:active {
  background: #fff !important;
  color: #555 !important;
}

.lg-avis-popup .lg-avis-popup-fermer:focus,
.lg-avis-popup .lg-avis-popup-fermer:active {
  background: var(--color-ivory) !important;
  color: #555 !important;
}

.lg-avis-pastille button:focus-visible,
.lg-avis-popup button:focus-visible,
.lg-avis-section button:focus-visible {
  outline: 2px solid var(--color-accent-main);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .lg-avis-section h2 {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lg-avis-pastille,
  .lg-avis-popup-boite {
    transition: none;
    animation: none;
  }

  .lg-avis-piste {
    scroll-behavior: auto;
  }
}
