.nova-product {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin: 0 auto;
  min-width: 0;
}

.nova-product-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  min-width: 0;
}

/* 图库：左侧缩略图竖排，右侧大图，等高对齐 */
.nova-product-gallery {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 1rem;
  min-width: 0;
  max-width: 100%;
}

.nova-product-gallery--has-thumbs {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: stretch;
}

.nova-product-gallery--has-thumbs .nova-product-main {
  grid-column: 2;
  min-width: 0;
}

.nova-product-thumbs-nav {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  align-self: stretch;
  min-height: 0;
  height: 100%;
}

.nova-product-thumbs-nav:not(.nova-product-thumbs-nav--filled):not(.nova-product-thumbs-nav--window) {
  width: 88px;
}

.nova-product-thumbs-nav:not(.nova-product-thumbs-nav--filled):not(.nova-product-thumbs-nav--window) .nova-product-thumbs-viewport {
  display: flex;
  flex: 1;
  min-height: 0;
  align-items: center;
  justify-content: center;
}

.nova-product-thumbs-nav--filled,
.nova-product-thumbs-nav--window {
  justify-content: stretch;
  width: calc(var(--thumb-slot-size, 80px) + 8px);
}

.nova-product-thumbs-nav--filled .nova-product-thumbs-viewport,
.nova-product-thumbs-nav--window .nova-product-thumbs-viewport {
  flex: 1;
  height: 100%;
  width: 100%;
  padding: 0;
  box-sizing: border-box;
}

@media (min-width: 769px) {
  .nova-product-thumbs-nav--filled:not(.nova-product-thumbs-nav--window) .nova-product-thumbs {
    max-height: 100%;
  }
}

.nova-product-thumbs-viewport {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.nova-product-thumbs {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  gap: 0.625rem;
  width: 100%;
  padding: 0;
  will-change: transform;
}

.nova-product-thumbs-nav--filled .nova-product-thumb,
.nova-product-thumbs-nav--window .nova-product-thumb {
  width: var(--thumb-slot-size, 80px);
  height: var(--thumb-slot-size, 80px);
}

.nova-product-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: #f5f5f5;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.nova-product-thumb.active {
  border-color: #667eea;
  box-shadow: inset 0 0 0 1px rgba(102, 126, 234, 0.35);
}

.nova-product-thumb:hover:not(.active) {
  border-color: rgba(102, 126, 234, 0.55);
}

.nova-product-thumb:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.nova-product-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.nova-product-main {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #f5f5f5;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-sizing: border-box;
}

.nova-product-main-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}

.nova-product-main.is-switching .nova-product-main-stage {
  pointer-events: none;
}

.nova-product-main-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #f5f5f5;
  opacity: 0;
  transition: opacity 0.32s ease;
  pointer-events: none;
}

.nova-product-main-img.is-visible {
  opacity: 1;
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .nova-product-main-img {
    transition: none;
  }
}

.nova-product-main-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 200px;
  color: #999;
  font-size: 0.95rem;
}

.nova-product-info {
  min-width: 0;
  max-width: 100%;
}

.nova-product-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.nova-product-summary {
  color: #666;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

.nova-product-attributes {
  margin: 0 0 1.5rem;
  padding: 1rem;
  background: #fff;
  border-radius: 8px;
}

.nova-product-attr-row {
  display: flex;
  gap: 1rem;
  padding: 0.35rem 0;
}

.nova-product-attr-row:last-child {
  border-bottom: none;
}

.nova-product-attr-row dt {
  min-width: 80px;
  color: #888;
  font-weight: 500;
}

.nova-product-attr-row dd {
  margin: 0;
  flex: 1;
}

.nova-product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.nova-product-btn {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
}

.nova-product-btn-primary {
  background: #667eea;
  color: #fff;
}

.nova-product-btn-primary:hover {
  background: #5a6fd6;
  color: #fff;
}

.nova-product-btn-secondary {
  background: #6c757d;
  color: #fff;
}

.nova-product-btn-outline {
  background: transparent;
  border: 2px solid #667eea;
  color: #667eea;
}

.nova-product-content {
  line-height: 1.8;
  color: #444;
  width: 100%;
  padding-top: 0.5rem;
}

.nova-product-list {
  display: grid;
  grid-template-columns: repeat(var(--product-columns, 3), 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.nova-product-card {
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.nova-product-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.nova-product-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.nova-product-card-image {
  aspect-ratio: 4/3;
  background: #f5f5f5;
  overflow: hidden;
}

.nova-product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nova-product-card-body {
  padding: 1rem;
}

.nova-product-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}

.nova-product-card-desc {
  font-size: 0.875rem;
  color: #666;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 768px) {
  .nova-product-body {
    grid-template-columns: 1fr;
  }

  .nova-product-gallery--has-thumbs {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .nova-product-gallery--has-thumbs .nova-product-main {
    grid-column: auto;
    order: 1;
    width: 100%;
  }

  .nova-product-thumbs-nav {
    order: 2;
    width: 100%;
    height: auto;
    align-self: auto;
  }

  .nova-product-thumbs-nav:not(.nova-product-thumbs-nav--filled):not(.nova-product-thumbs-nav--window) .nova-product-thumbs-viewport {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .nova-product-thumbs-nav--filled,
  .nova-product-thumbs-nav--window {
    width: 100%;
  }

  .nova-product-thumbs-nav--filled .nova-product-thumbs-viewport,
  .nova-product-thumbs-nav--window .nova-product-thumbs-viewport {
    width: 100%;
    height: calc(var(--thumb-slot-size, 80px) + 4px);
    flex: none;
    padding: 2px;
    box-sizing: border-box;
  }

  .nova-product-thumbs-viewport {
    flex: 1;
    min-width: 0;
  }

  .nova-product-gallery--has-thumbs .nova-product-thumbs {
    flex-direction: row;
    width: auto;
    min-width: min-content;
  }

  .nova-product-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .nova-product-list {
    grid-template-columns: 1fr;
  }
}
