/* ═══════════════════════════════════════════════════════════════
   SJ Reviews — Page Avis (style TripAdvisor)
   Sections :
     1. Conteneur principal
     2. En-tête : score + bulles
     3. Zone centrale : distribution + sous-critères (2-col)
     4. Barre de filtres
     5. Grid de cards
     6. Card avis
     7. Voir plus
     8. État vide
     9. Responsive
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Conteneur principal ───────────────────────────────────── */
.sj-summary {
  font-family: inherit;
  color: #111;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 28px 24px;
}

/* ── 2. Top : score + distribution (wrapper) ─────────────────── */
.sj-summary__top {
  display: flex;
  align-items: flex-start;
  gap: 32px;
  padding-bottom: 20px;
  border-bottom: var(--sj-divider-width, 1px) solid var(--sj-divider-color, #f0f0f0);
  margin-bottom: 20px;
}

.sj-summary__score-block {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
}

.sj-summary__score-num {
  font-size: 3.75rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  color: #111;
  flex-shrink: 0;
}

.sj-summary__score-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.sj-summary__score-label {
  font-size: 1rem;
  font-weight: 700;
  color: #111;
}

.sj-summary__count {
  font-size: 0.8rem;
  color: #6b7280;
}

/* Bulles TripAdvisor */
.sj-summary__bubbles {
  display: flex;
  gap: 4px;
  align-items: center;
}

.sj-summary__bubble {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sj-summary__bubble--full  { background: #34d399; }
.sj-summary__bubble--half  { background: linear-gradient(90deg, #34d399 50%, #d1fae5 50%); }
.sj-summary__bubble--empty { background: #d1fae5; }

/* Small bubbles variant (inside cards) */
.sj-summary__bubbles--sm .sj-summary__bubble {
  width: 12px;
  height: 12px;
}
.sj-summary__bubbles--sm {
  gap: 3px;
}

/* ── 3. Distribution (inside top) ────────────────────────────── */

/* Distribution par étoiles */
.sj-summary__distribution {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
  padding-left: 32px;
  border-left: var(--sj-divider-width, 1px) solid var(--sj-divider-color, #f0f0f0);
}

.sj-summary__dist-row {
  display: grid;
  grid-template-columns: 72px 1fr 28px;
  align-items: center;
  gap: 8px;
}

.sj-summary__dist-label {
  font-size: 0.75rem;
  color: #374151;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}

.sj-summary__dist-track {
  height: 8px;
  background: #f3f4f6;
  border-radius: 99px;
  overflow: hidden;
}

.sj-summary__dist-fill {
  height: 100%;
  background: #34d399;
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.sj-summary__dist-count {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 600;
  text-align: right;
}

/* Sous-critères section (standalone block) */
.sj-summary__criteria-section {
  padding-bottom: 20px;
  border-bottom: var(--sj-divider-width, 1px) solid var(--sj-divider-color, #f0f0f0);
  margin-bottom: 20px;
}

/* Sous-critères : grille 2 colonnes */
.sj-summary__criteria {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  align-content: start;
}

.sj-summary__criterion {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.sj-summary__crit-label {
  font-size: 0.72rem;
  color: #374151;
  font-weight: 500;
  white-space: nowrap;
}

.sj-summary__crit-track {
  height: 6px;
  background: #f3f4f6;
  border-radius: 99px;
  overflow: hidden;
  min-width: 0;
}

.sj-summary__crit-fill {
  height: 100%;
  background: #6366f1;
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.sj-summary__crit-score {
  font-size: 0.78rem;
  font-weight: 700;
  color: #111;
  text-align: right;
  white-space: nowrap;
}

/* ── 4. Barre de filtres ──────────────────────────────────────── */

/* Sort */
.sj-filters__sort {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sj-filters__sort-label {
  font-size: 0.78rem;
  color: #6b7280;
  white-space: nowrap;
}

.sj-filters__sort-select {
  font-size: 0.82rem;
  font-weight: 600;
  color: #111;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 5px 10px;
  background: #fff;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 28px;
}

/* Badge reset */
.sj-filters__active {
  margin-left: auto;
}

.sj-filters__reset {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  color: #6366f1;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sj-filters__reset:hover { color: #4f46e5; }

/* ── 5. Grid de cards ─────────────────────────────────────────── */
.sj-cards-grid {
  display: grid;
  gap: 16px;
}

.sj-cards-grid--1col { grid-template-columns: 1fr; }
.sj-cards-grid--2col { grid-template-columns: repeat(2, 1fr); }
.sj-cards-grid--3col { grid-template-columns: repeat(3, 1fr); }

/* Cards cachées (overflow) */
.sj-card--overflow,
.sj-card--hidden {
  display: none;
}

/* ── 6. Card avis ─────────────────────────────────────────────── */
.sj-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}


/* En-tête */
.sj-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sj-card__author-block {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* Avatar */
.sj-card__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.sj-card__avatar--initiale {
  background: var(--sj-avatar-bg, #e0e7ff);
  color: var(--sj-avatar-color, #4f46e5);
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sj-card__avatar--img {
  border: 2px solid #f3f4f6;
}

/* Infos auteur */
.sj-card__author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sj-card__author-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sj-card__source-name {
  font-size: 0.72rem;
  color: #9ca3af;
}

/* Badge certifié */
.sj-card__certified {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #86efac;
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Rating + meta */
.sj-card__rating {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sj-card__meta {
  font-size: 0.78rem;
  color: #6b7280;
}

/* Titre */
.sj-card__title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111;
  margin: 0;
  line-height: 1.4;
}

/* Texte */
.sj-card__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sj-card__text {
  font-size: 0.88rem;
  color: #374151;
  line-height: 1.65;
  margin: 0;
  white-space: pre-line;
}

.sj-card__more {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #6366f1;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.sj-card__more:hover { color: #4f46e5; }

/* Pied */
.sj-card__footer {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #f9fafb;
}

.sj-card__date {
  font-size: 0.73rem;
  color: #9ca3af;
}

/* ── 6b. Bandeau vérifié ─────────────────────────────────────── */
.sj-summary__verified-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  margin-top: 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 6px;
  font-size: 13px;
  color: #166534;
  line-height: 1.4;
}
.sj-summary__verified-banner svg {
  flex-shrink: 0;
  color: #16a34a;
}

/* ── 7. Voir plus (global) ───────────────────────────────────── */
.sj-summary__loadmore {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.sj-summary__load-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #111;
  background: #fff;
  border: 2px solid #111;
  border-radius: 99px;
  padding: 10px 24px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.sj-summary__load-btn:hover {
  background: #111;
  color: #fff;
}

.sj-summary__load-count {
  font-weight: 400;
  color: inherit;
  opacity: 0.6;
}

/* ── 8. État vide ────────────────────────────────────────────── */
.sj-summary--empty {
  color: #9ca3af;
  font-size: 0.875rem;
  text-align: center;
  padding: 24px;
}

/* ── 9. Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .sj-summary__top {
    flex-direction: column;
    gap: 0;
  }

  .sj-summary__top .sj-summary__score-block {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: var(--sj-divider-width, 1px) solid var(--sj-divider-color, #f0f0f0);
    width: 100%;
  }

  .sj-summary__distribution {
    border-left: none !important;
    border-right: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .sj-summary__criteria {
    grid-template-columns: 1fr;
  }

  .sj-cards-grid--2col,
  .sj-cards-grid--3col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1024px) {
  .sj-cards-grid--3col {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .sj-summary {
    padding: 18px 14px;
    border-radius: 10px;
  }

  .sj-summary__score-num {
    font-size: 2.75rem;
  }

  .sj-summary__score-block {
    gap: 12px;
  }

  .sj-summary__filterbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .sj-filter-trigger {
    justify-content: center;
  }

  .sj-filters__active {
    margin-left: 0;
    text-align: center;
  }

  .sj-search__wrap--inline {
    flex: 1 1 100%;
    max-width: 100%;
    margin-left: 0;
    order: 10;
  }

  .sj-card {
    padding: 14px 16px;
  }

  .sj-card__author-name {
    font-size: 0.82rem;
  }

  .sj-card__text {
    font-size: 0.82rem;
  }

  .sj-summary__load-btn {
    width: 100%;
    justify-content: center;
    padding: 12px 20px;
  }

  .sj-search__wrap:not(.sj-search__wrap--inline) {
    max-width: 100%;
  }
}

@media (max-width: 400px) {
  .sj-summary {
    padding: 14px 10px;
    border-radius: 8px;
  }

  .sj-summary__score-num {
    font-size: 2.25rem;
  }

  .sj-summary__dist-row {
    grid-template-columns: 56px 1fr 24px;
    gap: 6px;
  }

  .sj-summary__dist-label {
    font-size: 0.68rem;
  }

  .sj-filter-modal__panel {
    max-width: 100%;
  }
}

/* ── Barre filtres ───────────────────────────────────────────────────────── */
.sj-summary__filterbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.sj-filter-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 1.5px solid #d1d5db;
  border-radius: 9999px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.sj-filter-trigger:hover { border-color: #111; }
.sj-filter-trigger__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  background: #111;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.sj-filter-trigger__badge[hidden] { display: none !important; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.sj-filter-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
}
@media (min-width: 640px) {
  .sj-filter-modal { align-items: center; justify-content: center; }
}
.sj-filter-modal[hidden] { display: none; }
.sj-filter-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  cursor: pointer;
}
.sj-filter-modal__panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: #fff;
  border-radius: 20px 20px 0 0;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
/* Drag handle sur mobile */
.sj-filter-modal__panel::before {
  content: '';
  display: block;
  width: 36px;
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  margin: 10px auto 2px;
  flex-shrink: 0;
}
@media (min-width: 640px) {
  .sj-filter-modal__panel::before { display: none; }
}
@media (min-width: 640px) {
  .sj-filter-modal__panel { border-radius: 20px; max-height: 80vh; }
}
.sj-filter-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f0f0f0;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.sj-filter-modal__title { font-size: 18px; font-weight: 700; margin: 0; }
.sj-filter-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f5f5f5;
  cursor: pointer;
  color: #111;
}
.sj-filter-modal__body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow-y: auto;
}
.sj-filter-modal__group-label {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 12px;
  color: #111;
}
/* Dots note ────────────────────────────────────────────────────────────── */
.sj-filter-modal__dots-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sj-filter-modal__dot-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  border: 1.5px solid #e5e7eb;
  border-radius: 9999px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.sj-filter-modal__dot-btn:hover {
  border-color: var(--sj-modal-accent, #111);
  background: #f9f9f9;
}
.sj-filter-modal__dot-btn.is-active {
  background: var(--sj-modal-accent, #111);
  border-color: var(--sj-modal-accent, #111);
}
.sj-filter-modal__dot-btn.is-active .sj-filter-modal__dot {
  border-color: rgba(255,255,255,0.6);
  background: transparent;
}
.sj-filter-modal__dot-btn.is-active .sj-filter-modal__dot--full {
  background: #fff;
  border-color: #fff;
}
.sj-filter-modal__dot-btn.is-active .sj-filter-modal__dot-count {
  color: #fff;
}
.sj-filter-modal__dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--sj-dot-color, #34d399);
  background: transparent;
}
.sj-filter-modal__dot--full { background: var(--sj-dot-color, #34d399); }
.sj-filter-modal__dot-count { font-size: 13px; font-weight: 600; margin-left: 2px; }
/* Pills ─────────────────────────────────────────────────────────────────── */
.sj-filter-modal__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sj-filter-modal__pill {
  padding: 7px 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 9999px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.sj-filter-modal__pill:hover {
  border-color: var(--sj-modal-accent, #111);
  background: #f9f9f9;
}
.sj-filter-modal__pill.is-active {
  background: var(--sj-modal-accent, #111);
  border-color: var(--sj-modal-accent, #111);
  color: #fff;
}
/* Footer ─────────────────────────────────────────────────────────────────── */
.sj-filter-modal__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid #f0f0f0;
  position: sticky;
  bottom: 0;
  background: #fff;
}
.sj-filter-modal__btn-reset {
  padding: 10px 20px;
  border: 1.5px solid #d1d5db;
  border-radius: 9999px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.sj-filter-modal__btn-reset:hover { border-color: #111; }
.sj-filter-modal__btn-apply {
  padding: 10px 24px;
  border-radius: 9999px;
  border: none;
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.sj-filter-modal__btn-apply:hover { background: #333; }
body.sj-modal-open {
  overflow: hidden;
  position: fixed;   /* iOS Safari : bloque le scroll de la page */
  width: 100%;
  top: var(--sj-scroll-y, 0px);
}

/* ── Sous-critères par card ──────────────────────────────────────────────── */
.sj-card__criteria {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}
.sj-card__crit-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sj-card__crit-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sj-crit-color, #22c55e);
  flex-shrink: 0;
}
/* Color scale based on rating value */
.sj-card__crit-dot[data-val="5"] { background: #22c55e; }
.sj-card__crit-dot[data-val="4"] { background: #84cc16; }
.sj-card__crit-dot[data-val="3"] { background: #eab308; }
.sj-card__crit-dot[data-val="2"] { background: #f97316; }
.sj-card__crit-dot[data-val="1"] { background: #ef4444; }
.sj-card__crit-label {
  font-size: 12px;
  color: #555;
  min-width: 90px;
  flex-shrink: 0;
}
.sj-card__crit-track {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #e5e7eb;
  overflow: hidden;
}
.sj-card__crit-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--sj-crit-color, #22c55e);
  transition: width .3s ease;
}
.sj-card__crit-score {
  font-size: 12px;
  font-weight: 600;
  color: #111;
  min-width: 24px;
  text-align: right;
}

/* ── Contributions ───────────────────────────────────────────────────────── */
.sj-card__contributions {
  font-size: 11px;
  color: #9ca3af;
  margin-left: 4px;
}

/* ── Certifié (custom props) ─────────────────────────────────────────────── */
.sj-card__certified {
  background: var(--sj-certified-bg, #f0fdf4);
  color: var(--sj-certified-color, #15803d);
  border: 1px solid var(--sj-certified-border, #bbf7d0);
  border-radius: var(--sj-certified-radius, 4px);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
}

/* ── Layout side variant ──────────────────────────────────────── */
.sj-summary__top--side-left {
  /* Default is already flex row, this is the normal state */
}

.sj-summary__top--side-right {
  flex-direction: row-reverse;
}

.sj-summary__top--side-right .sj-summary__distribution {
  border-left: none;
  padding-left: 0;
  border-right: var(--sj-divider-width, 1px) solid var(--sj-divider-color, #f0f0f0);
  padding-right: 32px;
}

/* ── Container max-width ──────────────────────────────────────── */
.sj-summary--has-max-width {
  max-width: var(--sj-max-width, none);
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 1024px) {
  .sj-summary--has-max-width {
    max-width: var(--sj-max-width-tablet, var(--sj-max-width, none));
  }
}

@media (max-width: 600px) {
  .sj-summary--has-max-width {
    max-width: var(--sj-max-width-mobile, var(--sj-max-width-tablet, var(--sj-max-width, none)));
  }
}

/* ── Barre de recherche (shadcn-like) ────────────────────────── */
.sj-search__wrap {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 100%;
}

/* Inline variant inside filterbar */
.sj-search__wrap--inline {
  margin-left: auto;
  flex: 0 1 260px;
  max-width: 100%;
}

.sj-search__icon {
  position: absolute;
  left: 11px;
  color: var(--sj-search-icon-color, #9ca3af);
  pointer-events: none;
  flex-shrink: 0;
  z-index: 1;
}

.sj-search__input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 36px;
  font-size: 0.875rem;
  color: #111;
  background: var(--sj-search-bg, #fff);
  border: 1px solid var(--sj-search-border-color, #e5e7eb);
  border-radius: var(--sj-search-radius, 8px);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.sj-search__input::placeholder { color: #9ca3af; }
.sj-search__input:focus {
  border-color: var(--sj-search-focus-color, #111);
  box-shadow: 0 0 0 3px rgba(17, 17, 17, .07);
}
.sj-search__input::-webkit-search-cancel-button { cursor: pointer; }

/* ── AJAX loading state ─────────────────────────────────── */
.sj-summary__reviews--loading {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* ── Accessibility: reduced motion ──────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .sj-summary,
  .sj-summary *,
  .sj-card,
  .sj-filter-modal,
  .sj-filter-modal__panel {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* ── Accessibility: focus visible ───────────────────────── */
.sj-filter-trigger:focus-visible,
.sj-filter-modal__pill:focus-visible,
.sj-filter-modal__dot-btn:focus-visible,
.sj-filter-modal__btn-apply:focus-visible,
.sj-filter-modal__btn-reset:focus-visible,
.sj-filter-modal__close:focus-visible,
.sj-card__more:focus-visible,
.sj-summary__load-btn:focus-visible,
.sj-search__input:focus-visible {
  outline: 2px solid #111;
  outline-offset: 2px;
}

/* ── AI Summary block ────────────────────────────────────── */
.sj-summary__ai {
  margin: 16px 0;
  padding: 16px 20px;
  background: linear-gradient(135deg, #f8fafc 0%, #f0f4ff 100%);
  border: 1px solid #e0e7ff;
  border-radius: 8px;
}

.sj-summary__ai-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #4f46e5;
}

.sj-summary__ai-label {
  font-size: 13px;
  font-weight: 600;
  color: #4f46e5;
}

.sj-summary__ai-badge {
  font-size: 10px;
  font-weight: 500;
  background: #e0e7ff;
  color: #4338ca;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.3px;
}

.sj-summary__ai-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
}

.sj-summary__ai-loading {
  color: #9ca3af;
  font-style: italic;
}

.sj-summary__ai-meta {
  margin-top: 8px;
  font-size: 11px;
  color: #9ca3af;
}

/* ═══════════════════════════════════════════════════════════════
   Template 2 — Synthèse compacte (Hotels.com style)
   Preset default : fond transparent, pas de wrapper
   Preset card    : .sj-summary--preset-card — fond + bordure
   ═══════════════════════════════════════════════════════════════ */

.sj-summary--compact {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.sj-summary--preset-card {
  background-color: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 24px;
}

/* Grille principale : colonne score | zone carousel.
   Les valeurs sont pilotées par CSS custom properties,
   permettant aux contrôles Elementor responsive de les
   changer par breakpoint sans toucher ce fichier. */
.sj-rv-wrap {
  display: grid;
  grid-template-columns: var(--rv-left-col, 200px) 1fr;
  gap: var(--rv-wrap-gap, 24px);
  align-items: start;
}

/* ── Zone gauche ─────────────────────────────────── */
.sj-rv-left {
  min-width: 0;       /* empêche l'overflow hors de la colonne grid */
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;   /* contient les sous-scores grids */
}

.sj-rv-section-label {
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  margin: 0 0 8px;
  width: max-content;
}

.sj-rv-score-main {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-bottom: 2px;
}

/* Vert score — override via Elementor selector rv_score_color */
.sj-rv-score-big   { font-size: 40px; font-weight: 500; color: #1a6e3c; line-height: 1; }
.sj-rv-score-denom { font-size: 20px; color: #6b7280; }
.sj-rv-label       { font-size: 15px; font-weight: 500; color: #1a6e3c; margin: 0 0 4px; }

.sj-rv-count {
  font-size: 12px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 0 16px;
}

.sj-rv-info-icon {
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 1px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  flex-shrink: 0;
  cursor: help;
}

/* Sous-scores — always fit inside .sj-rv-left */
.sj-rv-subscores {
  display: flex;
  gap: 12px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Layout variants (classe PHP depuis contrôle widget) */
.sj-rv-subscores--row   { flex-direction: row; flex-wrap: wrap; }
.sj-rv-subscores--col   { flex-direction: column; gap: 8px; }
.sj-rv-subscores--grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sj-rv-subscores--grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

/* En col/grid : chaque sous-score devient une ligne label + valeur */
.sj-rv-subscores--col .sj-rv-sub,
.sj-rv-subscores--grid-2 .sj-rv-sub,
.sj-rv-subscores--grid-3 .sj-rv-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
  min-width: 0;
}
.sj-rv-subscores--col .sj-rv-sub-lbl,
.sj-rv-subscores--grid-2 .sj-rv-sub-lbl,
.sj-rv-subscores--grid-3 .sj-rv-sub-lbl {
  max-width: none;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sj-rv-sub       { text-align: center; }
.sj-rv-sub-val   { font-size: 14px; font-weight: 500; color: #111; flex-shrink: 0; }
.sj-rv-sub-lbl   { font-size: 11px; color: #6b7280; margin-top: 2px; max-width: 60px; line-height: 1.3; }

/* ── Zone droite : carousel de cards ─────────────── */
.sj-rv-right {
  position: relative;
  min-width: 0;
  /* PAS d'overflow:hidden — briserait le scroll natif des cards */
}

/* Off-canvas peek — vrai affichage partiel de la card suivante.
   Principe : les cards sont moins larges que le conteneur, laissant
   --rv-peek-offset px de la card suivante visible dans le scroll.
   La variable est activée par la classe peek sur .sj-rv-right. */

.sj-rv-cards {
  --rv-peek-offset: 0px; /* désactivé par défaut */
}
.sj-rv-right--peek-right .sj-rv-cards,
.sj-rv-right--peek-both .sj-rv-cards {
  --rv-peek-offset: var(--rv-peek-size, 40px);
}
/* Peek gauche : scroll-padding pour que la card précédente reste visible */
.sj-rv-right--peek-left .sj-rv-cards,
.sj-rv-right--peek-both .sj-rv-cards {
  scroll-padding-left: var(--rv-peek-size, 40px);
}
/* Grid mode : jamais de peek */
.sj-rv-cards--grid {
  --rv-peek-offset: 0px;
}

/* Carousel (défaut) */
.sj-rv-cards {
  display: flex;
  gap: var(--rv-cards-gap, 12px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.sj-rv-cards::-webkit-scrollbar { display: none; }

/* Grid mode */
.sj-rv-cards--grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* override par rv_cards_cols via Elementor */
  overflow-x: visible;
  scroll-snap-type: none;
  flex-wrap: wrap;
}
.sj-rv-cards--grid .sj-rv-card {
  flex: none !important;
  width: auto !important;
  scroll-snap-align: none;
}

/* Card individuelle */
.sj-rv-card {
  /* 3 cards par défaut + peek offset : (100% - 2*gap - peek) / 3 */
  flex: 0 0 calc((100% - var(--rv-cards-gap, 12px) * 2 - var(--rv-peek-offset, 0px)) / 3);
  min-width: 180px; /* plancher absolu */
  box-sizing: border-box;
  scroll-snap-align: start;
  border: 0.5px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
}

/* ── Card header : colonne [top: avatar+auteur] + score ─── */
.sj-rv-card-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Ligne avatar + auteur + date */
.sj-rv-card-header__top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

/* Avatar cercle (base commune) */
.sj-rv-card-avatar,
.sj-rv-card-avatar--img img,
.sj-rv-card-avatar--initiale {
  width: 32px;
  height: 32px;
  border-radius: 50%!important;
  flex-shrink: 0;
}

/* Avatar avec image */
.sj-rv-card-avatar--img {
  object-fit: cover;
}

/* Avatar avec initiale (fallback) */
.sj-rv-card-avatar--initiale {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  user-select: none;
}

/* Wrapper auteur + date (colonne) */
.sj-rv-card-author-wrap {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

/* Score dans le header — pleine largeur */
.sj-rv-card-header .sj-rv-card-score {
  flex: 1;
}

.sj-rv-card-score        { font-size: 14px; font-weight: 500; color: #111; }
.sj-rv-card-score .sj-rv-card-label { color: #6b7280; font-weight: 400; }
.sj-rv-card-text         { font-size: 13px; color: #111; line-height: 1.5; flex: 1; }
.sj-rv-voir-plus         { font-size: 13px; font-weight: 500; color: #111; text-decoration: underline; cursor: pointer; }
.sj-rv-divider           { border: none; border-top: 0.5px solid #e5e7eb; margin: 0; }
.sj-rv-card-footer {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.sj-rv-card-author { font-size: 13px; font-weight: 500; color: #111; }
.sj-rv-card-sep    { font-size: 12px; color: #9ca3af; line-height: 1; }
.sj-rv-meta        { font-size: 12px; color: #6b7280; margin: 0; display: flex; align-items: center; gap: 4px; }

/* Icône vérification dans .sj-rv-meta */
.sj-rv-meta-icon {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  color: var(--rv-verified-icon-color, #059669);
}

/* Stars dans les cards compact */
.sj-rv-card-stars {
  color: var(--rv-card-stars-color, #f59e0b);
  display: flex;
  align-items: center;
}
.sj-rv-card-stars .sj-stars svg { width: var(--rv-card-stars-size, 14px); height: var(--rv-card-stars-size, 14px); }

/* ── Zone bas : CTA full-width ───────────────────── */
.sj-rv-bottom {
  display: flex;
  justify-content: center;
  margin-top: 16px;
}

.sj-rv-cta {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid #111;
  background: transparent;
  color: #111;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: background .15s ease;
}
.sj-rv-cta:hover { background: #f3f4f6; }

/* ══════════════════════════════════════════════════════════════
   Modale "Tous les avis" — Template 2 (Hotels.com style)
   Classe racine : .sj-rv-all-modal
   ══════════════════════════════════════════════════════════════ */

/* Overlay fullscreen */
.sj-rv-all-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sj-rv-all-modal[hidden] { display: none; }

/* Panel centré */
.sj-rv-all-modal__panel {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: 88vh;
  margin: 16px;
  background: #fff;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: clip;  /* clip visuel sans bloquer wheel scroll */
  box-shadow: 0 24px 64px rgba(0, 0, 0, .18);
}

/* En-tête sticky */
.sj-rv-all-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 1;
}
.sj-rv-all-modal__title {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  color: #111;
}

/* Filtres par note */
.sj-rv-all-modal__filters {
  padding: 14px 24px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}
.sj-rv-all-modal__filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sj-rv-all-modal__pill {
  padding: 6px 14px!important;
  border: 1.5px solid #e5e7eb!important;
  border-radius: 9999px!important;
  background: #fff!important;
  font-size: 13px!important;
  font-weight: 500!important;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  line-height: 1.4;

}
.sj-rv-all-modal__pill:hover {
  border-color: #111;
  background: #f9fafb;
}
.sj-rv-all-modal__pill--active,
.sj-rv-all-modal__pill[aria-pressed="true"] {
  background: #111!important;
  border-color: #111!important;
  color: #fff !important;
}

/* Liste des avis (scrollable) */
.sj-rv-all-modal__reviews {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
  /* Scrollbar Firefox */
  scrollbar-width: thin;
  scrollbar-color: #d1d5db #f8f8f8;
}

/* Scrollbar WebKit (Chrome, Safari, Edge) */
.sj-rv-all-modal__reviews::-webkit-scrollbar {
  width: 5px;
}
.sj-rv-all-modal__reviews::-webkit-scrollbar-track {
  background: #f8f8f8;
  border-radius: 99px;
}
.sj-rv-all-modal__reviews::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 99px;
  min-height: 10vh;
}
.sj-rv-all-modal__reviews::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* States */
.sj-rv-all-modal__loading,
.sj-rv-all-modal__placeholder,
.sj-rv-all-modal__empty {
  color: #9ca3af;
  font-size: 14px;
  text-align: center;
  padding: 32px 16px;
  margin: 0;
}

/* Pied "Voir plus" */
.sj-rv-all-modal__bottom {
  padding: 14px 24px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}
.sj-rv-all-modal__bottom[hidden] { display: none; }

.sj-rv-all-modal__load-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #111;
  background: #fff;
  border: 2px solid #111;
  border-radius: 9999px;
  padding: 10px 28px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sj-rv-all-modal__load-btn:hover {
  background: #111;
  color: #fff;
}
.sj-rv-all-modal__load-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.sj-rv-all-modal__load-count {
  opacity: .6;
  font-weight: 400;
}

/* Mobile — bottom sheet */
@media (max-width: 600px) {
  .sj-rv-all-modal {
    align-items: flex-end;
  }
  .sj-rv-all-modal__panel {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    margin: 0;
  }
  /* Drag handle */
  .sj-rv-all-modal__panel::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: #d1d5db;
    border-radius: 2px;
    margin: 10px auto 2px;
    flex-shrink: 0;
  }
}

/* ── Slider Swiper (sj-rv-cards__slider-wrap) ──────────────────── */

/* Wrap — position relative pour les flèches absolues */
.sj-rv-cards__slider-wrap {
  position: relative;
}

/* Mode actif : clip le swiper, laisse les flèches déborder */
.sj-rv-cards__slider-wrap--active {
  overflow: hidden;
}
.sj-rv-cards__slider-wrap--active .sj-rv-cards__swiper {
  overflow: visible;
}

/* Masquer flèches/dots en fallback (device non activé) */
.sj-rv-cards__slider-wrap--fallback .sj-rv-cards__arrow,
.sj-rv-cards__slider-wrap--fallback .sj-rv-cards__dots {
  display: none;
}

/* Swiper : les cards pleine hauteur */
.sj-rv-cards__slider-wrap .swiper-slide {
  height: auto;
}
.sj-rv-cards__slider-wrap .sj-rv-card {
  height: 100%;
  flex: unset;
  width: 100%;
  min-width: 0;
  scroll-snap-align: none;
}

/* ── Flèches ──────────────────────────────────────── */
.sj-rv-cards__arrow {
  position: absolute;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  font-size: 18px;
  background: #fff;
  color: #111;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.14);
  transition: background .15s, box-shadow .15s, color .15s;
  padding: 0;
  line-height: 1;
}
.sj-rv-cards__arrow:hover {
  background: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,.2);
}
.sj-rv-cards__arrow svg {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

/* Désactivé (Swiper injecte .swiper-button-disabled) */
.sj-rv-cards__arrow.swiper-button-disabled {
  opacity: .35;
  cursor: default;
  pointer-events: none;
}

/* Flèche Précédent — défaut : ancré à gauche, centré verticalement */
.sj-rv-cards__arrow--prev {
  left:   var(--sj-prev-l, 0px);
  right:  var(--sj-prev-r, auto);
  top:    var(--sj-prev-t, 50%);
  bottom: var(--sj-prev-b, auto);
  transform: translateX(var(--sj-prev-trx, 0px))
             translateX(var(--sj-prev-h-off, -18px))
             translateY(var(--sj-prev-try, -50%))
             translateY(var(--sj-prev-v-off, 0px));
}

/* Flèche Suivant — défaut : ancré à droite, centré verticalement */
.sj-rv-cards__arrow--next {
  left:   var(--sj-next-l, auto);
  right:  var(--sj-next-r, 0px);
  top:    var(--sj-next-t, 50%);
  bottom: var(--sj-next-b, auto);
  transform: translateX(var(--sj-next-trx, 0px))
             translateX(var(--sj-next-h-off, 18px))
             translateY(var(--sj-next-try, -50%))
             translateY(var(--sj-next-v-off, 0px));
}

/* ── Dots / Pagination ────────────────────────────── */
.sj-rv-cards__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.sj-rv-cards__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d1d5db;
  cursor: pointer;
  transition: width .2s ease, background-color .2s ease;
}

.sj-rv-cards__dot--active {
  width: 20px;
  background: #111;
  border-radius: 99px;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 1024px) {
  .sj-rv-wrap {
    /* fallback tablet 180px si Elementor n'a pas de valeur tablet définie */
    grid-template-columns: var(--rv-left-col, 180px) 1fr;
    gap: var(--rv-wrap-gap, 20px);
  }
}

@media (max-width: 767px) {
  /* Empilé : une seule colonne, les deux zones pleine largeur.
     grid-template-columns hardcodé (pas de variable) pour qu'Elementor
     ne puisse pas écraser le stacking mobile via les contrôles desktop. */
  .sj-rv-wrap {
    grid-template-columns: 1fr;
    row-gap: var(--rv-wrap-gap, 16px);
  }
  .sj-rv-left,
  .sj-rv-right {
    width: 100%;
    min-width: 0;
  }
  /* Séparateur sous la zone score — positionné par le gap du wrapper */
  .sj-rv-left {
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
  }
  /* Mobile : 1 card visible par défaut + peek offset */
  .sj-rv-card {
    flex: 0 0 calc(100% - var(--rv-cards-gap, 12px) - var(--rv-peek-offset, 0px));
  }
  .sj-summary--preset-card { padding: 16px; }
}
