/*
 * Songwei commerce polish layer — 2026-08-07
 * Loaded after the legacy site styles so storefront and product-detail controls
 * remain visually explicit and are not flattened by older generic overrides.
 */

:root {
  --commerce-ink: #181817;
  --commerce-muted: #6d6963;
  --commerce-paper: #f6f3ed;
  --commerce-card: #ffffff;
  --commerce-line: rgba(24, 24, 23, 0.12);
  --commerce-gold: #a88655;
  --commerce-shadow: 0 22px 60px rgba(33, 28, 22, 0.09);
}

/* Storefront */
body[data-live-page="shop"] main {
  background:
    radial-gradient(circle at 16% 8%, rgba(184, 153, 110, 0.13), transparent 28rem),
    linear-gradient(180deg, #faf9f6 0%, #f3f0ea 100%);
}

body[data-live-page="shop"] .products--preserved-catalog {
  min-height: 80vh;
  padding: clamp(7.5rem, 11vw, 10rem) 0 clamp(4.5rem, 8vw, 7rem);
  background: transparent;
}

body[data-live-page="shop"] .kept-catalog-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 1.5rem;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
  text-align: left;
}

.commerce-heading__eyebrow,
.commerce-product-kicker,
.commerce-detail-heading__eyebrow {
  display: block;
  margin: 0 0 0.7rem;
  color: #8b6b42;
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

body[data-live-page="shop"] .kept-catalog-heading .section-title {
  margin: 0;
  color: var(--commerce-ink);
  font-size: clamp(2.6rem, 5.5vw, 4.7rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.commerce-heading__desc {
  max-width: 46rem;
  margin: 1rem 0 0;
  color: var(--commerce-muted);
  font-size: clamp(1rem, 1.5vw, 1.1rem);
  line-height: 1.8;
}

.commerce-heading__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
}

.commerce-heading__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 1.15rem;
  color: var(--commerce-ink);
  text-decoration: none;
  border: 1px solid var(--commerce-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 9px 24px rgba(31, 27, 22, 0.05);
  font-size: 0.9rem;
  font-weight: 650;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.commerce-heading__action--service {
  color: #fff;
  border-color: var(--commerce-ink);
  background: var(--commerce-ink);
}

.commerce-heading__action:hover {
  transform: translateY(-2px);
  border-color: rgba(24, 24, 23, 0.28);
  box-shadow: 0 14px 30px rgba(31, 27, 22, 0.09);
}

body[data-live-page="shop"] .kept-catalog-grid {
  gap: clamp(1rem, 2.2vw, 1.6rem);
}

body[data-live-page="shop"] .kept-product-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  border: 1px solid rgba(24, 24, 23, 0.08);
  border-radius: 1.7rem;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 38px rgba(34, 29, 23, 0.055);
}

body[data-live-page="shop"] .kept-product-card__media {
  border-radius: 1.2rem;
  background: #f2eee7;
}

body[data-live-page="shop"] .kept-product-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: stretch;
  padding: 1.15rem 1.15rem 1.25rem;
}

body[data-live-page="shop"] .kept-product-card__body h2 {
  min-height: 2.45em;
}

body[data-live-page="shop"] .kept-product-card__spec {
  flex: 1;
}

body[data-live-page="shop"] .kept-product-card__link {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.2rem;
  padding: 0 1.15rem;
  color: #fff;
  text-decoration: none;
  border: 1px solid var(--commerce-ink);
  border-radius: 0.85rem;
  background: linear-gradient(135deg, #292825 0%, #111110 100%);
  box-shadow: 0 12px 24px rgba(21, 20, 18, 0.18);
  font-size: 0.92rem;
  font-weight: 700;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

body[data-live-page="shop"] .kept-product-card__link:hover {
  transform: translateY(-1px);
  background: #000;
  box-shadow: 0 15px 30px rgba(21, 20, 18, 0.24);
}

.kept-product-card__link-icon {
  font-size: 1.1rem;
  line-height: 1;
}

/* Product detail navigation */
body[data-live-page="product"] main {
  overflow: hidden;
  background:
    radial-gradient(circle at 86% 8%, rgba(183, 146, 94, 0.11), transparent 28rem),
    linear-gradient(180deg, #faf9f6 0%, #f5f2ec 58%, #fbfaf7 100%);
}

.commerce-product-nav {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: clamp(6.3rem, 9vw, 8rem) clamp(1rem, 2.4vw, 2rem) 1.4rem;
}

.commerce-product-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid rgba(24, 24, 23, 0.1);
}

.commerce-back-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.45rem;
  color: var(--commerce-ink);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 700;
}

body[data-live-page="product"] .page-quicknav {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem !important;
  margin: 0;
}

body[data-live-page="product"] .page-quicknav__item {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 0 0.9rem !important;
  color: #55514b !important;
  text-decoration: none;
  border: 1px solid rgba(24, 24, 23, 0.1) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.8) !important;
  box-shadow: 0 7px 20px rgba(32, 27, 22, 0.045) !important;
  font-size: 0.82rem;
  font-weight: 650;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

body[data-live-page="product"] .page-quicknav__item:hover {
  transform: translateY(-1px);
  color: var(--commerce-ink) !important;
  border-color: rgba(24, 24, 23, 0.25) !important;
  background: #fff !important;
}

body[data-live-page="product"] .page-quicknav__item--service {
  color: #fff !important;
  border-color: var(--commerce-ink) !important;
  background: var(--commerce-ink) !important;
}

/* Product hero */
body[data-live-page="product"] .commerce-product-hero {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: clamp(1.2rem, 3vw, 2.4rem) clamp(1rem, 2.4vw, 2rem) clamp(4rem, 7vw, 6.5rem) !important;
}

body[data-live-page="product"] .commerce-product-hero .product-detail-card {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr) !important;
  gap: clamp(2rem, 5vw, 5rem);
  max-width: none;
  align-items: center;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body[data-live-page="product"] .product-detail__image {
  position: sticky;
  top: 6.5rem;
  overflow: hidden;
  padding: 0 !important;
  border: 1px solid rgba(24, 24, 23, 0.08) !important;
  border-radius: 2rem !important;
  background: #eee8de !important;
  box-shadow: var(--commerce-shadow) !important;
}

body[data-live-page="product"] .product-detail__image img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0 !important;
}

body[data-live-page="product"] .product-image__badge {
  top: 1rem;
  left: 1rem;
  padding: 0.55rem 0.8rem;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(20, 20, 19, 0.84);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(10px);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

body[data-live-page="product"] .product-detail__info {
  padding: 0 !important;
}

body[data-live-page="product"] .product-detail__info h1 {
  max-width: 12em;
  margin: 0 0 0.75rem;
  color: var(--commerce-ink);
  font-size: clamp(2.6rem, 5vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

body[data-live-page="product"] .product-detail__subtitle {
  margin: 0 0 1.2rem;
  color: #837c72;
  font-size: 1rem;
  font-weight: 600;
}

body[data-live-page="product"] .product-detail__price {
  margin: 0 0 1rem;
  color: var(--commerce-ink);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 750;
  letter-spacing: -0.035em;
}

body[data-live-page="product"] .product-detail__desc {
  max-width: 42rem;
  margin: 0 0 2rem;
  color: var(--commerce-muted);
  font-size: 1rem;
  line-height: 1.85;
}

body[data-live-page="product"] .product-specs-group,
body[data-live-page="product"] .product-accessories {
  margin: 1.6rem 0 0;
  padding: 0;
  background: transparent !important;
}

body[data-live-page="product"] .product-specs-group h2,
body[data-live-page="product"] .product-accessories h2 {
  margin: 0 0 0.85rem;
  color: var(--commerce-ink);
  font-size: 0.95rem;
  font-weight: 750;
  letter-spacing: 0.01em;
}

body[data-live-page="product"] .intro-chip-row,
body[data-live-page="product"] .accessories-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem !important;
  margin: 0;
  padding: 0;
  background: transparent !important;
}

body[data-live-page="product"] .commerce-option {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 56px;
  align-items: center;
  justify-content: flex-start;
  gap: 0.72rem;
  padding: 0.75rem 0.9rem !important;
  appearance: none;
  color: var(--commerce-ink) !important;
  text-align: left;
  border: 1px solid rgba(24, 24, 23, 0.14) !important;
  border-radius: 0.9rem !important;
  outline: 0 !important;
  background: rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 7px 18px rgba(31, 27, 22, 0.04) !important;
  font: inherit;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

body[data-live-page="product"] .commerce-option::before,
body[data-live-page="product"] .commerce-option::after {
  content: none !important;
}

body[data-live-page="product"] .commerce-option:hover {
  transform: translateY(-1px);
  border-color: rgba(24, 24, 23, 0.35) !important;
  background: #fff !important;
  box-shadow: 0 10px 24px rgba(31, 27, 22, 0.08) !important;
}

body[data-live-page="product"] .commerce-option--size.is-selected {
  color: #fff !important;
  border-color: var(--commerce-ink) !important;
  background: var(--commerce-ink) !important;
  box-shadow: 0 12px 24px rgba(24, 24, 23, 0.18) !important;
}

.commerce-option__copy {
  display: grid;
  min-width: 0;
  gap: 0.12rem;
}

.commerce-option__label {
  overflow: hidden;
  font-size: 0.9rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commerce-option__meta {
  overflow: hidden;
  color: #878078;
  font-size: 0.7rem;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body[data-live-page="product"] .commerce-option--size.is-selected .commerce-option__meta {
  color: rgba(255, 255, 255, 0.68);
}

.commerce-option__swatch {
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 1.35rem;
  border: 1px solid rgba(24, 24, 23, 0.18);
  border-radius: 50%;
  background: var(--option-swatch, #c8b9a5);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

body[data-live-page="product"] .commerce-option--color.is-selected {
  border-color: var(--commerce-ink) !important;
  background: #f1ece4 !important;
  box-shadow: inset 0 0 0 1px var(--commerce-ink), 0 10px 24px rgba(31, 27, 22, 0.08) !important;
}

body[data-live-page="product"] .commerce-option--color.is-selected::after {
  content: "✓" !important;
  display: grid;
  width: 1.3rem;
  height: 1.3rem;
  place-items: center;
  margin-left: auto;
  color: #fff;
  border-radius: 50%;
  background: var(--commerce-ink);
  font-size: 0.72rem;
  font-weight: 800;
}

body[data-live-page="product"] .product-detail__specs {
  display: grid;
  gap: 0;
  margin: 1.9rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(24, 24, 23, 0.09);
}

body[data-live-page="product"] .product-detail__specs li {
  display: grid;
  grid-template-columns: 5.2rem minmax(0, 1fr);
  gap: 0.75rem;
  padding: 0.85rem 0;
  color: var(--commerce-muted);
  border-bottom: 1px solid rgba(24, 24, 23, 0.09);
  font-size: 0.88rem;
  line-height: 1.55;
}

body[data-live-page="product"] .product-detail__specs strong {
  color: var(--commerce-ink);
}

.commerce-selection-summary {
  margin: 1rem 0 0;
  color: #786d60;
  font-size: 0.82rem;
  line-height: 1.6;
}

body[data-live-page="product"] .product-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem !important;
  margin-top: 1.3rem;
}

body[data-live-page="product"] .product-actions .btn {
  display: inline-flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0 1.15rem;
  text-decoration: none;
  border: 1px solid var(--commerce-ink) !important;
  border-radius: 0.9rem;
  font-size: 0.95rem;
  font-weight: 750;
}

body[data-live-page="product"] .product-actions .btn--primary {
  color: #fff;
  background: var(--commerce-ink) !important;
  box-shadow: 0 13px 28px rgba(24, 24, 23, 0.2);
}

body[data-live-page="product"] .product-actions .btn--secondary {
  color: var(--commerce-ink);
  background: rgba(255, 255, 255, 0.86) !important;
  box-shadow: none;
}

/* Detail content placed directly beneath each product */
.commerce-detail-content {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 0 clamp(1rem, 2.4vw, 2rem) clamp(5rem, 9vw, 8rem);
}

.commerce-detail-heading {
  max-width: 48rem;
  margin-bottom: clamp(1.6rem, 4vw, 2.8rem);
}

.commerce-detail-heading h2 {
  margin: 0 0 0.8rem;
  color: var(--commerce-ink);
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.commerce-detail-heading p {
  margin: 0;
  color: var(--commerce-muted);
  font-size: 1rem;
  line-height: 1.85;
}

.commerce-detail-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(1.2rem, 3vw, 2.2rem);
  align-items: stretch;
  margin-bottom: 1.2rem;
}

.commerce-detail-showcase__media,
.commerce-detail-showcase__copy {
  overflow: hidden;
  min-height: 23rem;
  border: 1px solid rgba(24, 24, 23, 0.08);
  border-radius: 1.7rem;
  background: #fff;
  box-shadow: 0 16px 42px rgba(34, 29, 23, 0.055);
}

.commerce-detail-showcase__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.commerce-detail-showcase__copy {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(1.6rem, 4vw, 3rem);
  background:
    radial-gradient(circle at 80% 10%, rgba(181, 145, 94, 0.16), transparent 16rem),
    #fff;
}

.commerce-detail-showcase__index {
  color: #a48761;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.commerce-detail-showcase__copy h3 {
  margin: 0.65rem 0 0.8rem;
  color: var(--commerce-ink);
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  letter-spacing: -0.035em;
}

.commerce-detail-showcase__copy p {
  margin: 0;
  color: var(--commerce-muted);
  line-height: 1.85;
}

.commerce-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.commerce-detail-card {
  min-height: 13.5rem;
  padding: clamp(1.3rem, 3vw, 2rem);
  border: 1px solid rgba(24, 24, 23, 0.08);
  border-radius: 1.35rem;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 12px 34px rgba(34, 29, 23, 0.045);
}

.commerce-detail-card__index {
  color: #a48761;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.commerce-detail-card h3 {
  margin: 1.8rem 0 0.65rem;
  color: var(--commerce-ink);
  font-size: 1.18rem;
}

.commerce-detail-card p {
  margin: 0;
  color: var(--commerce-muted);
  font-size: 0.9rem;
  line-height: 1.75;
}

.commerce-service-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 1rem;
  padding: clamp(1.4rem, 3vw, 2rem);
  color: #fff;
  border-radius: 1.35rem;
  background: linear-gradient(135deg, #2b2925 0%, #11110f 100%);
  box-shadow: 0 18px 38px rgba(20, 19, 17, 0.18);
}

.commerce-service-band h3 {
  margin: 0 0 0.35rem;
  color: #fff;
  font-size: 1.25rem;
}

.commerce-service-band p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.88rem;
  line-height: 1.6;
}

.commerce-service-band__actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.65rem;
}

.commerce-service-band__actions a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 1rem;
  color: var(--commerce-ink);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 0.75rem;
  background: #fff;
  font-size: 0.86rem;
  font-weight: 750;
}

.commerce-service-band__actions a:last-child {
  color: #fff;
  background: transparent;
}

/* Product-series page: make the matching detail action unmistakable. */
body.products-page .product-actions .btn--detail,
.products-detail .product-actions .btn--detail {
  color: #fff;
  border-color: #181817 !important;
  background: #181817 !important;
  box-shadow: 0 10px 22px rgba(24, 24, 23, 0.16);
}

.products-detail-entry__card--commerce {
  position: relative;
}

.products-detail-entry__card--commerce::after {
  content: "查看详情  →";
  display: inline-block;
  margin-top: 0.8rem;
  color: var(--commerce-ink);
  font-size: 0.86rem;
  font-weight: 750;
}

@media (max-width: 1100px) {
  body[data-live-page="shop"] .kept-catalog-heading {
    grid-template-columns: 1fr;
  }

  .commerce-heading__actions {
    justify-content: flex-start;
  }

  body[data-live-page="product"] .commerce-product-hero .product-detail-card {
    grid-template-columns: 1fr !important;
  }

  body[data-live-page="product"] .product-detail__image {
    position: relative;
    top: auto;
    max-width: 44rem;
    margin: 0 auto;
  }
}

@media (max-width: 820px) {
  .commerce-product-nav__inner,
  .commerce-service-band {
    align-items: flex-start;
    flex-direction: column;
  }

  body[data-live-page="product"] .page-quicknav {
    justify-content: flex-start;
  }

  .commerce-detail-showcase {
    grid-template-columns: 1fr;
  }

  .commerce-detail-showcase__media,
  .commerce-detail-showcase__copy {
    min-height: 19rem;
  }

  .commerce-detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  body[data-live-page="shop"] .products--preserved-catalog {
    padding-top: 6.5rem;
  }

  .commerce-heading__actions,
  .commerce-heading__action,
  .commerce-service-band__actions,
  .commerce-service-band__actions a {
    width: 100%;
  }

  .commerce-product-nav {
    padding-top: 5.3rem;
  }

  .commerce-back-link {
    width: 100%;
  }

  body[data-live-page="product"] .page-quicknav {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body[data-live-page="product"] .page-quicknav__item {
    width: 100%;
  }

  body[data-live-page="product"] .page-quicknav__item--service {
    grid-column: 1 / -1;
  }

  body[data-live-page="product"] .intro-chip-row,
  body[data-live-page="product"] .accessories-grid,
  body[data-live-page="product"] .product-actions {
    grid-template-columns: 1fr;
  }

  body[data-live-page="product"] .product-detail__info h1 {
    font-size: clamp(2.35rem, 12vw, 3.3rem);
  }

  body[data-live-page="product"] .product-detail__specs li {
    grid-template-columns: 4.4rem minmax(0, 1fr);
  }

  .commerce-service-band__actions {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .commerce-heading__action,
  body[data-live-page="shop"] .kept-product-card,
  body[data-live-page="shop"] .kept-product-card__link,
  body[data-live-page="product"] .page-quicknav__item,
  body[data-live-page="product"] .commerce-option {
    transition: none;
  }
}
