/* ═══════════════════════════════════════════════════════════════════
   Product Page Styles
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Two-column layout ──────────────────────────────────────────── */
.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  align-items: start;
}

@media (max-width: 768px) {
  .product-layout {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
}

/* ─── Image Gallery ──────────────────────────────────────────────── */
.product-gallery__main {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.product-gallery__main img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0;
}

.product-gallery__thumbs {
  display: flex;
  gap: var(--space-xs);
  overflow-x: auto;
}

.product-gallery__thumb {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: none;
  padding: 0;
  transition: border-color 0.2s ease;
}

.product-gallery__thumb.is-active,
.product-gallery__thumb:hover {
  border-color: var(--color-brand);
}

.product-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

/* ─── Product Info ───────────────────────────────────────────────── */
.product-info__title {
  font-size: var(--text-3xl);
  margin-bottom: var(--space-xs);
}

.product-info__price {
  font-size: var(--text-2xl);
  font-weight: var(--font-extrabold);
  color: var(--color-brand);
  margin-bottom: var(--space-md);
}

.product-info__trust {
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
  font-size: var(--text-sm);
  color: var(--color-meta);
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.product-info__hook {
  margin-bottom: var(--space-md);
  font-size: var(--text-lg);
  line-height: 1.6;
}

/* ─── Variant Selectors ──────────────────────────────────────────── */
.product-info__variant {
  margin-bottom: var(--space-md);
}

.product-info__variant label {
  display: block;
  font-weight: var(--font-bold);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: var(--space-xs);
  color: var(--color-brand);
}

.product-info__variant select {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-family);
  font-size: var(--text-base);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-btn);
  background: var(--color-bg);
  color: var(--color-brand);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23212121' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.product-info__variant select:focus {
  outline: none;
  border-color: var(--color-brand);
}

/* ─── Full-width button ──────────────────────────────────────────── */
.btn--full {
  width: 100%;
  margin-bottom: var(--space-lg);
}

/* ─── Product Tabs ───────────────────────────────────────────────── */
.product-tabs {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
}

.product-tabs__nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--color-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.product-tabs__btn {
  background: none;
  border: none;
  padding: var(--space-sm) var(--space-md);
  font-family: var(--font-family);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-meta);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.product-tabs__btn:hover {
  color: var(--color-brand);
}

.product-tabs__btn.is-active {
  color: var(--color-brand);
  border-bottom-color: var(--color-brand);
}

.product-tab {
  display: none;
  padding: var(--space-md) 0;
  line-height: 1.7;
}

.product-tab.is-active {
  display: block;
}

/* ─── Reviews ────────────────────────────────────────────────────── */
.review-card {
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
}

.review-card__stars {
  color: #f5a623;
  font-size: var(--text-lg);
  margin-bottom: var(--space-xs);
}

.review-card__body {
  margin-bottom: var(--space-xs);
}

.review-card__author {
  font-size: var(--text-sm);
  color: var(--color-meta);
  font-weight: var(--font-semibold);
}

/* ─── Collection Intro ───────────────────────────────────────────── */
.collection-intro {
  max-width: 65ch;
  margin-bottom: var(--space-lg);
  font-size: var(--text-lg);
  line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════════════════
   REVIEWS ENGINE CSS — Append to apps/api/public/css/product.css
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Reviews Header ─────────────────────────────────────────────── */
.reviews-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.reviews-header h2 {
  margin: 0;
}

.reviews-summary {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.reviews-summary__stars {
  display: flex;
  gap: 2px;
}

.reviews-summary__count {
  font-size: var(--text-sm);
  color: var(--color-meta);
}

.star {
  font-size: 1.25rem;
  line-height: 1;
}

.star--full {
  color: #f5a623;
}

.star--empty {
  color: #ddd;
}

/* ─── Review Form ────────────────────────────────────────────────── */
.review-form-wrap {
  background: var(--color-bg);
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
  padding: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.review-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

@media (max-width: 600px) {
  .review-form__row {
    grid-template-columns: 1fr;
  }
}

.review-form__field {
  margin-bottom: var(--space-md);
}

.review-form__field label {
  display: block;
  font-weight: var(--font-semibold);
  margin-bottom: var(--space-xs);
  font-size: var(--text-sm);
}

.review-form__field .required {
  color: var(--color-accent, #f44336);
}

.review-form__field small {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--color-meta);
}

.review-form__field input,
.review-form__field textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: var(--radius-sm, 8px);
  font-family: inherit;
  font-size: var(--text-base, 1rem);
  transition: border-color 0.2s ease;
  background: #fff;
}

.review-form__field input:focus,
.review-form__field textarea:focus {
  outline: none;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(33, 33, 33, 0.1);
}

.review-form__field textarea {
  resize: vertical;
  min-height: 100px;
}

/* ─── Star Picker ────────────────────────────────────────────────── */
.star-picker {
  display: flex;
  gap: 4px;
}

.star-picker__star {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 2rem;
  color: #ddd;
  padding: 0;
  line-height: 1;
  transition: color 0.15s ease, transform 0.15s ease;
}

.star-picker__star:hover,
.star-picker__star.is-hovered {
  color: #f5a623;
  transform: scale(1.15);
}

.star-picker__star.is-selected {
  color: #f5a623;
}

/* ─── Review Form Actions ────────────────────────────────────────── */
.review-form__actions {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.btn--sm {
  padding: 0.5rem 1rem;
  font-size: var(--text-sm);
}

.btn--ghost {
  background: transparent;
  color: var(--color-meta);
  border: none;
  cursor: pointer;
  padding: 0.5rem 1rem;
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
}

.btn--ghost:hover {
  color: var(--color-brand);
}

/* ─── Review Form Message ────────────────────────────────────────── */
.review-form__message {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm, 8px);
  font-size: var(--text-sm);
}

.review-form__message--success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.review-form__message--error {
  background: #fbe9e7;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

/* ─── Review Cards ───────────────────────────────────────────────── */
.review-card {
  background: var(--color-bg);
  border-radius: var(--radius-sm, 8px);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-md);
  border: 1px solid #eee;
}

.review-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.review-card__stars {
  display: flex;
  gap: 2px;
}

.review-card__badge {
  font-size: 0.75rem;
  color: #2e7d32;
  font-weight: var(--font-semibold);
  background: #e8f5e9;
  padding: 2px 8px;
  border-radius: 12px;
}

.review-card__headline {
  font-size: var(--text-base, 1rem);
  font-weight: var(--font-bold, 700);
  margin: var(--space-xs) 0;
}

.review-card__body {
  margin-bottom: var(--space-sm);
  line-height: 1.6;
  color: var(--color-text);
}

.review-card__meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--text-sm);
  color: var(--color-meta);
}

.review-card__author {
  font-weight: var(--font-semibold);
}

.review-card__dog {
  font-style: italic;
}

.reviews-empty {
  text-align: center;
  color: var(--color-meta);
  padding: var(--space-xl) 0;
  font-size: var(--text-lg);
}
