/* Container variants — merchant-configurable via section settings.
 * Width + margin live on .fc-reviews-container(--fluid); .fc-reviews-widget
 * only carries font/color so wrapping classes cleanly override each other. */
.fc-reviews-widget { font-family: inherit; color: inherit; }
.fc-reviews-container,
.fc-reviews-container--fluid { box-sizing: border-box; width: 100%; display: block; }
.fc-reviews-container { max-width: 1200px; margin-left: auto; margin-right: auto; }
.fc-reviews-container--fluid { max-width: none; margin-left: 0; margin-right: 0; }

/* Loading */
.fc-reviews-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem;
  color: #9ca3af;
  font-size: 0.875rem;
}

.fc-reviews-loading-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid #e5e7eb;
  border-top-color: #6b7280;
  border-radius: 50%;
  animation: fc-spin 0.6s linear infinite;
}

@keyframes fc-spin {
  to { transform: rotate(360deg); }
}

/* Stars */
.fc-stars {
  display: inline-flex;
  gap: 1px;
}

.fc-star {
  width: 1rem;
  height: 1rem;
}

.fc-star--filled {
  color: #f59e0b;
}

.fc-star--empty {
  color: #d1d5db;
}

/* Summary */
.fc-reviews-summary {
  display: flex;
  gap: 2rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.fc-summary-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 5rem;
}

.fc-average {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
}

.fc-total-count {
  font-size: 0.8125rem;
  color: #6b7280;
}

.fc-summary-right {
  flex: 1;
  min-width: 12rem;
}

/* Distribution */
.fc-distribution {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.fc-dist-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
}

.fc-dist-label {
  width: 3rem;
  text-align: right;
  color: #6b7280;
  flex-shrink: 0;
}

.fc-dist-bar {
  flex: 1;
  height: 0.5rem;
  background: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
}

.fc-dist-fill {
  height: 100%;
  background: #f59e0b;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.fc-dist-count {
  width: 1.5rem;
  text-align: right;
  color: #6b7280;
  flex-shrink: 0;
}

/* Reviews list */
.fc-reviews-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fc-review {
  padding: 1rem 0;
  border-bottom: 1px solid #f3f4f6;
}

.fc-review:last-child {
  border-bottom: none;
}

.fc-review-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.375rem;
}

.fc-verified {
  font-size: 0.75rem;
  color: #059669;
  font-weight: 500;
}

.fc-review-title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
}

.fc-review-body {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #374151;
  margin: 0 0 0.5rem;
  white-space: pre-line;
}

.fc-review-footer {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: #9ca3af;
}

.fc-reviewer {
  font-weight: 500;
  color: #6b7280;
}

/* Empty state */
.fc-reviews-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: #9ca3af;
}

.fc-empty-stars {
  display: inline-flex;
  gap: 2px;
  margin-bottom: 0.75rem;
}

.fc-empty-stars .fc-star {
  width: 1.25rem;
  height: 1.25rem;
}

.fc-empty-title {
  font-size: 1rem;
  font-weight: 600;
  color: #6b7280;
  margin: 0 0 0.375rem;
}

.fc-empty-text {
  font-size: 0.875rem;
  color: #9ca3af;
  margin: 0;
}

/* Pagination */
.fc-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0;
  margin-top: 0.5rem;
}

.fc-page-btn {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 0.375rem;
  cursor: pointer;
  color: inherit;
  transition: background 0.15s, border-color 0.15s;
}

.fc-page-btn:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.fc-page-info {
  font-size: 0.8125rem;
  color: #6b7280;
}

/* ===== Carousel Layout ===== */
.fc-layout-carousel {
  position: relative;
}

.fc-carousel-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 0.25rem 0;
}

.fc-carousel-track::-webkit-scrollbar {
  display: none;
}

.fc-carousel-slide {
  flex: 0 0 calc(33.333% - 0.667rem);
  scroll-snap-align: start;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1.25rem;
  background: #fff;
}

.fc-carousel-slide .fc-review {
  padding: 0;
  border-bottom: none;
}

.fc-carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  border: 1px solid #d1d5db;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  color: #374151;
  transition: background 0.15s, border-color 0.15s;
  z-index: 2;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.fc-carousel-nav:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.fc-carousel-nav--prev {
  left: -1rem;
}

.fc-carousel-nav--next {
  right: -1rem;
}

.fc-carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.375rem;
  padding: 1rem 0 0;
}

.fc-carousel-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #d1d5db;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s;
}

.fc-carousel-dot--active {
  background: #6b7280;
}

@media (max-width: 768px) {
  .fc-carousel-slide {
    flex: 0 0 calc(50% - 0.5rem);
  }
}

@media (max-width: 480px) {
  .fc-carousel-slide {
    flex: 0 0 100%;
  }
}

/* ===== Grid Layout ===== */
.fc-grid {
  display: grid;
  grid-template-columns: repeat(var(--fc-grid-cols, 3), 1fr);
  gap: 1rem;
}

.fc-grid-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1.25rem;
  background: #fff;
}

.fc-grid-card .fc-review {
  padding: 0;
  border-bottom: none;
}

@media (max-width: 768px) {
  .fc-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .fc-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Masonry Layout ===== */
.fc-masonry {
  columns: var(--fc-masonry-cols, 3);
  column-gap: 1rem;
}

.fc-masonry-card {
  break-inside: avoid;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  background: #fff;
}

.fc-masonry-card .fc-review {
  padding: 0;
  border-bottom: none;
}

@media (max-width: 768px) {
  .fc-masonry {
    columns: 2;
  }
}

@media (max-width: 480px) {
  .fc-masonry {
    columns: 1;
  }
}

/* ===== Dark mode (class-based) ===== */
/* Applied via .fc-theme-dark class when theme_mode is "dark",
   or via prefers-color-scheme when theme_mode is "auto" */

.fc-theme-dark {
  color: #f3f4f6;
}

.fc-theme-dark .fc-star--empty {
  color: #4b5563;
}

.fc-theme-dark .fc-reviews-summary {
  border-bottom-color: #374151;
}

.fc-theme-dark .fc-average {
  color: #f9fafb;
}

.fc-theme-dark .fc-total-count,
.fc-theme-dark .fc-dist-label,
.fc-theme-dark .fc-dist-count,
.fc-theme-dark .fc-reviewer,
.fc-theme-dark .fc-page-info {
  color: #9ca3af;
}

.fc-theme-dark .fc-dist-bar {
  background: #374151;
}

.fc-theme-dark .fc-review {
  border-bottom-color: #374151;
}

.fc-theme-dark .fc-review-title {
  color: #f3f4f6;
}

.fc-theme-dark .fc-review-body {
  color: #d1d5db;
}

.fc-theme-dark .fc-review-footer {
  color: #6b7280;
}

.fc-theme-dark .fc-verified {
  color: #34d399;
}

.fc-theme-dark .fc-page-btn {
  background: #1f2937;
  border-color: #4b5563;
  color: #d1d5db;
}

.fc-theme-dark .fc-page-btn:hover {
  background: #374151;
}

.fc-theme-dark .fc-empty-title {
  color: #d1d5db;
}

.fc-theme-dark .fc-empty-text {
  color: #6b7280;
}

.fc-theme-dark .fc-reviews-loading {
  color: #6b7280;
}

.fc-theme-dark .fc-reviews-loading-spinner {
  border-color: #374151;
  border-top-color: #9ca3af;
}

.fc-theme-dark .fc-carousel-slide,
.fc-theme-dark .fc-grid-card,
.fc-theme-dark .fc-masonry-card {
  background: #1f2937;
  border-color: #374151;
}

.fc-theme-dark .fc-carousel-nav {
  background: #1f2937;
  border-color: #4b5563;
  color: #d1d5db;
}

.fc-theme-dark .fc-carousel-nav:hover {
  background: #374151;
}

.fc-theme-dark .fc-carousel-dot {
  background: #4b5563;
}

.fc-theme-dark .fc-carousel-dot--active {
  background: #9ca3af;
}

/* Auto mode — OS preference fallback */
@media (prefers-color-scheme: dark) {
  .fc-theme-auto {
    color: #f3f4f6;
  }

  .fc-theme-auto .fc-star--empty {
    color: #4b5563;
  }

  .fc-theme-auto .fc-reviews-summary {
    border-bottom-color: #374151;
  }

  .fc-theme-auto .fc-average {
    color: #f9fafb;
  }

  .fc-theme-auto .fc-total-count,
  .fc-theme-auto .fc-dist-label,
  .fc-theme-auto .fc-dist-count,
  .fc-theme-auto .fc-reviewer,
  .fc-theme-auto .fc-page-info {
    color: #9ca3af;
  }

  .fc-theme-auto .fc-dist-bar {
    background: #374151;
  }

  .fc-theme-auto .fc-review {
    border-bottom-color: #374151;
  }

  .fc-theme-auto .fc-review-title {
    color: #f3f4f6;
  }

  .fc-theme-auto .fc-review-body {
    color: #d1d5db;
  }

  .fc-theme-auto .fc-review-footer {
    color: #6b7280;
  }

  .fc-theme-auto .fc-verified {
    color: #34d399;
  }

  .fc-theme-auto .fc-page-btn {
    background: #1f2937;
    border-color: #4b5563;
    color: #d1d5db;
  }

  .fc-theme-auto .fc-page-btn:hover {
    background: #374151;
  }

  .fc-theme-auto .fc-empty-title {
    color: #d1d5db;
  }

  .fc-theme-auto .fc-empty-text {
    color: #6b7280;
  }

  .fc-theme-auto .fc-reviews-loading {
    color: #6b7280;
  }

  .fc-theme-auto .fc-reviews-loading-spinner {
    border-color: #374151;
    border-top-color: #9ca3af;
  }

  .fc-theme-auto .fc-carousel-slide,
  .fc-theme-auto .fc-grid-card,
  .fc-theme-auto .fc-masonry-card {
    background: #1f2937;
    border-color: #374151;
  }

  .fc-theme-auto .fc-carousel-nav {
    background: #1f2937;
    border-color: #4b5563;
    color: #d1d5db;
  }

  .fc-theme-auto .fc-carousel-nav:hover {
    background: #374151;
  }

  .fc-theme-auto .fc-carousel-dot {
    background: #4b5563;
  }

  .fc-theme-auto .fc-carousel-dot--active {
    background: #9ca3af;
  }
}

/* Review submission form */
.fc-review-form { display: flex; flex-direction: column; gap: 1rem; font-family: inherit; color: inherit; }
.fc-review-form__heading { font-size: 1.25rem; font-weight: 600; margin: 0 0 0.25rem; color: inherit; }
.fc-review-form__intro { font-size: 0.9rem; opacity: 0.75; margin: 0 0 1rem; }
.fc-review-form__alert { padding: 0.75rem 1rem; border-radius: 0.375rem; font-size: 0.9rem; margin-bottom: 1rem; }
.fc-review-form__alert--success { background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.3); color: #047857; }
.fc-review-form__alert--error { background: rgba(220, 38, 38, 0.1); border: 1px solid rgba(220, 38, 38, 0.3); color: #b91c1c; }
.fc-review-form__row { display: flex; flex-direction: column; gap: 0.35rem; }
.fc-review-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 640px) { .fc-review-form__grid { grid-template-columns: 1fr; } }
.fc-review-form__label { font-size: 0.875rem; font-weight: 600; opacity: 0.9; }
.fc-review-form__hint { font-size: 0.75rem; opacity: 0.6; }
.fc-review-form__input { padding: 0.55rem 0.75rem; border: 1px solid rgba(128, 128, 128, 0.35); border-radius: 0.375rem; font-size: 0.95rem; font-family: inherit; color: inherit; background: transparent; }
.fc-review-form__input:focus { outline: 2px solid currentColor; outline-offset: 1px; }
.fc-review-form__stars { display: inline-flex; gap: 0.25rem; align-items: center; }
.fc-review-form__star { background: transparent; border: 0; padding: 0.125rem; cursor: pointer; color: rgba(128, 128, 128, 0.45); transition: color 0.12s, transform 0.12s; line-height: 0; }
.fc-review-form__star:hover { transform: scale(1.1); }
.fc-review-form__star--filled { color: #f59e0b; }
.fc-review-form__submit { align-self: flex-start; padding: 0.75rem 1.5rem; background: #111827; color: #ffffff; border: 0; border-radius: 0.375rem; font-family: inherit; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: background-color 0.15s, opacity 0.15s; }
.fc-review-form__submit:hover { background: #1f2937; }
.fc-review-form__submit:disabled { opacity: 0.55; cursor: wait; }

/*
 * Honeypot container. Positioned off-screen rather than display:none so that
 * headless-browser bots that skip display:none fields still see it and fill it.
 */
.fc-reviews-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }

/* Collapsible disclosure variant (native <details>) */
.fc-review-form__disclosure { border: 1px solid rgba(128, 128, 128, 0.25); border-radius: 0.5rem; overflow: hidden; background: rgba(128, 128, 128, 0.04); }
.fc-review-form__disclosure-trigger { cursor: pointer; list-style: none; padding: 1rem 1.25rem; display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 1rem; color: inherit; user-select: none; }
.fc-review-form__disclosure-trigger::-webkit-details-marker { display: none; }
.fc-review-form__disclosure-trigger:hover { background: rgba(128, 128, 128, 0.06); }
.fc-review-form__disclosure[open] .fc-review-form__disclosure-trigger { border-bottom: 1px solid rgba(128, 128, 128, 0.2); }
.fc-review-form__disclosure-chevron { transition: transform 0.15s ease; opacity: 0.7; }
.fc-review-form__disclosure[open] .fc-review-form__disclosure-chevron { transform: rotate(180deg); }
.fc-review-form__disclosure-body { padding: 1.25rem; background: transparent; }

/* Modal variant (native <dialog>) */
.fc-review-form__trigger-wrap { display: flex; justify-content: flex-start; }
.fc-review-form__trigger-wrap--left { justify-content: flex-start; }
.fc-review-form__trigger-wrap--center { justify-content: center; }
.fc-review-form__trigger-wrap--right { justify-content: flex-end; }
.fc-review-form__trigger { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1.25rem; background: transparent; color: inherit; border: 1px solid currentColor; border-radius: 0.375rem; font-family: inherit; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: background-color 0.15s, opacity 0.15s; }
.fc-review-form__trigger:hover { background: rgba(128, 128, 128, 0.08); }
.fc-review-form__modal { border: 0; border-radius: 0.5rem; padding: 0; max-width: 560px; width: calc(100% - 2rem); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2); color: inherit; background: #ffffff; }
.fc-review-form__modal::backdrop { background: rgba(0, 0, 0, 0.55); }
.fc-review-form__modal-inner { padding: 1.5rem; }
.fc-review-form__modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.fc-review-form__modal-close { background: transparent; border: 0; font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0.25rem 0.5rem; border-radius: 0.25rem; color: inherit; opacity: 0.6; }
.fc-review-form__modal-close:hover { background: rgba(0, 0, 0, 0.06); opacity: 1; }
