.product-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(24px, 3vw, 48px);
  margin-bottom: 48px;
  align-items: start;
}

.product-detail__gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: calc(var(--header-height) + 16px);
}

.product-detail__main {
  background: linear-gradient(160deg, #f8fafc 0%, #eef2f7 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 3vw, 32px);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.product-detail__main img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-detail__thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.product-detail__thumbs button {
  width: 72px;
  height: 72px;
  padding: 4px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.product-detail__thumbs button:hover {
  border-color: var(--color-border);
}

.product-detail__thumbs button.is-active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
}

.product-detail__thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: calc(var(--radius-md) - 2px);
}

.product-detail__panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: clamp(20px, 2.5vw, 28px);
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

.product-detail__brand {
  font-size: 13px;
  color: var(--color-primary);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}

.product-detail__title {
  font-size: clamp(1.5rem, 2.8vw, 2rem);
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.02em;
}

.product-detail__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.product-detail__sku-badge,
.product-detail__stock-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #475569;
}

.product-detail__sku-badge strong {
  color: var(--color-text);
  font-weight: 600;
}

.product-detail__stock-badge--in {
  background: #dcfce7;
  border-color: #86efac;
  color: #15803d;
}

.product-detail__stock-badge--out {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--color-danger);
}

.product-detail__rating-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg-card);
  font-size: 12px;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
}

.product-detail__rating-link:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.product-detail__stars {
  color: #f59e0b;
  letter-spacing: 1px;
}

.product-detail__stars .star-rating {
  float: none;
  margin: 0;
}

.product-detail__b2b-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.product-detail__b2b-badges li {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
}

.product-detail__price-card {
  padding: 18px 20px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--color-primary);
}

.product-detail__price-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.product-detail__price {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 700;
  margin: 0;
  line-height: 1.1;
  color: var(--color-text);
}

.product-detail__unit {
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

.product-detail__price-note {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 8px 0 0;
  line-height: 1.45;
}

.product-detail__bulk-card {
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}

.product-detail__bulk-title {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
}

.bulk-price-table {
  width: 100%;
  font-size: 14px;
  border-collapse: collapse;
}

.bulk-price-table th,
.bulk-price-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

.bulk-price-table thead th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.6);
}

.bulk-price-table tbody tr:last-child td,
.bulk-price-table tbody tr:last-child th {
  border-bottom: none;
}

.bulk-price-table tbody tr:hover td {
  background: rgba(37, 99, 235, 0.04);
}

.product-detail__order-card {
  padding: 18px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
}

.product-detail__buy {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff;
}

.qty-stepper button {
  width: 40px;
  height: 44px;
  border: none;
  background: var(--color-bg-alt);
  font-size: 18px;
  cursor: pointer;
  transition: background var(--transition);
}

.qty-stepper button:hover {
  background: #e5e7eb;
}

.qty-stepper input {
  width: 56px;
  height: 44px;
  border: none;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  text-align: center;
  font-size: 16px;
}

.qty-stepper--sm button {
  width: 32px;
  height: 36px;
}

.qty-stepper--sm input {
  width: 44px;
  height: 36px;
}

.product-detail__cart-btn {
  flex: 1;
  min-width: 160px;
}

.product-detail__features {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.product-detail__features li {
  position: relative;
  padding-left: 22px;
  color: var(--color-text-muted);
}

.product-detail__features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
}

.product-detail__logistics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.product-detail__logistics-item {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
}

.product-detail__logistics-icon {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.product-detail__logistics-item strong {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
}

.product-detail__logistics-item p {
  margin: 0;
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.product-detail__logistics-item a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

.product-detail__logistics-item a:hover {
  text-decoration: underline;
}

/* Tabs */
.product-tabs {
  margin-top: 8px;
}

.product-tabs__nav {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.product-tabs__nav button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color var(--transition), border-color var(--transition);
}

.product-tabs__nav button:hover {
  color: var(--color-text);
}

.product-tabs__nav button[aria-selected="true"] {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.product-tabs__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.product-tabs__panel {
  font-size: 15px;
  line-height: 1.7;
}

.product-tabs__panel[hidden] {
  display: none;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table th {
  text-align: left;
  font-weight: 500;
  color: var(--color-text-muted);
  width: 40%;
  padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--color-border);
}

.specs-table td {
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}

/* Reviews */
.product-reviews__summary {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding: 20px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
}

.product-reviews__score {
  display: flex;
  align-items: baseline;
  gap: 2px;
  line-height: 1;
}

.product-reviews__score-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-text);
}

.product-reviews__score-max {
  font-size: 1rem;
  color: var(--color-text-muted);
}

.product-reviews__summary-meta .star-rating {
  float: none;
  margin: 0 0 6px;
}

.product-reviews__count {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

.product-reviews__layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.product-reviews__layout--empty .product-reviews__form-wrap {
  order: 1;
}

.product-reviews__layout--empty .product-reviews__list {
  order: 2;
}

.product-reviews__list-title {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 600;
}

.product-review-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.product-review-card {
  padding: 16px 18px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
}

.product-review-card__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.product-review-card__avatar img {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.product-review-card__author {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 600;
}

.product-review-card__date {
  font-size: 12px;
  color: var(--color-text-muted);
}

.product-review-card__rating .star-rating {
  float: none;
  margin: 0;
}

.product-review-card__body {
  font-size: 14px;
  line-height: 1.6;
  color: #475569;
}

.product-review-card__body p {
  margin: 0;
}

.product-reviews__empty {
  padding: 14px 16px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.product-reviews__empty-text {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

.product-review-form {
  padding: 22px 24px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.product-review-form__title {
  margin: 0 0 18px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.product-review-form__title small {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 400;
}

.product-review-form__fields > p,
.product-review-form__fields > div {
  margin: 0 0 16px;
}

.product-review-form__label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.product-review-form__field label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.product-review-form__field input,
.product-review-form__field textarea {
  display: block;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.product-review-form__field input:focus,
.product-review-form__field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.product-review-form__field textarea {
  min-height: 120px;
  resize: vertical;
}

.product-review-form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-review-form__field--wide textarea {
  width: 100%;
}

.product-review-form__rating {
  margin-bottom: 16px;
}

/* Radio star rating */
.product-star-rating {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 6px;
}

.product-star-rating input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.product-star-rating label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.product-star-rating__icon {
  font-size: 22px;
  line-height: 1;
  color: #d1d5db;
  transition: color 0.15s ease;
}

.product-star-rating label:hover .product-star-rating__icon,
.product-star-rating label:hover ~ label .product-star-rating__icon,
.product-star-rating input:checked ~ label .product-star-rating__icon {
  color: #f59e0b;
}

.product-star-rating label:hover,
.product-star-rating label:hover ~ label,
.product-star-rating input:checked ~ label {
  border-color: #fcd34d;
  background: #fffbeb;
}

.product-review-form__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  margin-top: 4px;
  font-size: 15px;
}

.product-review-form__login {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

.product-review-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 10px;
  animation: product-review-notice-in 0.35s ease;
}

.product-review-notice--success {
  background: #dcfce7;
  border: 1px solid #86efac;
  color: #166534;
}

.product-review-notice__icon {
  flex-shrink: 0;
  display: flex;
  margin-top: 1px;
}

.product-review-notice__text {
  flex: 1;
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
}

.product-review-notice__close {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.7;
}

.product-review-notice__close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}

@keyframes product-review-notice-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.catalog-grid--related {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 1.8vw, 24px);
}

.product-card__title a {
  color: inherit;
  text-decoration: none;
}

.product-card__title a:hover {
  color: var(--color-primary);
}

@media (max-width: 992px) {
  .product-detail {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .product-detail__gallery,
  .product-reviews__form-wrap {
    position: static;
  }

  .product-reviews__layout {
    gap: 16px;
  }

  .product-review-form__row {
    grid-template-columns: 1fr;
  }

  .product-detail__logistics {
    grid-template-columns: 1fr;
  }

  .catalog-grid--related {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .catalog-grid--related {
    grid-template-columns: 1fr;
  }

  .product-detail__buy {
    flex-direction: column;
    align-items: stretch;
  }

  .qty-stepper {
    justify-content: center;
    width: 100%;
  }

  .product-detail__panel {
    padding: 16px;
  }

  .product-reviews__summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}
