/* Perfect Color — Sharhlar (Apple + Instagram uslubi) */

.reviews-page {
  padding: calc(var(--header-height) + var(--space-2xl)) 0 var(--space-4xl);
  min-height: 60vh;
}

.reviews-page__title {
  font-size: clamp(1.5rem, 4vw, var(--text-2xl));
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: var(--space-sm);
}

.reviews-page__sub {
  color: var(--color-text-soft);
  margin-bottom: var(--space-xl);
  line-height: 1.5;
}

/* Apple-style tabs */
.reviews-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-xl);
  padding: 4px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: 980px;
  width: fit-content;
}

.reviews-tab {
  padding: 10px 20px;
  border: 0;
  border-radius: 980px;
  background: transparent;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-soft);
  cursor: pointer;
  transition: background 0.25s var(--ease-spring), color 0.2s var(--ease), box-shadow 0.25s var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
}

.reviews-tab:hover {
  color: var(--color-text);
}

.reviews-tab.active {
  background: var(--color-white);
  color: var(--color-text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}

.reviews-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: var(--space-xl);
  align-items: start;
}

@media (max-width: 900px) {
  .reviews-layout {
    grid-template-columns: 1fr;
  }
}

.reviews-form-card,
.reviews-list-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-2xl);
  padding: var(--space-xl);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
  border: none;
}

.reviews-form-card h2,
.reviews-list-card h2,
.product-reviews-wrap h2 {
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
}

.reviews-form__user {
  font-size: var(--text-sm);
  color: var(--color-text-soft);
  margin-bottom: var(--space-md);
}

.reviews-form-card label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.reviews-form-card select,
.reviews-form-card input[type="text"],
.reviews-form-card textarea {
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: var(--radius-lg);
  font: inherit;
  margin-bottom: var(--space-md);
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.04);
  transition: background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.reviews-form-card select:focus,
.reviews-form-card input[type="text"]:focus,
.reviews-form-card textarea:focus {
  outline: none;
  background: var(--color-white);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.25);
}

.reviews-form-card textarea {
  min-height: 120px;
  resize: vertical;
}

.reviews-stars-input {
  display: flex;
  gap: 4px;
  margin-bottom: var(--space-md);
}

.reviews-stars-input button {
  border: 0;
  background: none;
  font-size: 1.65rem;
  line-height: 1;
  cursor: pointer;
  color: #d1d1d6;
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius);
  transition: transform 0.2s var(--ease-spring), color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.reviews-stars-input button.is-active,
.reviews-stars-input button:hover {
  color: #ffb800;
  transform: scale(1.08);
}

.reviews-photo-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

/* Instagram / Facebook uslubida rasm yuklash */
.reviews-media-field {
  margin-bottom: var(--space-md);
}

.reviews-media-field__label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}

.reviews-media-picker {
  padding: 12px;
  border-radius: var(--radius-xl);
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.reviews-media-picker--drag {
  border-color: #0095f6;
  background: rgba(0, 149, 246, 0.06);
}

.reviews-media-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

.reviews-media-add,
.reviews-media-thumb {
  width: 92px;
  height: 92px;
  border-radius: 14px;
  flex-shrink: 0;
}

.reviews-media-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 2px dashed #c7c7cc;
  background: #fff;
  color: #0095f6;
  cursor: pointer;
  padding: 0;
  font: inherit;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.15s var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
}

.reviews-media-add:hover {
  border-color: #0095f6;
  background: rgba(0, 149, 246, 0.04);
}

.reviews-media-add:active {
  transform: scale(0.96);
}

.reviews-media-add__icon {
  display: flex;
  line-height: 0;
  opacity: 0.85;
}

.reviews-media-add__text {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.reviews-media-thumb {
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  background: #000;
}

.reviews-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.reviews-media-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.15s var(--ease), transform 0.15s var(--ease-spring);
}

.reviews-media-remove:hover {
  background: rgba(0, 0, 0, 0.85);
}

.reviews-media-remove:active {
  transform: scale(0.9);
}

.reviews-media-hint {
  margin: 10px 0 0;
  font-size: var(--text-xs);
  color: var(--color-text-soft);
  text-align: center;
}

.reviews-media-hint span {
  font-weight: 600;
  color: var(--color-text);
}

.reviews-photo-preview {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.reviews-photo-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
}

.reviews-guest {
  text-align: center;
  padding: var(--space-xl);
  color: var(--color-text-soft);
}

.reviews-stats {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-xl);
}

.reviews-stats__score {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
  letter-spacing: -0.03em;
}

.reviews-stats__meta {
  font-size: var(--text-sm);
  color: var(--color-text-soft);
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Instagram-style post card + Apple glass */
.review-item,
.review-thread {
  display: flex;
  gap: 12px;
  padding: 16px;
  background: var(--color-white);
  border-radius: var(--radius-2xl);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
  margin-bottom: 0;
  border: none;
}

.review-item__avatar,
.review-reply__avatar,
.review-avatar {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.25);
}

.review-avatar--sm {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
  box-shadow: none;
}

.review-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.review-author-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: -0.01em;
}

.review-author-name .pc-verified-badge {
  flex-shrink: 0;
  margin-top: 1px;
  overflow: visible;
  min-width: 16px;
  min-height: 16px;
}

.review-item__main,
.review-reply__main {
  flex: 1;
  min-width: 0;
}

.review-item__head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  align-items: flex-start;
  margin-bottom: 6px;
}

.review-item__author {
  font-weight: 600;
  font-size: var(--text-sm);
  letter-spacing: -0.01em;
}

.review-item__meta {
  font-size: var(--text-xs);
  color: var(--color-text-soft);
  margin-top: 2px;
}

.review-item__stars {
  color: #ffb800;
  font-size: var(--text-sm);
  letter-spacing: 1px;
}

.review-item__title {
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.review-item__body {
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--color-text);
  white-space: pre-wrap;
}

.review-item__photos {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: var(--space-md);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.review-item__photos a {
  display: block;
  flex: 1 1 88px;
  max-width: 120px;
}

.review-item__photos img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.review-item__photos img:hover {
  opacity: 0.92;
}

/* Instagram action row */
.review-engage {
  margin-top: 10px;
}

.review-engage__row {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 -6px;
}

.review-engage-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #262626;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), opacity 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.review-engage-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.review-engage-btn:active {
  transform: scale(0.88);
}

.review-engage-btn--sm {
  width: 36px;
  height: 36px;
}

.review-engage-btn--sm .review-icon {
  width: 20px;
  height: 20px;
}

.review-icon {
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

.review-icon--heart path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  transition: fill 0.25s var(--ease-spring), stroke 0.25s var(--ease-spring);
}

.review-icon--heart.is-filled path,
.review-engage-btn--like.is-liked .review-icon--heart path {
  fill: #ed4956;
  stroke: #ed4956;
}

.review-engage-btn--like.is-liked {
  color: #ed4956;
}

.review-engage-btn--like.is-pop {
  animation: reviewHeartPop 0.45s var(--ease-spring);
}

@keyframes reviewHeartPop {
  0% { transform: scale(1); }
  20% { transform: scale(1.35); }
  45% { transform: scale(0.9); }
  70% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.review-icon--comment path {
  fill: none;
}

.review-engage__meta {
  margin-top: 6px;
  padding-left: 2px;
}

.review-engage__likes {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.review-engage--compact {
  margin-top: 4px;
}

.review-engage--compact .review-engage__row {
  margin: 0 -4px;
}

/* Thread replies — inline */
.review-thread__replies {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 0.5px solid rgba(0, 0, 0, 0.08);
}

.review-reply {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  margin-left: calc(var(--reply-depth, 0) * 12px);
}

.review-reply__avatar {
  width: 32px;
  height: 32px;
  font-size: 0.7rem;
  box-shadow: none;
}

.review-reply__head .review-author-name {
  font-size: var(--text-sm);
}

.review-reply__head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  margin-bottom: 2px;
}

.review-reply__author {
  font-weight: 600;
  font-size: var(--text-sm);
}

.review-reply__time {
  font-size: var(--text-xs);
  color: var(--color-text-soft);
}

.review-reply__body {
  font-size: var(--text-sm);
  line-height: 1.5;
  white-space: pre-wrap;
  margin-bottom: 2px;
}

.review-reply--brand {
  margin-left: 0;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
  border: 1px solid #bfdbfe;
}

.review-reply--brand .review-avatar {
  background: #0095f6;
  color: #fff;
}

.review-reply__brand-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1e40af;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #93c5fd;
}

/* Apple-style reply composer */
.review-reply-form {
  margin-top: var(--space-sm);
  padding: var(--space-md);
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-xl);
  border: none;
}

.review-reply-form__input {
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: var(--radius-lg);
  font: inherit;
  font-size: var(--text-sm);
  resize: vertical;
  min-height: 52px;
  box-sizing: border-box;
  margin-bottom: var(--space-sm);
  background: var(--color-white);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.2s var(--ease);
}

.review-reply-form__input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.22);
}

.review-reply-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Apple-style buttons */
.review-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 980px;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring), background 0.2s, opacity 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.review-btn:active {
  transform: scale(0.97);
}

.review-btn--primary {
  background: var(--color-accent);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 113, 227, 0.35);
}

.review-btn--primary:hover {
  background: var(--color-accent-hover);
}

.review-btn--ghost {
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-text);
}

.review-btn--ghost:hover {
  background: rgba(0, 0, 0, 0.08);
}

.review-btn--block {
  width: 100%;
}

.review-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

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

.reviews-msg {
  font-size: var(--text-sm);
  margin-top: var(--space-sm);
}

.reviews-msg--ok { color: #248a3d; }
.reviews-msg--err { color: #c41e12; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.product-reviews-wrap {
  margin-top: var(--space-3xl);
  padding-top: var(--space-2xl);
  border-top: 0.5px solid rgba(0, 0, 0, 0.08);
  grid-column: 1 / -1;
}

.product-reviews-sub {
  color: var(--color-text-soft);
  margin: calc(var(--space-sm) * -1) 0 var(--space-lg);
  line-height: 1.5;
}

.reviews-form-note {
  color: var(--color-text-soft);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-md);
  line-height: 1.45;
}

.product-reviews-wrap .reviews-layout {
  grid-template-columns: minmax(280px, 360px) 1fr;
}

@media (max-width: 900px) {
  .product-reviews-wrap .reviews-layout {
    grid-template-columns: 1fr;
  }
}

.product-reviews-wrap .reviews-form-card {
  max-width: none;
}

@media (max-width: 640px) {
  .reviews-page {
    padding-top: calc(var(--header-height-mobile) + var(--space-xl));
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .reviews-form-card,
  .reviews-list-card {
    padding: var(--space-lg);
    border-radius: var(--radius-xl);
  }

  .review-item {
    padding: 14px;
  }
}
