/* =============================================
   SHOP'N MAX — AVIS & COMPARATEUR CSS
============================================= */

/* ===== AVIS DANS LA MODAL ===== */
.reviews-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
}
.reviews-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.reviews-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--brown-dark);
}
.reviews-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .9rem;
  color: var(--text-light);
}
.reviews-summary.no-reviews { font-size: .82rem; font-style: italic; }

.reviews-list { max-height: 280px; overflow-y: auto; margin-bottom: 16px; }
.no-reviews-msg { font-size: .85rem; color: var(--text-light); text-align: center; padding: 16px 0; }

.review-item {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.review-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.review-top strong { font-size: .88rem; color: var(--brown-dark); }
.review-comment { font-size: .85rem; color: var(--text); line-height: 1.6; margin-bottom: 6px; }
.review-date { font-size: .72rem; color: var(--text-light); }

.btn-write-review {
  width: 100%;
  background: var(--cream);
  border: 2px solid var(--border);
  color: var(--brown-dark);
  padding: 12px;
  border-radius: 50px;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--trans);
  font-family: 'Montserrat', sans-serif;
}
.btn-write-review:hover { border-color: var(--orange); color: var(--orange); }

.review-form {
  margin-top: 16px;
  padding: 16px;
  background: var(--cream);
  border-radius: var(--radius);
}
.review-form-row { margin-bottom: 14px; }
.review-form-row label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  color: var(--brown-dark);
  margin-bottom: 6px;
}
.review-form-row input,
.review-form-row textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Montserrat', sans-serif;
  font-size: .85rem;
  background: white;
  outline: none;
  resize: vertical;
}
.review-form-row input:focus,
.review-form-row textarea:focus { border-color: var(--orange); }

.star-picker { display: flex; gap: 4px; }
.star-pick {
  font-size: 1.6rem;
  color: var(--border);
  cursor: pointer;
  transition: var(--trans);
}
.star-pick.active { color: #f39c12; }

.btn-submit-review {
  width: 100%;
  background: var(--orange);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 50px;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--trans);
  font-family: 'Montserrat', sans-serif;
}
.btn-submit-review:hover { background: var(--orange-dark); }

/* Badge note sur les cartes produits */
.card-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--text-light);
  margin-bottom: 8px;
}
.card-rating span { font-weight: 700; color: var(--brown-dark); }

/* ===== BOUTON COMPARER SUR LES CARTES ===== */
.btn-compare {
  display: block;
  width: 100%;
  background: var(--cream);
  color: var(--text-light);
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 50px;
  font-size: .78rem;
  cursor: pointer;
  transition: var(--trans);
  white-space: nowrap;
  margin-top: 10px;
  text-align: center;
  font-family: 'Montserrat', sans-serif;
}
.btn-compare:hover { border-color: var(--orange); color: var(--orange); }
.btn-compare.active {
  background: var(--orange);
  color: white;
  border-color: var(--orange);
}

/* ===== BARRE DE COMPARAISON FLOTTANTE ===== */
#compare-bar {
  position: fixed;
  bottom: -150px;
  left: 50%;
  transform: translateX(-50%);
  background: white;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -8px 32px rgba(0,0,0,.2);
  z-index: 9000;
  width: 100%;
  max-width: 700px;
  transition: bottom .35s ease;
  border: 2px solid var(--orange);
  border-bottom: none;
}
#compare-bar.show { bottom: 0; }

.compare-bar-inner {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.compare-bar-items { display: flex; gap: 10px; }
.compare-bar-item {
  position: relative;
  width: 56px; height: 56px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--cream);
  border: 2px solid var(--border);
}
.compare-bar-item img { width: 100%; height: 100%; object-fit: cover; }
.compare-bar-remove {
  position: absolute; top: -6px; right: -6px;
  background: #c0392b; color: white;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: none;
  font-size: .65rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.compare-bar-empty {
  width: 56px; height: 56px;
  border-radius: var(--radius);
  border: 2px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--border);
  font-size: 1.2rem;
}

.compare-bar-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.compare-bar-count { font-size: .8rem; color: var(--text-light); white-space: nowrap; }
.btn-compare-view {
  background: var(--orange);
  color: white;
  border: none;
  padding: 10px 22px;
  border-radius: 50px;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--trans);
  white-space: nowrap;
}
.btn-compare-view:hover { background: var(--orange-dark); }
.btn-compare-view:disabled { opacity: .5; cursor: not-allowed; }
.compare-bar-clear {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: .78rem;
  cursor: pointer;
  text-decoration: underline;
  white-space: nowrap;
}

/* ===== MODAL COMPARATEUR ===== */
.compare-modal {
  display: none;
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: var(--radius-lg);
  z-index: 2001;
  width: 95%;
  max-width: 1100px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0,0,0,.3);
  padding: 32px;
}
.compare-modal.open { display: block; }
.compare-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--brown-dark);
  margin-bottom: 20px;
  text-align: center;
}

.compare-table-wrap { overflow-x: auto; }
.compare-table { width: 100%; border-collapse: collapse; }
.compare-table th, .compare-table td {
  padding: 14px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  min-width: 180px;
}
.compare-label-col {
  text-align: left !important;
  font-weight: 700;
  color: var(--brown-dark);
  background: var(--cream);
  min-width: 130px !important;
  position: sticky;
  left: 0;
}
.compare-prod-img {
  width: 100px; height: 100px;
  margin: 0 auto 10px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--cream);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.compare-prod-img img { width: 100%; height: 100%; object-fit: cover; }
.compare-prod-name {
  font-family: 'Playfair Display', serif;
  font-size: .9rem;
  color: var(--brown-dark);
  line-height: 1.3;
}
.compare-price { font-weight: 700; color: var(--orange); font-size: 1rem; }
.compare-old-price { text-decoration: line-through; color: var(--text-light); font-size: .8rem; display: block; }
.compare-discount {
  background: rgba(192,57,43,.1); color: #c0392b;
  padding: 2px 10px; border-radius: 20px; font-size: .78rem; font-weight: 700;
}
.compare-desc { font-size: .78rem; color: var(--text-light); text-align: left !important; line-height: 1.6; }
.compare-tag {
  display: inline-block;
  background: var(--cream);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .72rem;
  margin: 2px;
}

@media (max-width: 768px) {
  .compare-modal { padding: 20px 16px; }
  .compare-table th, .compare-table td { padding: 10px 12px; min-width: 140px; }
  #compare-bar { width: 100%; border-radius: 0; }
  .compare-bar-inner { flex-direction: column; align-items: stretch; }
  .compare-bar-actions { justify-content: space-between; }
}