/* Shopping page layout — catalog → styles → product
   Theme tokens mapped to Diamond v3 base.css variables. */

.shop-page {
  --font-heading: var(--serif);
  --font-body: var(--sans);
  --color-background: var(--paper);
  --color-surface: #fff;
  --color-surface-alt: var(--paper-warm);
  --color-bg: var(--paper-warm);
  --color-text: var(--ink);
  --color-text-muted: var(--ink-soft);
  --color-border: var(--mint-line);
  --color-accent: var(--mint-deep);
  --color-accent-ink: var(--ink);
  --color-brand: var(--mint-deep);
  --color-brand-hover: var(--mint);
  --color-on-brand: var(--ink);
}

.hidden { display: none !important; }
.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;
}


.main-content:has(.shop-page) {
  padding-left: 0;
}

body.shop-mobile-bar {
  padding-bottom: 80px;
}

.shop-page {
  max-width: 1200px;
  margin: 0 auto;
}

.shop-header {
  margin-bottom: 32px;
}

.shop-page-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 44px);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.shop-breadcrumb {
  font-size: 13px;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

.shop-breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.shop-breadcrumb-list li {
  display: inline-flex;
  align-items: center;
}

.shop-breadcrumb-list li + li::before {
  content: "/";
  margin: 0 8px;
  color: var(--color-text-muted);
  opacity: 0.7;
}

.shop-breadcrumb-link {
  border: none;
  padding: 0;
  background: none;
  color: var(--color-text-muted);
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}

.shop-breadcrumb-link:hover {
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.shop-breadcrumb-list li.is-current {
  color: var(--color-text);
  font-weight: 600;
}

.shop-page.shop-view--product .shop-page-title {
  display: none;
}

.shop-page.shop-view--product .shop-header {
  margin-bottom: 16px;
}

/* Two-column: selection left, price panel right (always visible) */
.shop-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}

.shop-main {
  min-width: 0;
}

.shop-section {
  animation: shopFadeIn 0.25s ease;
}

@keyframes shopFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.shop-section-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 24px;
}

.shop-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--color-text-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.shop-back:hover {
  color: var(--color-text);
}

/* Catalog grid */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.catalog-tile {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.catalog-tile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  object-position: center;
  display: block;
  background: var(--color-bg);
  padding: 0.35rem;
  box-sizing: border-box;
}

.catalog-tile span {
  padding: 0 12px 16px;
  font-size: 15px;
  font-weight: 500;
}

.catalog-tile:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

.catalog-tile.active {
  border-color: var(--color-accent);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 0 0 1px var(--color-accent);
}

/* Style grid — smart layout by item count (HTMX sets type-grid--size-* server-side) */
#shop-styles .type-grid {
  display: grid;
  gap: clamp(0.75rem, 1.2vw, 1.25rem);
  width: 100%;
  /* Fallback when size class missing — avoid single-column / 200px-attr cards */
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

#shop-styles .type-card img,
#shop-styles .type-card .type-card__img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  object-position: center;
  display: block;
  max-width: 100%;
  height: auto;
  background: var(--color-surface, #fff);
  padding: 0.35rem;
  box-sizing: border-box;
}

#shop-styles .type-card .type-name,
#shop-styles .type-card .type-card__name {
  padding: 12px 14px 16px;
  font-weight: 600;
}

#shop-styles .type-grid.type-grid--size-xl,
#shop-styles .type-grid.type-grid--size-lg,
#shop-styles .type-grid.type-grid--size-md,
#shop-styles .type-grid.type-grid--size-sm {
  grid-template-columns: repeat(var(--type-cols, 3), minmax(0, 1fr));
}

#shop-styles .type-grid.type-grid--size-xs {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

#shop-styles .type-grid.type-grid--size-xl {
  max-width: min(100%, 360px);
  margin-inline: auto;
}

#shop-styles .type-grid.type-grid--size-lg {
  max-width: min(100%, calc(var(--type-cols, 3) * 280px));
  margin-inline: auto;
}

#shop-styles .type-grid.type-grid--size-md {
  max-width: min(100%, calc(var(--type-cols, 3) * 220px));
  margin-inline: auto;
}

#shop-styles .type-grid.type-grid--size-sm {
  max-width: 100%;
}

#shop-styles .type-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  font: inherit;
  color: inherit;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

#shop-styles .type-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

#shop-styles .type-card.active {
  border-color: var(--color-accent-ink);
  box-shadow: 0 0 0 1px var(--color-accent);
}

#shop-styles .type-card .img-placeholder {
  border-radius: 0;
}

#shop-styles .type-card .type-name {
  padding: 12px 14px 16px;
  font-weight: 600;
}

#shop-styles .type-grid.type-grid--size-xl .type-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  object-position: center;
  max-height: min(42vh, 340px);
}

#shop-styles .type-grid.type-grid--size-xl .type-name {
  font-size: 1.125rem;
  padding: 1rem 1rem 1.25rem;
}

#shop-styles .type-grid.type-grid--size-lg .type-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  object-position: center;
  max-height: min(36vh, 280px);
}

#shop-styles .type-grid.type-grid--size-lg .type-name {
  font-size: 1rem;
  padding: 0.875rem 0.75rem 1rem;
}

#shop-styles .type-grid.type-grid--size-md .type-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  object-position: center;
  max-height: min(28vh, 220px);
}

#shop-styles .type-grid.type-grid--size-md .type-name {
  font-size: 0.9375rem;
}

#shop-styles .type-grid.type-grid--size-sm .type-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  object-position: center;
  max-height: min(22vh, 180px);
}

#shop-styles .type-grid.type-grid--size-sm .type-name {
  font-size: 0.8125rem;
  padding: 0.625rem 0.5rem 0.75rem;
}

#shop-styles .type-grid.type-grid--size-xs .type-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  object-position: center;
}

#shop-styles .type-grid.type-grid--size-xs .type-name {
  font-size: 0.8125rem;
  padding: 0.5rem 0.5rem 0.625rem;
}

/* Product layout — e-commerce PDP: gallery left, buy box right */
.product-layout {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 1.15fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}

.product-gallery-col {
  position: sticky;
  top: 20px;
  align-self: start;
  width: 100%;
}

.product-buy-col {
  width: 100%;
  min-width: 0;
}

.product-preview {
  aspect-ratio: 1;
  width: 100%;
  max-height: min(calc(100vh - 56px), 480px);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.product-preview > #large-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  cursor: zoom-in;
}

.product-preview.is-pendant-only > #large-image {
  object-fit: contain;
  object-position: center bottom;
}

.product-preview-layer {
  position: absolute;
  display: block;
  pointer-events: none;
  cursor: default;
}

.product-preview-composite {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.product-preview-composite.hidden {
  display: none;
}

.product-preview-layer--chain {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  z-index: 1;
}

.product-preview-layer--pendant {
  left: 50%;
  bottom: 6%;
  width: 56%;
  height: auto;
  max-height: 52%;
  transform: translateX(-50%);
  object-fit: contain;
  object-position: center bottom;
  z-index: 2;
}

.product-preview:has(.product-preview-composite:not(.hidden)) > #large-image {
  visibility: hidden;
  position: absolute;
  pointer-events: none;
}

.product-preview-composite:not(.hidden) ~ .product-zoom-btn {
  pointer-events: auto;
}

.product-image-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.product-thumb-btn {
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  padding: 0;
  border: 2px solid var(--color-border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--color-surface);
  cursor: pointer;
}

.product-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-surface) 94%, transparent);
  color: var(--color-text);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.product-gallery-nav:not([hidden]) {
  display: inline-flex;
}

.product-gallery-nav svg {
  width: 20px;
  height: 20px;
}

.product-gallery-nav:hover {
  background: var(--color-surface);
  border: 1px solid var(--color-brand);
  transform: translateY(-50%) scale(1.04);
}

.product-gallery-prev { left: 12px; }
.product-gallery-next { right: 12px; }

.product-gallery-counter {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-text) 72%, transparent);
  color: var(--color-surface);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.product-gallery-counter:not([hidden]) {
  display: inline-block;
}

.product-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
  background: var(--color-surface);
  padding: 0.2rem;
  box-sizing: border-box;
}

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

.product-zoom-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  color: var(--color-text);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(6px);
  transition: border-color 0.15s, transform 0.15s;
}

.product-zoom-btn:hover {
  border-color: var(--color-brand);
  transform: translateY(-1px);
}

.product-zoom-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.product-zoom-btn span[aria-hidden="true"] {
  font-size: 15px;
  line-height: 1;
}

.product-image-lightbox {
  position: fixed;
  inset: 0;
  width: fit-content;
  height: fit-content;
  max-width: min(96vw, 1100px);
  max-height: 92vh;
  margin: auto;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: transparent;
  overflow: visible;
}

.product-image-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.product-image-lightbox img {
  display: block;
  width: auto;
  max-width: min(96vw, 1100px);
  max-height: 88vh;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  border-radius: 10px;
  background: var(--color-surface);
}

.product-lightbox-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #222;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.product-lightbox-close:hover {
  background: #fff;
}

.product-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #222;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: none;
}

.product-lightbox-nav:not([hidden]) {
  display: block;
}

.product-lightbox-prev { left: -52px; }
.product-lightbox-next { right: -52px; }

.product-lightbox-nav svg {
  width: 20px;
  height: 20px;
}

.product-lightbox-nav:hover {
  background: #fff;
}

.product-title {
  font-family: var(--font-heading);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  margin: 0 0 12px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.product-subtitle {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.product-info-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--color-border);
}

.product-info-tabs {
  margin-bottom: 24px;
}

.product-tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 14px;
}

.product-tab-btn {
  border: none;
  background: none;
  padding: 12px 4px;
  margin-right: 24px;
  margin-bottom: -1px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

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

.product-tab-btn.active {
  color: var(--color-text);
  border-bottom-color: var(--color-accent-ink);
}

.product-tab-panel {
  font-size: 14px;
  line-height: 1.65;
  color: var(--color-text-muted);
}

.product-tab-panel[hidden] {
  display: none;
}

.product-tab-copy,
.product-description {
  margin: 0;
}

.product-options-section {
  padding-top: 4px;
}

.product-options-heading {
  margin: 0 0 20px;
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
}

.config-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 0;
  min-height: 0;
}

.config-chip {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg);
  color: var(--color-text-muted);
}

/* Variant selectors — no card/box around option groups */
.variant-group,
body.app-shell .variant-group {
  margin-bottom: 24px;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.product-buy-col .variant-group {
  margin-bottom: 28px;
}

.product-buy-col .variant-chips {
  gap: 10px;
}

.ring-size-select {
  width: 100%;
  max-width: 280px;
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 14px;
  cursor: pointer;
}

.carat-select {
  width: 100%;
  max-width: 280px;
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
  appearance: auto;
}

.engraving-input {
  width: 100%;
  max-width: 360px;
  box-sizing: border-box;
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 14px;
}

.variant-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0 0 10px;
}

.variant-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.ring-size-guide-btn {
  border: 0;
  padding: 0;
  background: none;
  color: var(--color-text-muted);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.ring-size-guide-btn:hover {
  color: var(--color-text);
}

/* Inline collapsible ring-size guide (ring order step) */
.ring-size-guide-inline {
  margin-top: 12px;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  font-size: 14px;
}

.ring-size-guide-inline summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  color: var(--color-text);
}

.ring-size-guide-inline summary::-webkit-details-marker { display: none; }

.ring-size-guide-inline summary::after {
  content: "+";
  font-size: 20px;
  font-weight: 400;
  color: var(--color-text-muted);
}

.ring-size-guide-inline[open] summary::after { content: "−"; }

.ring-size-guide-inline__content {
  padding: 4px 0 14px;
}

.ring-size-guide-inline__steps {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
  counter-reset: ring-step;
}

.ring-size-guide-inline__steps li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface-alt, color-mix(in srgb, var(--color-surface) 92%, var(--color-text)));
  color: var(--color-text-muted);
  line-height: 1.55;
  font-size: 13px;
}

.ring-size-guide-inline__steps li::before {
  counter-increment: ring-step;
  content: counter(ring-step);
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--shop-cyan-dim, color-mix(in srgb, var(--color-brand) 18%, transparent));
  color: var(--color-brand);
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

.shop-page .ring-size-guide-inline__steps li::before {
  color: var(--shop-cyan, var(--color-brand));
  background: var(--shop-cyan-dim, color-mix(in srgb, var(--color-brand) 18%, transparent));
}

.ring-size-guide-inline__scroll {
  overflow: auto;
  max-height: 280px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
}

.ring-size-guide-inline__table {
  width: 100%;
  border-collapse: collapse;
  text-align: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.ring-size-guide-inline__table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.ring-size-guide-inline__table th,
.ring-size-guide-inline__table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--color-border);
}

.ring-size-guide-inline__table thead th {
  background: var(--color-brand);
  color: var(--color-on-brand, #fff);
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}

.shop-page .ring-size-guide-inline__table thead th {
  background: color-mix(in srgb, var(--shop-cyan, var(--color-brand)) 82%, #0a3d45);
}

body.dark-theme .ring-size-guide-inline__table thead th {
  background: color-mix(in srgb, var(--color-brand) 75%, #0d4f5c);
}

.ring-size-guide-inline__table tbody th {
  font-weight: 700;
  color: var(--color-text);
  background: var(--color-surface-alt, var(--color-surface));
  text-align: center;
}

.ring-size-guide-inline__table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--color-surface-alt, var(--color-surface)) 55%, transparent);
}

.ring-size-guide-inline__table tbody tr:last-child th,
.ring-size-guide-inline__table tbody tr:last-child td {
  border-bottom: 0;
}

.ring-size-guide-inline__note {
  margin: 8px 0 0;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.ring-size-guide-inline__more {
  margin-top: 10px;
  border: 0;
  padding: 0;
  background: none;
  color: var(--color-text-muted);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.ring-size-guide-inline__more:hover {
  color: var(--color-text);
}

.ring-size-guide-inline--product {
  margin-top: 14px;
}

.ring-size-guide-inline--static {
  margin-top: 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.ring-size-guide-inline--product .ring-size-guide-inline__scroll {
  max-height: 220px;
}

.ring-size-guide-inline--static.ring-size-guide-inline--product .ring-size-guide-inline__scroll {
  max-height: none;
  overflow: visible;
  border: none;
}

.variant-group--size-guide {
  margin-top: 4px;
  margin-bottom: 28px;
}

.shop-fit .variant-group--size-guide {
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

.shop-page.shop-wizard .ring-size-guide-inline--product {
  margin-top: 12px;
}

/* Static variant: no <details>/<summary> collapse, always fully shown. */
.ring-size-guide-inline__title {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin: 0;
  font-weight: 700;
  color: var(--color-text);
}

.ring-size-guide-inline--large {
  font-size: 16px;
}

.ring-size-guide-inline--large .ring-size-guide-inline__title {
  font-size: 19px;
  min-height: 52px;
}

.ring-size-guide-inline--large .ring-size-guide-inline__content {
  padding: 8px 0 18px;
}

.ring-size-guide-inline--large .ring-size-guide-inline__steps {
  gap: 12px;
}

.ring-size-guide-inline--large .ring-size-guide-inline__steps li {
  gap: 14px;
  padding: 16px 18px;
  font-size: 16px;
  line-height: 1.6;
}

.ring-size-guide-inline--large .ring-size-guide-inline__steps li::before {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  font-size: 15px;
  line-height: 30px;
}

.ring-size-guide-inline--large .ring-size-guide-inline__scroll {
  max-height: 340px;
}

.ring-size-guide-inline--static.ring-size-guide-inline--large .ring-size-guide-inline__scroll {
  max-height: none;
}

.ring-size-guide-inline--large .ring-size-guide-inline__table {
  font-size: 15px;
}

.ring-size-guide-inline--large .ring-size-guide-inline__table th,
.ring-size-guide-inline--large .ring-size-guide-inline__table td {
  padding: 12px 16px;
}

.ring-size-guide-inline--large .ring-size-guide-inline__table thead th {
  font-size: 14px;
}

.ring-size-guide-inline--large .ring-size-guide-inline__note {
  font-size: 14px;
}

.ring-size-guide-inline--large .ring-size-guide-inline__more {
  font-size: 15px;
}

.chain-length-guide-inline__intro,
.chain-length-guide-inline__method {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--color-text-muted);
}

.chain-length-guide-inline__subtitle {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text);
}

.chain-length-guide-inline__table tbody th {
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.ring-size-guide-inline--large .chain-length-guide-inline__intro,
.ring-size-guide-inline--large .chain-length-guide-inline__method {
  font-size: 15px;
}

.ring-size-guide-inline--large .chain-length-guide-inline__subtitle {
  font-size: 16px;
}

body.shop-terms-blocked .shop-calculator-wrap {
  visibility: hidden;
}

body.shop-terms-blocked .shop-page {
  pointer-events: none;
  user-select: none;
}

.shop-terms-dialog:not([open]) {
  display: none;
}

.shop-terms-dialog[open] {
  display: flex;
  flex-direction: column;
  width: min(32rem, calc(100% - 2rem));
  max-height: 80vh;
  margin: auto;
  padding: 0;
  border: 1px solid var(--mint-line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  overflow: hidden;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
}

.shop-terms-dialog::backdrop {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(4px);
}

.shop-terms-header {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  text-align: left;
  background: color-mix(in srgb, var(--mint) 42%, var(--paper));
  border-bottom: 1px solid var(--mint-line);
  border-radius: 8px 8px 0 0;
}

.shop-terms-header h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--ink);
}

.shop-terms-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.shop-terms-dialog:focus {
  outline: none;
}

.shop-terms-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 16px;
  -webkit-overflow-scrolling: touch;
  outline: none;
}

.shop-terms-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.shop-terms-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.shop-terms-section p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-soft);
}

.shop-terms-section p strong {
  font-weight: 600;
  color: var(--ink);
}

.shop-terms-footer {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 16px;
  background: var(--paper-warm);
  border-top: 1px solid var(--mint-line);
  border-radius: 0 0 8px 8px;
}

.shop-terms-scroll-hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink-soft);
  text-align: center;
}

.shop-terms-scroll-hint[hidden] {
  display: none;
}

.shop-terms-footer--ready {
  justify-content: flex-end;
}

.shop-terms-actions {
  display: flex;
  flex: 1 1 100%;
  flex-direction: row;
  gap: 8px;
}

.shop-terms-footer--ready .shop-terms-actions {
  flex: 0 0 auto;
  margin-left: auto;
}

@media (min-width: 640px) {
  .shop-terms-scroll-hint {
    flex: 1 1 auto;
    text-align: left;
    min-width: 0;
  }

  .shop-terms-actions {
    flex: 0 0 auto;
    justify-content: flex-end;
  }
}

.shop-terms-btn {
  flex: 1;
  height: 36px;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

@media (min-width: 640px) {
  .shop-terms-btn {
    flex: none;
    min-width: 88px;
  }
}

.shop-terms-btn--outline {
  background: #fff;
  border-color: var(--mint-line);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(43, 35, 32, 0.06);
}

.shop-terms-btn--outline:hover {
  background: var(--paper);
}

.shop-terms-btn--primary {
  background: var(--ink);
  color: #fff;
}

.shop-terms-btn--primary:hover:not(:disabled) {
  opacity: 0.9;
}

.shop-terms-btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.shop-terms-btn:focus {
  outline: none;
}

.shop-terms-btn:focus-visible {
  outline: 2px solid var(--mint-deep);
  outline-offset: 2px;
}

.ring-size-guide-dialog {
  width: min(760px, calc(100vw - 32px));
  max-height: min(90vh, calc(100vh - 32px));
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  color: var(--color-text);
  padding: 24px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
}

.ring-size-guide-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.ring-size-guide-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.ring-size-guide-header h2 {
  margin: 0 0 6px;
  font-family: var(--font-heading);
  font-size: 24px;
}

.ring-size-guide-header p,
.ring-size-guide-method {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.ring-size-guide-method {
  margin-top: 16px;
}

.ring-size-guide-close {
  flex: 0 0 auto;
  border: 0;
  background: none;
  color: var(--color-text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.ring-size-guide-scroll {
  overflow: auto;
  margin-top: 12px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  max-height: min(340px, 40vh);
  -webkit-overflow-scrolling: touch;
}

.ring-size-guide-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.ring-size-guide-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
}

.ring-size-guide-table th,
.ring-size-guide-table td {
  padding: 9px 10px;
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-border);
}

.ring-size-guide-table thead th {
  background: var(--color-brand);
  color: var(--color-on-brand, #fff);
  font-weight: 600;
  font-size: 12px;
}

.shop-page .ring-size-guide-table thead th {
  background: color-mix(in srgb, var(--shop-cyan, var(--color-brand)) 82%, #0a3d45);
}

body.dark-theme .ring-size-guide-table thead th {
  background: color-mix(in srgb, var(--color-brand) 75%, #0d4f5c);
}

.ring-size-guide-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--color-surface-alt, var(--color-surface)) 55%, transparent);
}

.ring-size-guide-table tbody td:first-child {
  font-weight: 700;
  color: var(--color-text);
  background: var(--color-surface-alt, var(--color-surface));
}

.ring-size-guide-table tbody tr:nth-child(even) td:first-child {
  background: color-mix(in srgb, var(--color-surface-alt, var(--color-surface)) 80%, transparent);
}

.ring-size-guide-table tbody tr:last-child td {
  border-bottom: 0;
}

.guide-method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

@media (max-width: 560px) {
  .guide-method-grid {
    grid-template-columns: 1fr;
  }
}

.guide-card {
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface-alt, color-mix(in srgb, var(--color-surface) 94%, var(--color-text)));
}

.guide-card .guide-section-title {
  margin-bottom: 6px;
  font-size: 15px;
}

.guide-card .guide-section-text {
  margin: 0;
}

.guide-section {
  margin-top: 20px;
}

.guide-section--chart {
  margin-top: 18px;
  margin-bottom: 0;
}

.guide-section--chart .guide-section-title {
  margin-bottom: 0;
}

.guide-section--precautions {
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--shop-cyan-dim, var(--color-surface-alt)) 40%, var(--color-surface));
}

.guide-section--table {
  margin-top: 22px;
  padding-top: 4px;
  border-top: 1px solid var(--color-border);
}

.guide-section-title--sub {
  margin-top: 0;
  font-size: 15px;
}

.guide-section-title {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
}

.guide-section-text {
  margin: 0 0 12px;
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.guide-precautions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 560px) {
  .guide-precautions {
    grid-template-columns: 1fr;
  }
}

.guide-precautions li {
  position: relative;
  padding-left: 14px;
}

.guide-precautions li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--shop-cyan, var(--color-brand));
  font-weight: 700;
}

.guide-precautions li + li {
  margin-top: 0;
}

.engraving-hint {
  margin: 6px 0 0;
  color: var(--color-text-muted);
  font-size: 12px;
}

.pendant-chain-options .variant-group {
  margin-top: 16px;
}

.pendant-chain-options .variant-group:first-of-type {
  margin-top: 12px;
}

.chain-length-guide-table td:last-child {
  text-align: left;
  white-space: normal;
  min-width: 200px;
}

.guide-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  cursor: zoom-in;
}

.guide-image:hover {
  border-color: color-mix(in srgb, var(--color-brand) 45%, var(--color-border));
}

.guide-image.hidden {
  display: none;
}

.variant-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.variant-chips--grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.variant-chips--row {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.variant-chips--row .variant-chip {
  flex: 1 1 0;
  min-width: 4.5rem;
  text-align: center;
  border-radius: 8px;
  padding: 12px 8px;
  white-space: nowrap;
}

.variant-chips--grid .variant-chip {
  width: 100%;
  text-align: center;
  border-radius: 8px;
  padding: 12px 10px;
}

.variant-chips--colors {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.color-swatch-round {
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0 !important;
  border-radius: 999px !important;
  border: 2px solid var(--color-border) !important;
  position: relative;
  font-size: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.color-swatch-labeled {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 56px;
  padding: 8px 10px !important;
  border-radius: 10px !important;
  border: 1px solid var(--color-border) !important;
  background: var(--color-surface);
  font-size: inherit;
  box-shadow: none;
}

.color-swatch-dot {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid var(--color-border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.color-swatch-dot[data-color="white"],
.color-swatch-round[data-color="white"] { background: linear-gradient(135deg, #f5f5f5, #d8d8d8) !important; }
.color-swatch-dot[data-color="yellow"],
.color-swatch-round[data-color="yellow"] { background: linear-gradient(135deg, #e8c547, #c9a227) !important; }
.color-swatch-dot[data-color="rose"],
.color-swatch-round[data-color="rose"] { background: linear-gradient(135deg, #d48793, #b76e79) !important; }

.color-swatch-label {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  color: var(--color-text);
  white-space: nowrap;
}

.color-swatch-labeled.active .color-swatch-dot {
  border-color: var(--color-accent-ink);
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-accent);
}

.color-swatch-labeled.active::after {
  display: none;
}

.color-swatch-round.active {
  border-color: var(--color-accent-ink) !important;
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-accent);
}

.color-swatch-round.active::after {
  content: "";
  display: block;
  position: absolute;
  inset: 0;
  margin: auto;
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.35));
}

.variant-chip {
  padding: 10px 16px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.variant-chip:hover:not(:disabled):not(.is-disabled) {
  border-color: var(--color-text-muted);
  background: var(--color-surface-alt);
}

/* Active state — readable text (overrides global dark invert in style.css) */
.shop-page .variant-chip.active,
.shop-page .carat-btn.active,
.shop-page .metal-btn.active,
.shop-page .color-btn.active,
.shop-page .ring-size-btn.active {
  background: color-mix(in srgb, var(--color-accent) 18%, var(--color-surface));
  border-color: var(--color-accent);
  color: var(--color-text);
  font-weight: 600;
  box-shadow: inset 0 -3px 0 var(--color-accent);
}

.shop-page .variant-chip.active::after,
.shop-page .carat-btn.active::after,
.shop-page .metal-btn.active::after,
.shop-page .color-btn.active::after,
.shop-page .ring-size-btn.active::after {
  display: none;
}

.variant-chip:disabled,
.variant-chip.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.color-swatch[data-color="white"]::before,
.color-swatch[data-color="yellow"]::before,
.color-swatch[data-color="rose"]::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  border: 1px solid rgba(0, 0, 0, 0.15);
}

.color-swatch[data-color="white"]::before { background: #e8e8e8; }
.color-swatch[data-color="yellow"]::before { background: #d4af37; }
.color-swatch[data-color="rose"]::before { background: #b76e79; }

/* Price panel — sticky checkout card */
.shop-price-panel {
  position: sticky;
  top: 24px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 24px 22px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
}

.hero-price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 8px;
}

.hero-price-currency {
  font-size: 18px;
  font-weight: 500;
  color: var(--color-text-muted);
}

.hero-price-amount {
  font-family: var(--font-heading);
  font-size: clamp(32px, 4vw, 42px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hero-price-hint {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 0 0 16px;
}

.hero-price-disclaimer {
  margin: 0 0 16px;
  color: var(--color-text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.hero-price-hint.hidden {
  display: none;
}

.price-breakdown-panel {
  margin-bottom: 20px;
  padding-top: 4px;
  border-top: 1px solid var(--color-border);
}

.price-breakdown-details {
  margin-bottom: 20px;
  border-top: 1px solid var(--color-border);
  padding-top: 4px;
}

.price-breakdown-details > .price-breakdown-panel {
  margin-bottom: 0;
  padding-top: 0;
  border-top: none;
}

.price-breakdown-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 16px 0 12px;
}

.price-breakdown-details > .price-breakdown-title {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.price-breakdown-details > .price-breakdown-title::-webkit-details-marker {
  display: none;
}

/* Desktop: keep breakdown always visible (no accordion chrome) */
@media (min-width: 901px) {
  .price-breakdown-details {
    border-top: none;
    padding-top: 0;
  }

  .price-breakdown-details > .price-breakdown-title {
    pointer-events: none;
    cursor: default;
  }

  .price-breakdown-details > .price-breakdown-panel {
    display: block !important;
  }
}

.breakdown-rows {
  padding: 0;
}

/* Aligned label : value columns */
.breakdown-rows .summary-row {
  display: grid;
  grid-template-columns: minmax(6.5em, auto) 1em 1fr;
  align-items: baseline;
  gap: 0;
  font-size: 13px;
  padding: 5px 0;
  color: var(--color-text-muted);
}

.breakdown-rows .summary-row .lbl {
  text-align: right;
  padding-right: 2px;
  white-space: nowrap;
}

.breakdown-rows .summary-row .colon {
  text-align: center;
}

.breakdown-rows .summary-row .val {
  text-align: right;
  color: var(--color-text);
  font-weight: 600;
  word-break: break-word;
}

.breakdown-rows hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 10px 0;
  grid-column: 1 / -1;
}

.shop-cta {
  width: 100%;
  padding: 16px 24px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: none;
  border-radius: 10px;
  background: var(--color-brand);
  color: var(--color-on-brand, var(--color-accent-ink));
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, opacity 0.15s;
}

.shop-cta:hover:not(:disabled) {
  background: var(--color-brand-hover);
  transform: translateY(-1px);
}

.shop-cta:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Mobile sticky buy bar */
.mobile-buy-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  box-sizing: border-box;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px) saturate(1.35);
  -webkit-backdrop-filter: blur(20px) saturate(1.35);
  border-top: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    0 -8px 28px rgba(43, 35, 32, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.mobile-buy-price {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-buy-label {
  font-size: 11px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.mobile-buy-amount {
  font-family: var(--font-heading);
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-text);
}

.shop-cta-compact {
  width: auto;
  min-width: 140px;
  padding: 12px 20px;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .shop-body {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* Product first — never pin the price card over selections */
  .shop-main {
    order: 1;
  }

  .shop-price-panel {
    position: static;
    top: auto;
    z-index: auto;
    order: 2;
    box-shadow: none;
    padding: 14px 16px;
    display: none;
  }

  .shop-price-panel.is-mobile-open {
    display: block;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(
      var(--shop-mobile-buy-bar-height, calc(80px + env(safe-area-inset-bottom, 0px)))
      + 8px
    );
    z-index: 99;
    max-height: min(
      70dvh,
      440px,
      calc(
        100dvh
        - var(--shop-mobile-buy-bar-height, calc(80px + env(safe-area-inset-bottom, 0px)))
        - var(
          --shop-mobile-site-chrome-height,
          var(--shop-summary-sticky-top, calc(76px + 2.25rem + 10px))
        )
        - 16px
      )
    );
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(22px) saturate(1.4);
    -webkit-backdrop-filter: blur(22px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 16px;
    box-shadow:
      0 12px 40px rgba(43, 35, 32, 0.14),
      0 0 0 1px rgba(94, 207, 207, 0.14);
  }

  .shop-price-panel.is-mobile-open .hero-price-amount,
  .shop-price-panel.is-mobile-open .breakdown-rows .summary-row .val {
    color: var(--color-text);
  }

  .product-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .product-gallery-col {
    position: static;
    max-width: min(100%, 480px);
  }

  .product-image-thumbs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .product-gallery-nav {
    width: 36px;
    height: 36px;
  }

  .product-preview {
    max-height: min(48vh, 360px);
  }

  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .shop-price-panel .shop-cta,
  .shop-price-panel .shop-action-row,
  .hero-price-disclaimer,
  .shop-secondary-actions,
  .shop-price-panel .studio-credit {
    display: none;
  }

  .hero-price-amount {
    font-size: 28px;
  }

  .price-breakdown-details:not([open]) .price-breakdown-panel {
    display: none;
  }

  .price-breakdown-details > .price-breakdown-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 8px 0 0;
    padding: 8px 0;
  }

  .price-breakdown-details > .price-breakdown-title::after {
    content: "▾";
    font-size: 0.75rem;
    opacity: 0.7;
  }

  .price-breakdown-details[open] > .price-breakdown-title::after {
    content: "▴";
  }

  .mobile-buy-bar:not(.hidden) {
    display: flex;
  }

  .mobile-buy-price {
    appearance: none;
    border: none;
    background: transparent;
    text-align: left;
    padding: 0;
    cursor: pointer;
    color: inherit;
    font: inherit;
    min-width: 0;
  }

  .mobile-buy-detail-hint {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.2;
    color: var(--color-text-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
  }
}

@media (min-width: 901px) {
  .mobile-buy-bar {
    display: none !important;
  }

  .mobile-buy-detail-hint {
    display: none;
  }
}

/* Fancy diamond color + shape carousels */
.diamond-carousel-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.diamond-carousel-nav {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--color-border, #ddd);
  background: #fff;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.diamond-carousel-nav:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

.diamond-carousel-nav[hidden] {
  display: none;
}

.diamond-carousel-wrap--no-nav {
  gap: 0;
}

.diamond-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 8px 4px 12px;
  flex: 1;
  scrollbar-width: none;
}

.diamond-carousel::-webkit-scrollbar {
  display: none;
}

.diamond-carousel-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 72px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  transition: transform 0.2s ease;
}

.diamond-carousel-item .gem-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px solid transparent;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: width 0.2s ease, height 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.diamond-carousel-item .gem-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.diamond-carousel-item.active .gem-icon {
  width: 72px;
  height: 72px;
  border-color: var(--color-accent, #b8860b);
}

.diamond-carousel-item .gem-label {
  font-family: var(--font-heading, Georgia, serif);
  font-size: 12px;
  color: var(--color-text-muted);
  transition: font-size 0.2s ease, color 0.2s ease;
}

.diamond-carousel-item.active .gem-label {
  font-size: 14px;
  color: var(--color-text);
  font-weight: 600;
}

.diamond-carousel-item.shape-item .gem-icon {
  border-radius: 50%;
  background: #fff;
}

.variant-chips--matrix-shapes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.variant-chips--matrix-shapes .diamond-carousel-item {
  flex: 0 0 calc(20% - 8px);
  min-width: 72px;
  max-width: 96px;
}

@media (max-width: 640px) {
  .variant-chips--matrix-shapes .diamond-carousel-item {
    flex: 0 0 calc(25% - 8px);
    min-width: 64px;
  }
}

.fancy-stone-label {
  margin-top: 8px;
}

.diamond-shape-hint {
  margin: 0.625rem 0 0;
  padding: 0.5rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.5;
  color: #9a5b42;
  background: rgba(181, 101, 76, 0.08);
  border-left: 3px solid #b5654c;
  border-radius: 0 6px 6px 0;
}

.shop-fancy-min-note {
  color: #c62828;
  font-weight: 600;
}

.shop-fit .diamond-shape-hint {
  margin-top: 0.5rem;
  font-size: 0.6875rem;
  color: #9a5b42;
  background: color-mix(in srgb, #b5654c 10%, transparent);
  border-left-color: #b5654c;
}

/* Stone count stepper — plus/minus integer field */
.stone-count-stepper {
  max-width: 16rem;
}

.stone-count-field {
  display: inline-flex;
  align-items: center;
  width: 100%;
  height: 2.25rem;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  background: var(--color-surface);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.stone-count-field:focus-within {
  border-color: var(--shop-cyan, var(--color-border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--shop-cyan, #1aa8ad) 20%, transparent);
  outline: none;
}

.stone-count-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-inline: 1px solid var(--color-border);
  background: var(--color-surface);
  color: color-mix(in srgb, var(--color-text-muted) 80%, transparent);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.stone-count-btn--dec {
  border-inline-start: 0;
  border-radius: 0.5rem 0 0 0.5rem;
}

.stone-count-btn--inc {
  border-inline-end: 0;
  border-radius: 0 0.5rem 0.5rem 0;
}

.stone-count-btn:hover:not(:disabled) {
  background: color-mix(in srgb, var(--shop-cyan, #1aa8ad) 12%, var(--color-surface));
  color: var(--color-text);
}

.stone-count-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.stone-count-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  margin: 0;
  padding: 0 0.75rem;
  border: 0;
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}

.stone-count-input:focus {
  outline: none;
}

.stone-count-input::-webkit-outer-spin-button,
.stone-count-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.shop-fit .stone-count-stepper {
  max-width: 14rem;
}

.shop-fit .stone-count-field {
  height: 2rem;
  font-size: 0.8125rem;
}

.shop-fit .stone-count-input {
  font-size: 0.8125rem;
}

.stone-count-discount {
  margin-top: 0.625rem;
  max-width: 20rem;
}

.stone-count-discount__title {
  margin: 0 0 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.stone-count-discount-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.6875rem;
  line-height: 1.4;
}

.stone-count-discount-table th,
.stone-count-discount-table td {
  padding: 0.3125rem 0.5rem;
  border: 1px solid var(--color-border);
  text-align: center;
}

.stone-count-discount-table thead th {
  background: color-mix(in srgb, var(--shop-cyan, #1aa8ad) 8%, var(--color-surface));
  font-weight: 600;
  color: var(--color-text-muted);
}

.stone-count-discount-table tbody th {
  text-align: left;
  font-weight: 600;
  background: var(--color-surface);
  color: var(--color-text);
  white-space: nowrap;
}

.stone-count-discount-table tbody td {
  font-variant-numeric: tabular-nums;
  color: var(--color-text);
}

.stone-count-discount__note {
  margin: 0.375rem 0 0;
  font-size: 0.6875rem;
}

.shop-fit .stone-count-discount {
  max-width: 18rem;
}

.shop-fit .stone-count-discount__title {
  font-size: 0.6875rem;
}

.shop-fit .stone-count-discount-table {
  font-size: 0.625rem;
}

.shop-fit .stone-count-discount-table th,
.shop-fit .stone-count-discount-table td {
  padding: 0.25rem 0.375rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Compact viewport-fit shop — full width, minimal scroll
   ═══════════════════════════════════════════════════════════════════════════ */

body.app-shell .page-container:has(.shop-fit) {
  max-width: 1480px;
  padding: 0.75rem 1rem 1rem;
}

body.app-shell .main-content:has(.shop-fit) {
  padding-left: 0;
  padding-bottom: 0;
}

body.app-shell.dark-theme .shop-fit {
  --shop-cyan: #8eedf0;
  --shop-cyan-dim: rgba(142, 237, 240, 0.16);
  --shop-cyan-border: rgba(142, 237, 240, 0.14);
}

body.app-shell:not(.dark-theme) .shop-fit {
  --shop-cyan: #1aa8ad;
  --shop-cyan-dim: rgba(26, 168, 173, 0.12);
  --shop-cyan-border: rgba(26, 168, 173, 0.2);
}

.shop-fit {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 5.25rem);
  min-height: 0;
  max-width: none;
  margin: 0;
}

@media (min-width: 1101px) {
  body.app-shell:has(.shop-fit) {
    overflow: hidden;
  }
}

.shop-fit .shop-edit-notice {
  flex-shrink: 0;
  margin: 0 0 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 8px;
  background: var(--shop-cyan-dim);
}

.shop-fit .shop-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.625rem;
  margin-bottom: 0.625rem;
  border-bottom: 1px solid var(--color-border);
}

.shop-fit .shop-toolbar .shop-breadcrumb {
  font-size: 0.75rem;
  min-width: 0;
}

.shop-fit .shop-progress {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

.shop-fit .shop-progress-bar {
  width: 5rem;
  height: 2px;
  background: var(--shop-cyan-border);
  border-radius: 999px;
  overflow: hidden;
}

.shop-fit .shop-progress-fill {
  display: block;
  height: 100%;
  width: 8%;
  background: var(--shop-cyan);
  border-radius: 999px;
  transition: width 0.35s ease;
}

.shop-fit .shop-progress-dots {
  display: flex;
  gap: 0.3rem;
}

.shop-fit .shop-progress-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--shop-cyan-border);
  transition: all 0.25s ease;
}

.shop-fit .shop-progress-dot.is-active {
  width: 0.875rem;
  background: var(--shop-cyan);
}

.shop-fit .shop-progress-dot.is-done {
  background: color-mix(in srgb, var(--shop-cyan) 45%, transparent);
}

/* Scroll parent for options+summary AND length guide — sticky panel stops at .shop-body end */
.shop-fit .shop-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.shop-fit .shop-body {
  flex: none;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 0.875rem;
  align-items: start;
  position: relative;
}

.shop-fit .shop-main {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.shop-fit .shop-section:not(.hidden) {
  flex: none;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.shop-fit .shop-section-title {
  font-size: 1rem;
  margin: 0 0 0.625rem;
  flex-shrink: 0;
}

.shop-fit .shop-back {
  margin-bottom: 0.375rem;
  font-size: 0.8125rem;
  flex-shrink: 0;
}

/* Catalog — five tiles in one row (imprint-calculator shop-fit) */
.shop-fit .catalog-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  align-content: center;
  align-items: start;
  min-height: 0;
  overflow: visible;
}

.shop-fit .catalog-tile {
  border-radius: 14px;
  gap: 0;
  padding: 0;
  min-height: 0;
}

.shop-fit .catalog-tile img {
  width: 100%;
  aspect-ratio: 1;
  max-height: none;
  object-fit: contain;
  object-position: center;
  display: block;
  padding: 0.35rem;
  box-sizing: border-box;
}

.shop-fit .catalog-tile span {
  padding: 0 12px 16px;
  font-size: 15px;
  font-weight: 500;
}

.shop-fit .catalog-tile.active {
  border-color: var(--shop-cyan);
  box-shadow: 0 0 0 1px var(--shop-cyan);
}

/* Style grid — smart layout fills viewport by item count */
.shop-fit #shop-styles {
  min-height: 0;
}

.shop-fit #shop-styles .type-grid {
  flex: 1;
  min-height: 0;
  align-content: center;
  justify-content: center;
}

.shop-fit #shop-styles .type-grid:not(.type-grid--size-xs) {
  overflow: hidden;
}

.shop-fit #shop-styles .type-grid.type-grid--size-xs {
  align-content: start;
  overflow-y: auto;
  scrollbar-width: thin;
}

.shop-fit #shop-styles .type-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  text-align: center;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.shop-fit #shop-styles .type-card:hover {
  border-color: var(--shop-cyan);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

.shop-fit #shop-styles .type-card.active {
  border-color: var(--shop-cyan);
  box-shadow: 0 0 0 1px var(--shop-cyan);
}

@media (max-width: 720px) {
  .shop-fit #shop-styles .type-grid.type-grid--size-lg[data-count="3"] {
    --type-cols: 2;
    max-width: min(100%, 520px);
  }

  .shop-fit #shop-styles .type-grid.type-grid--size-md[data-count="4"] {
    --type-cols: 2;
  }

  .shop-fit #shop-styles .type-grid.type-grid--size-sm {
    --type-cols: 2;
  }
}

@media (min-width: 1100px) {
  .shop-fit #shop-styles .type-grid.type-grid--size-md[data-count="4"] {
    --type-cols: 4;
    max-width: min(100%, calc(4 * 240px));
  }
}

/* Product — image left, options right, fits viewport */
.shop-fit.shop-view--product .shop-body {
  grid-template-columns: minmax(0, 1fr) 248px;
}

.shop-fit #shop-product {
  overflow: visible;
}

.shop-fit .shop-main {
  min-height: 0;
  overflow: visible;
}

.shop-fit .product-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(180px, 38%) minmax(0, 1fr);
  gap: 0.875rem;
  align-items: start;
  height: auto;
}

.shop-fit .product-gallery-col {
  position: static;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.shop-fit .product-preview {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-height: none;
  aspect-ratio: auto;
  height: 100%;
  border-radius: 12px;
}

.shop-fit .product-image-thumbs {
  flex-shrink: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.375rem;
  margin-top: 0.375rem;
}

.shop-fit .product-thumb-btn {
  border-radius: 6px;
}

.shop-fit .product-buy-col {
  min-height: 0;
  overflow: visible;
  padding-right: 0.25rem;
}

.shop-fit .product-info-header {
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
}

.shop-fit .product-subtitle {
  margin-bottom: 0.25rem;
  font-size: 0.6875rem;
}

.shop-fit .product-title {
  font-size: 1.125rem;
  margin-bottom: 0.375rem;
}

.shop-fit .config-chips {
  gap: 0.375rem;
}

.shop-fit .config-chip {
  padding: 2px 8px;
  font-size: 0.6875rem;
}

.shop-fit .product-info-tabs {
  display: none;
}

.shop-fit .product-options-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 0.875rem;
  row-gap: 0.375rem;
  overflow: visible;
}

.shop-fit .variant-group--nested {
  margin-top: 0.375rem;
  margin-bottom: 0;
}

.shop-fit #chain-length-end.hidden,
.shop-fit #chain-length-step.hidden,
.shop-fit #chain-length-guide-step.hidden,
.shop-fit #stone-count-step.hidden,
.shop-fit #pendant-chain-guide-step.hidden,
.shop-fit #pendant-chain-step.hidden,
.shop-fit #ringsize-step.hidden,
.shop-fit #ringsize-guide-step.hidden,
.shop-fit #engraving-band-step.hidden,
.shop-fit #engraving-girdle-step.hidden,
.shop-fit #fancy-diamond-step.hidden,
.shop-fit #diamond-shape-step.hidden,
.shop-fit #carat-step.hidden {
  display: none;
}

/* Keep metal+color 2-col slot; hide color content without collapsing layout */
.shop-fit #color-step.hidden {
  visibility: hidden;
  pointer-events: none;
}

/* Chain styles lock color in step 2 — drop the empty color column */
.shop-fit #color-step.hidden-collapse {
  display: none;
  visibility: visible;
  pointer-events: auto;
}

/* ...and let metal-step take the full row instead of staying half-width */
.shop-fit #metal-step:has(+ #color-step.hidden-collapse) {
  grid-column: 1 / -1;
}
.shop-fit #metal-step:has(+ #color-step.hidden-collapse) #metal-btn-row {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}


.shop-fit #diamond-shape-step,
.shop-fit #pendant-chain-step,
.shop-fit #chain-length-step {
  grid-column: 1 / -1;
}

/* Full options row; stay inside column (no overflow into price panel) */
.shop-fit #engraving-girdle-step {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  justify-self: stretch;
}

.shop-fit #ringsize-guide-step,
.shop-fit #chain-length-end {
  margin-top: 0;
  padding: 0.875rem 0 1rem;
  border-top: 1px solid var(--color-border);
}

.shop-fit #chain-length-end .variant-group {
  margin-bottom: 0.5rem;
}

.shop-fit #chain-length-end .variant-group--size-guide {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  border-top: none;
}

.shop-fit .chain-length-guide-inline__layout,
.shop-fit .ring-size-guide-inline__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.shop-fit .chain-length-guide-inline__aside .guide-image,
.shop-fit .ring-size-guide-inline__aside .guide-image {
  margin-bottom: 0;
}

.shop-fit .chain-length-guide-inline__table-col .ring-size-guide-inline__scroll,
.shop-fit .ring-size-guide-inline__table-col .ring-size-guide-inline__scroll {
  max-height: none;
  overflow: visible;
}

.shop-fit #ringsize-guide-step .ring-size-guide-inline__steps {
  margin-bottom: 0.5rem;
  gap: 0.375rem;
}

.shop-fit #ringsize-guide-step .ring-size-guide-inline__steps li {
  padding: 0.5rem 0.625rem;
  font-size: 0.75rem;
  line-height: 1.4;
}

.shop-fit #ringsize-guide-step .ring-size-guide-inline__steps li::before {
  flex: 0 0 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
  font-size: 0.6875rem;
  line-height: 1.25rem;
}

.shop-fit #ringsize-guide-step .ring-size-guide-inline__note {
  margin-top: 0.5rem;
  font-size: 0.6875rem;
}

.shop-fit .chain-length-guide-inline__intro,
.shop-fit .chain-length-guide-inline__method,
.shop-fit .chain-length-guide-inline__subtitle {
  margin-bottom: 0.375rem;
  font-size: 0.6875rem;
  line-height: 1.45;
}

.shop-fit .chain-length-guide-inline .ring-size-guide-inline__title {
  min-height: 0;
  margin-bottom: 0.375rem;
  font-size: 0.75rem;
}

.shop-fit .variant-label {
  font-size: 0.625rem;
  margin-bottom: 0.375rem;
  letter-spacing: 0.08em;
}

.shop-fit .variant-label-row {
  margin-bottom: 0.25rem;
}

.shop-fit .product-buy-col .variant-chips {
  gap: 0.375rem;
}

.shop-fit .product-buy-col .variant-chips:not(.variant-chips--colors) {
  display: flex;
  flex-wrap: wrap;
}

.shop-fit .variant-chips--row {
  overflow-x: visible;
}

.shop-fit .variant-chips--colors {
  display: flex;
  flex-wrap: wrap;
}

.shop-fit .product-buy-col .variant-chips:not(.variant-chips--colors) .variant-chip {
  flex: 0 1 auto;
}

.shop-fit .variant-chips--colors .color-btn {
  flex: 0 1 auto;
}

.shop-fit .variant-chip,
.shop-fit .carat-btn,
.shop-fit .metal-btn,
.shop-fit .color-btn {
  padding: 0.3125rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 500;
  white-space: nowrap;
}

.shop-fit .variant-chips--row .variant-chip {
  min-width: 0;
  width: auto;
}

/* Form on top, diamond below — same left edge, same column width */
.shop-fit .shop-girdle-engrave {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
  max-width: 22rem;
}

.shop-fit .shop-girdle-engrave__form {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  width: 100%;
  min-width: 0;
}

.shop-fit .shop-girdle-engrave .cfg-emblems {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.shop-fit .shop-girdle-engrave .cfg-engrave-input {
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  width: 100%;
  box-sizing: border-box;
}

.shop-fit .shop-girdle-engrave .cfg-count {
  font-size: 0.6875rem;
  text-align: left;
  white-space: nowrap;
}

.shop-fit .shop-girdle-engrave .cfg-engrave-hint {
  white-space: nowrap;
  margin: 0;
}

.shop-fit .shop-girdle-engrave .cfg-engrave-label {
  margin: 0.5rem 0 0.25rem;
  white-space: nowrap;
}

.shop-fit .shop-girdle-engrave__preview,
.shop-fit .shop-girdle-engrave .cfg-engrave-preview {
  margin-top: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.shop-fit .shop-girdle-engrave .cfg-engrave-gem-picture {
  display: block;
  width: 100%;
}

.shop-fit .shop-girdle-engrave .cfg-engrave-gem {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.shop-fit .shop-girdle-engrave .cfg-engrave-preview-text {
  font-size: clamp(14px, 1.85vw, 18px);
  letter-spacing: 0.14em;
  font-weight: 700;
  line-height: 1.1;
  gap: 3px;
}

.shop-fit .shop-girdle-engrave .cfg-engrave-preview-text .cfg-emblem-token {
  width: 16px;
  height: 16px;
}

.shop-fit .ring-size-select,
.shop-fit .carat-select,
.shop-fit .engraving-input {
  max-width: 16rem;
  padding: 0.375rem 0.625rem;
  font-size: 0.8125rem;
}

.shop-fit .engraving-hint {
  font-size: 0.6875rem;
  margin-top: 0.25rem;
}

.shop-fit .diamond-carousel-wrap {
  margin-bottom: 0.375rem;
  gap: 0.375rem;
  display: block;
}

.shop-fit .diamond-carousel-wrap .diamond-carousel-nav {
  display: none;
}

.shop-fit .diamond-carousel {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  padding: 0.25rem 0 0.375rem;
  overflow: visible;
}

.shop-fit .diamond-carousel-item {
  flex: 0 0 auto;
  min-width: 0;
  width: auto;
  gap: 0.25rem;
}

.shop-fit .diamond-carousel-item .gem-icon {
  width: 40px;
  height: 40px;
}

.shop-fit .diamond-carousel-item.active .gem-icon {
  width: 40px;
  height: 40px;
  border-color: var(--shop-cyan);
}

.shop-fit .diamond-carousel-item .gem-label,
.shop-fit .diamond-carousel-item.active .gem-label {
  font-size: 0.625rem;
  font-weight: 500;
}

.shop-fit .diamond-carousel-item.active .gem-label {
  color: var(--color-text);
  font-weight: 600;
}

.shop-fit .diamond-carousel-item.active {
  background: var(--shop-cyan-dim);
  border-radius: 8px;
  box-shadow: inset 0 0 0 2px var(--shop-cyan);
}

.shop-fit .diamond-shape-btn.active.variant-chip {
  border-color: var(--shop-cyan);
  background: var(--shop-cyan-dim);
  color: var(--color-text);
  font-weight: 600;
  box-shadow: inset 0 -3px 0 var(--shop-cyan), 0 0 0 1px var(--shop-cyan);
}

.diamond-shape-other-wrap {
  width: 100%;
  max-width: 18rem;
  margin-top: 0.75rem;
}

.diamond-shape-other-wrap[hidden],
.diamond-shape-other-wrap.hidden {
  display: none;
}

.variant-label--sub {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--color-text-muted);
}

.diamond-shape-picker {
  position: relative;
  width: 100%;
}

.diamond-shape-picker__trigger {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.625rem;
  width: 100%;
  min-height: 3rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.diamond-shape-picker__trigger:hover,
.diamond-shape-picker__trigger[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--shop-cyan) 58%, var(--color-border));
  background: color-mix(in srgb, var(--shop-cyan-dim) 48%, var(--color-surface));
}

.diamond-shape-picker__trigger:focus-visible {
  outline: none;
  border-color: var(--shop-cyan);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--shop-cyan) 28%, transparent);
}

.diamond-shape-picker__avatar {
  flex: 0 0 1.75rem;
  width: 1.75rem;
  height: 1.75rem;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--color-border) 76%, #fff);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(24, 28, 30, 0.1);
}

.diamond-shape-picker__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.diamond-shape-picker__text {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
}

.diamond-shape-picker__value,
.diamond-shape-picker__meta {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diamond-shape-picker__value {
  font-weight: 600;
  color: var(--color-text);
}

.diamond-shape-picker__meta {
  font-size: 0.6875rem;
  color: var(--color-text-muted);
}

.diamond-shape-picker__chevrons {
  flex: 0 0 auto;
  opacity: 0.5;
}

.diamond-shape-picker__trigger--placeholder .diamond-shape-picker__value {
  font-weight: 500;
  color: var(--color-text-muted);
}

.diamond-shape-picker__trigger--placeholder .diamond-shape-picker__avatar {
  display: none;
}

.diamond-shape-picker__popover {
  position: absolute;
  z-index: 120;
  top: calc(100% + 0.375rem);
  left: 0;
  box-sizing: border-box;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: 0 14px 34px rgba(24, 28, 30, 0.16);
}

.diamond-shape-picker__popover[hidden] {
  display: none;
}

.diamond-shape-picker__title {
  padding: 0.625rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.diamond-shape-picker__options {
  max-height: min(300px, 40dvh);
  overflow-y: auto;
  padding: 0.25rem;
  overscroll-behavior: contain;
}

.diamond-shape-picker__option {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
}

.diamond-shape-picker__option:hover,
.diamond-shape-picker__option:focus-visible,
.diamond-shape-picker__option[aria-selected="true"] {
  outline: none;
  background: var(--shop-cyan-dim);
}

.diamond-shape-picker__option[aria-selected="true"] .diamond-shape-picker__value {
  font-weight: 700;
}

.diamond-shape-picker__check {
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--shop-cyan);
  opacity: 0;
}

.diamond-shape-picker__option[aria-selected="true"] .diamond-shape-picker__check {
  opacity: 1;
}

@media (max-width: 640px) {
  .diamond-shape-picker__option {
    min-height: 3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .diamond-shape-picker__trigger {
    transition: none;
  }
}

.shop-fit .variant-chip.active,
.shop-fit .carat-btn.active,
.shop-fit .metal-btn.active,
.shop-fit .color-btn.active {
  border-width: 1px;
  border-color: var(--shop-cyan);
  background: var(--shop-cyan-dim);
  color: var(--color-text);
  font-weight: 500;
  box-shadow: inset 0 -3px 0 var(--shop-cyan);
}

/* Segmented buttons: 不含鍊 | 含鍊 (when admin opens both sell modes) */
.shop-fit .pendant-chain-seg {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  margin: 4px 0 8px;
  padding: 3px;
  border: 1px solid var(--color-border, #ddd5cc);
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-surface, #fff) 92%, #f3f0ec);
}
.shop-fit .pendant-chain-seg__btn {
  appearance: none;
  flex: 1 1 auto;
  min-width: 5.5rem;
  margin: 0;
  padding: 0.45rem 0.9rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--color-text-muted, #6b6560);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.shop-fit .pendant-chain-seg__btn:hover {
  color: var(--color-text, #2b2320);
}
.shop-fit .pendant-chain-seg__btn.is-active {
  background: var(--color-surface, #fff);
  color: var(--color-text, #2b2320);
  box-shadow: 0 1px 2px rgba(43, 35, 32, 0.08);
}
.shop-fit .pendant-chain-seg__btn:focus-visible {
  outline: 2px solid var(--shop-cyan, #5ecfcf);
  outline-offset: 1px;
}

/* Length dropdown — always opens downward */
.shop-fit .shop-dd {
  position: relative;
  width: 100%;
  max-width: 16rem;
  z-index: 5;
}
.shop-fit .shop-dd.is-open {
  z-index: 60;
}
.shop-fit .pendant-chain-length,
.shop-fit #chain-length-step {
  overflow: visible;
}
.shop-fit .shop-dd__trigger {
  box-sizing: border-box;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 2.25rem;
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}
.shop-fit .shop-dd__trigger:hover,
.shop-fit .shop-dd.is-open .shop-dd__trigger {
  border-color: color-mix(in srgb, var(--shop-cyan) 58%, var(--color-border));
  background: color-mix(in srgb, var(--shop-cyan-dim) 40%, var(--color-surface));
}
.shop-fit .shop-dd__trigger:focus-visible {
  outline: none;
  border-color: var(--shop-cyan);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--shop-cyan) 28%, transparent);
}
.shop-fit .shop-dd__trigger--placeholder .shop-dd__label {
  color: var(--color-text-muted);
}
.shop-fit .shop-dd__label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.shop-fit .shop-dd__chevron {
  flex: 0 0 auto;
  opacity: 0.55;
  transition: transform 0.2s ease;
}
.shop-fit .shop-dd.is-open .shop-dd__chevron {
  transform: rotate(180deg);
}
.shop-fit .shop-dd__menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  z-index: 40;
  box-sizing: border-box;
  width: 100%;
  max-height: min(280px, 40dvh);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.25rem 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: 0 12px 28px rgba(24, 28, 30, 0.14);
  transform-origin: top center;
  animation: shop-dd-in 0.18s ease;
}
.shop-fit .shop-dd__menu[hidden] {
  display: none;
}
@keyframes shop-dd-in {
  from { opacity: 0; transform: translateY(-6px) scaleY(0.96); }
  to { opacity: 1; transform: translateY(0) scaleY(1); }
}
.shop-fit .shop-dd__option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.5rem 0.75rem;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
}
.shop-fit .shop-dd__option:hover,
.shop-fit .shop-dd__option:focus-visible {
  outline: none;
  background: var(--shop-cyan-dim);
}
.shop-fit .shop-dd__option.is-selected {
  background: color-mix(in srgb, var(--shop-cyan-dim) 70%, transparent);
  color: var(--shop-cyan, #2b2320);
  font-weight: 600;
}
@media (prefers-reduced-motion: reduce) {
  .shop-fit .shop-dd__menu { animation: none; }
  .shop-fit .shop-dd__chevron { transition: none; }
}

.shop-fit .color-swatch-labeled {
  min-width: 48px;
  padding: 6px 8px !important;
  gap: 4px;
  white-space: normal;
}

.shop-fit .color-swatch-labeled.active {
  border-width: 1px !important;
  font-weight: 500;
}

.shop-fit .color-swatch-dot {
  width: 24px;
  height: 24px;
}

.shop-fit .color-swatch-label {
  font-size: 0.625rem;
  font-weight: 500;
}

.shop-fit .color-swatch-labeled.active .color-swatch-label {
  font-weight: 500;
}

.shop-fit .color-swatch-labeled.active .color-swatch-dot {
  border-color: var(--shop-cyan) !important;
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--shop-cyan) !important;
}

.shop-fit .color-swatch-round.active {
  border-color: var(--shop-cyan) !important;
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--shop-cyan) !important;
}

.shop-fit #pendant-chain-options .variant-chips--grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.shop-fit #pendant-chain-options .variant-chips--grid .variant-chip {
  flex: 0 1 auto;
  white-space: nowrap;
}

.shop-fit #pendant-chain-options .variant-chip.active {
  border-color: var(--shop-cyan);
  background: var(--shop-cyan-dim);
}

.shop-fit #pendant-chain-color-step .variant-chips--colors {
  gap: 0.625rem;
}

/* Price panel — compact sidebar, stops at content height */
.shop-fit .shop-price-panel {
  position: sticky;
  top: 0;
  align-self: start;
  height: auto;
  max-height: calc(100dvh - 5.25rem - 0.5rem);
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0.875rem;
  border-radius: 12px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.shop-fit .hero-price {
  margin-bottom: 0.25rem;
}

.shop-fit .hero-price-currency {
  font-size: 0.875rem;
}

.shop-fit .hero-price-amount {
  font-size: 1.625rem;
  color: var(--shop-cyan);
}

.shop-fit .hero-price-hint {
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}

.shop-fit .hero-price-disclaimer {
  display: none;
}

.shop-fit .price-breakdown-details {
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0.625rem;
  overflow: visible;
}

.shop-fit .price-breakdown-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin-bottom: 0;
  scrollbar-width: thin;
}

.shop-fit .price-breakdown-title {
  font-size: 0.6875rem;
  margin: 0.5rem 0 0.375rem;
  flex-shrink: 0;
}

.shop-fit .breakdown-rows .summary-row {
  font-size: 0.75rem;
  padding: 0.1875rem 0;
}

.shop-fit .shop-cta {
  flex-shrink: 0;
  min-height: 2.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}

/* Tablet landscape (901–1100px): keep a side price panel, but release the
   viewport-height lock so the page scrolls normally. */
@media (max-width: 1100px) {
  .shop-fit {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .shop-fit .shop-scroll {
    flex: none;
    overflow: visible;
  }

  .shop-fit .shop-body,
  .shop-fit.shop-view--product .shop-body {
    grid-template-columns: minmax(0, 1fr) 240px;
    align-items: start;
  }

  .shop-fit .shop-main {
    order: 1;
    overflow: visible;
  }

  .shop-fit .shop-section:not(.hidden) {
    overflow: visible;
    height: auto;
  }

  .shop-fit .catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .shop-fit .product-layout {
    height: auto;
  }

  .shop-fit .product-buy-col {
    overflow: visible;
  }

  .shop-fit .product-preview {
    max-height: min(42vh, 320px);
    aspect-ratio: 1;
    flex: none;
  }

  .shop-fit .shop-price-panel {
    position: sticky;
    order: 2;
    top: var(--shop-summary-sticky-top, calc(76px + 2.25rem + 10px));
    z-index: auto;
    height: auto;
    max-height: var(--shop-summary-sticky-max-height, calc(100dvh - 76px - 2.25rem - 22px));
    overflow: auto;
    align-self: start;
  }
}

/* Tablet portrait / phone (≤900px): single column, price panel collapses
   into the fixed buy bar. */
@media (max-width: 900px) {
  .shop-fit .shop-body,
  .shop-fit.shop-view--product .shop-body {
    grid-template-columns: 1fr;
  }

  .shop-fit .product-layout {
    grid-template-columns: 1fr;
  }

  .shop-fit .product-options-section {
    grid-template-columns: 1fr;
  }

  .shop-fit #color-step.hidden {
    display: none;
  }

  .shop-fit .chain-length-guide-inline__layout,
  .shop-fit .ring-size-guide-inline__layout {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .shop-fit #engraving-girdle-step,
  .shop-fit .shop-girdle-engrave {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
  }

  .shop-fit .shop-girdle-engrave .cfg-engrave-hint {
    white-space: normal;
  }

  .shop-fit .shop-price-panel {
    display: none;
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
  }

  .shop-fit .shop-price-panel.is-mobile-open {
    display: flex;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(
      var(--shop-mobile-buy-bar-height, calc(80px + env(safe-area-inset-bottom, 0px)))
      + 8px
    );
    z-index: 99;
    max-height: min(
      70dvh,
      440px,
      calc(
        100dvh
        - var(--shop-mobile-buy-bar-height, calc(80px + env(safe-area-inset-bottom, 0px)))
        - var(
          --shop-mobile-site-chrome-height,
          var(--shop-summary-sticky-top, calc(76px + 2.25rem + 10px))
        )
        - 16px
      )
    );
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(22px) saturate(1.4);
    -webkit-backdrop-filter: blur(22px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 16px;
    box-shadow:
      0 12px 40px rgba(43, 35, 32, 0.14),
      0 0 0 1px rgba(26, 168, 173, 0.16);
  }

  .mobile-buy-bar {
    flex-wrap: wrap;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  body.shop-mobile-bar {
    padding-bottom: calc(
      var(--shop-mobile-buy-bar-height, calc(80px + env(safe-area-inset-bottom, 0px)))
      + 12px
    );
  }
}

@media (max-width: 640px) {
  .shop-fit .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shop-fit .product-options-section {
    grid-template-columns: 1fr;
  }

  .shop-fit .shop-price-panel .shop-cta,
  .shop-fit .shop-price-panel .shop-action-row {
    display: none;
  }

  body.shop-mobile-bar {
    padding-bottom: calc(
      var(--shop-mobile-buy-bar-height, calc(80px + env(safe-area-inset-bottom, 0px)))
      + 12px
    );
  }
}

.catalog-error {
  padding: 1.25rem;
  text-align: center;
  color: var(--color-text-muted);
}
.catalog-error .btn-secondary {
  margin-top: 0.75rem;
}

.shop-action-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
  margin-top: 12px;
}

.shop-action-row .shop-cta {
  flex: 1;
  width: auto;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  min-height: 2.75rem;
}

.shop-action-row #cart-btn[hidden],
.shop-action-row #confirm-btn[hidden],
.mobile-buy-actions #cart-btn-mobile[hidden],
.mobile-buy-actions #confirm-btn-mobile[hidden] {
  display: none !important;
}

.shop-action-row #cart-btn,
.shop-action-row #confirm-btn {
  flex: 1 1 0;
  min-width: 0;
  width: auto !important;
  margin-top: 0 !important;
  padding: 10px 12px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  height: 2.25rem !important;
  min-height: 2.25rem !important;
  max-height: 2.25rem !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  letter-spacing: 0.02em !important;
  transform: none;
}

.shop-action-row #confirm-btn {
  border: 1px solid transparent !important;
}

.shop-action-row #cart-btn:hover:not(:disabled),
.shop-action-row #confirm-btn:hover:not(:disabled) {
  transform: none;
}

.mobile-buy-actions #cart-btn-mobile,
.mobile-buy-actions #confirm-btn-mobile {
  flex: 1 1 0;
  min-width: 0;
  width: auto !important;
  padding: 10px 12px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  height: 2.25rem !important;
  min-height: 2.25rem !important;
  max-height: 2.25rem !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

body.app-shell .shop-action-row .shop-cta,
body.app-shell .mobile-buy-actions .shop-cta-compact {
  border-radius: 8px !important;
  padding: 10px 12px !important;
  font-size: 13px !important;
  min-height: 2.25rem;
  letter-spacing: 0.02em;
  box-shadow: none;
  box-sizing: border-box;
  border: 1px solid transparent;
  white-space: nowrap;
}

body.app-shell .shop-action-row .shop-cta--secondary,
body.app-shell .mobile-buy-actions .shop-cta--secondary {
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
  border: 1px solid var(--color-border) !important;
}

body.app-shell .shop-action-row .shop-cta--secondary:hover:not(:disabled),
body.app-shell .mobile-buy-actions .shop-cta--secondary:hover:not(:disabled) {
  background: var(--color-surface-raised) !important;
  filter: none;
}

.shop-action-row--guest .shop-cta {
  flex: none;
  width: 100%;
}

.shop-cta--secondary {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.shop-cta--secondary:hover:not(:disabled) {
  background: var(--color-surface-raised);
  transform: translateY(-1px);
}

.shop-guest-notice {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
}

.shop-guest-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--color-brand) 35%, var(--color-border));
  border-radius: 12px;
  background: color-mix(in srgb, var(--color-brand) 8%, var(--color-surface));
}

.shop-guest-banner-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.45;
}

.shop-guest-banner-label {
  font-weight: 700;
  color: var(--color-text);
}

.shop-guest-banner-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--color-brand);
  color: var(--color-on-brand);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.15s, opacity 0.15s;
}

.shop-guest-banner-login:hover {
  transform: translateY(-1px);
  opacity: 0.92;
}

.shop-action-row--guest .shop-cta--login {
  background: var(--color-brand);
  color: var(--color-on-brand);
  border-color: var(--color-brand);
}

.mobile-buy-actions {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.mobile-buy-actions .shop-cta-compact {
  flex: 1;
  min-width: 0;
  width: auto;
}

.mobile-buy-actions--guest {
  flex: 1;
  justify-content: flex-end;
}

.mobile-buy-actions--guest .shop-cta-compact {
  max-width: 180px;
}

.catalog-grid.is-loading .catalog-tile:not(.catalog-tile--skeleton),
.type-grid.is-loading .type-card:not(.type-card--skeleton) {
  position: relative;
  overflow: hidden;
  opacity: 0.65;
}

.catalog-tile--skeleton {
  pointer-events: none;
  cursor: default;
  border: 1px solid #ede7e0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--color-surface);
  opacity: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.catalog-tile--skeleton:hover {
  transform: none;
  box-shadow: none;
  border-color: #ede7e0;
}

.catalog-tile-skeleton-img,
.catalog-tile-skeleton-label {
  background: linear-gradient(90deg, #ede7e0 0%, #f5f0ea 50%, #ede7e0 100%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.2s ease-in-out infinite;
}

.catalog-tile-skeleton-img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
}

.catalog-tile-skeleton-label {
  display: block;
  width: 52%;
  height: 14px;
  margin: 0 auto;
  padding: 0 12px 16px;
  border-radius: 4px;
  box-sizing: content-box;
}

.shop-fit .catalog-tile--skeleton {
  gap: 0;
}

.shop-price-panel.is-loading-prices .breakdown-rows .summary-row .val {
  display: inline-block;
  min-width: 3.5rem;
  min-height: 0.85em;
  border-radius: 4px;
  color: transparent !important;
  background: linear-gradient(90deg, #ede7e0 0%, #f5f0ea 50%, #ede7e0 100%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.2s ease-in-out infinite;
}

.catalog-grid.is-loading .catalog-tile:not(.catalog-tile--skeleton)::after,
.type-grid.is-loading .type-card:not(.type-card--skeleton)::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.22), transparent);
  animation: catalog-skeleton 1.2s infinite;
}

@keyframes skel-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes catalog-skeleton {
  to { transform: translateX(100%); }
}

.catalog-filters {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto auto;
  gap: 8px;
  margin: 0 0 16px;
}

.catalog-filters input,
.catalog-filters select,
.catalog-filters button,
.catalog-filters .catalog-ms-trigger {
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
}

.catalog-filters .catalog-ms-filter {
  padding: 0;
  border: 0;
  background: transparent;
}

.catalog-filters .catalog-ms-trigger {
  width: 100%;
}

.catalog-filter-empty {
  padding: 30px 16px;
  text-align: center;
  color: var(--color-text-muted);
}

.catalog-filter-empty button {
  padding: 9px 13px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
}

.product-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
}

.favorite-toggle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  position: relative;
  z-index: 2;
  border: 1px solid var(--mint-deep);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--mint-deep);
  font-size: 24px;
  cursor: pointer;
  pointer-events: auto;
}

.favorite-toggle.is-saved { background: color-mix(in srgb, var(--mint-deep) 14%, var(--color-surface)); }
.favorite-toggle:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.shop-secondary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.shop-secondary-actions button {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.shop-secondary-actions button:disabled { opacity: 0.45; cursor: not-allowed; }

@media (max-width: 900px) {
  .catalog-filters { grid-template-columns: 1fr 1fr; }
  .catalog-search { grid-column: 1 / -1; }
  .catalog-search input { width: 100%; }
}

.styles-page-main {
  min-height: 100vh;
}

.shop-preview-banner {
  width: min(1180px, calc(100% - 2rem));
  margin: 1rem auto 0;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border: 1px solid var(--color-brand);
  border-radius: 8px;
  background: color-mix(in srgb, var(--color-brand) 10%, var(--color-surface));
  color: var(--color-text);
  text-align: center;
  font-size: 0.875rem;
}

.shop-calculator-page.is-shop-preview .shop-preview-banner {
  position: sticky;
  top: 0;
  z-index: 90;
  width: 100%;
  max-width: none;
  margin: 0 0 1rem;
  border-radius: 0;
  border-left: none;
  border-right: none;
  font-weight: 600;
}

.shop-cta--disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: not-allowed;
}

.shop-preview-back {
  flex-shrink: 0;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 600;
  text-decoration: none;
}

.shop-preview-back:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

@media (max-width: 640px) {
  .shop-preview-banner {
    flex-direction: column;
    gap: 0.5rem;
  }
}

.type-card {
  position: relative;
}

.type-draft-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--color-accent-ink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.styles-page-content {
  padding: 1rem clamp(1rem, 3vw, 2rem) 3rem;
}

.cart-page .cart-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-toolbar {
  margin-bottom: 12px;
}

.cart-select-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.cart-item-row {
  display: grid;
  grid-template-columns: auto 64px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
}

.cart-item-check {
  display: flex;
  align-items: center;
}

.cart-item-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-brand);
  cursor: pointer;
}

.cart-item-thumb-wrap {
  flex-shrink: 0;
}

.cart-item-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--color-bg);
  display: block;
}

.cart-item-thumb--empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.cart-item-info {
  min-width: 0;
}

.cart-item-title {
  display: block;
  font-size: 15px;
  line-height: 1.35;
}

.cart-item-meta {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--color-text-muted);
}

.cart-item-price {
  font-weight: 600;
  white-space: nowrap;
}

.cart-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.cart-action-btn {
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.2;
}

.cart-action-btn:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.cart-detail-dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: min(720px, calc(100vw - 24px));
  width: 100%;
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2);
}

.cart-detail-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.cart-detail-dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: min(85vh, 720px);
}

.cart-detail-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border);
}

.cart-detail-dialog-header h2 {
  margin: 0;
  font-size: 18px;
}

.cart-detail-close {
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text-muted);
}

.cart-detail-dialog-body {
  overflow: auto;
  padding: 20px;
}

.cart-detail-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 20px;
}

.cart-detail-media img,
.cart-detail-image {
  width: 100%;
  border-radius: 12px;
  object-fit: cover;
  aspect-ratio: 1;
  background: var(--color-bg);
}

.cart-detail-image--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.cart-detail-summary {
  margin: 0 0 12px;
  font-weight: 600;
}

.cart-detail-pricing {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-detail-price-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.cart-detail-price-row--total {
  font-size: 16px;
  margin-top: 4px;
}

.cart-detail-loading {
  text-align: center;
  color: var(--color-text-muted);
}

/* Tablets and phones: stack cart rows into card-style layout */
@media (max-width: 900px) {
  .cart-item-row {
    grid-template-columns: auto 56px 1fr;
    grid-template-areas:
      "check thumb info"
      "check thumb price"
      "actions actions actions";
  }

  .cart-item-check { grid-area: check; }
  .cart-item-thumb-wrap { grid-area: thumb; }
  .cart-item-info { grid-area: info; }
  .cart-item-price { grid-area: price; }
  .cart-item-actions {
    grid-area: actions;
    justify-content: flex-start;
    padding-top: 4px;
  }

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

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
}

.cart-item-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-item-remove {
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 13px;
}

.cart-summary {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.cart-continue-link,
.cart-empty a.shop-cta--inline {
  text-align: center;
  text-decoration: none;
}

.cart-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-text-muted);
}

.shop-cta--inline {
  display: inline-block;
  width: auto;
  margin-top: 12px;
}

/* Touch devices (phones + tablets): larger tap targets for chips,
   carousels, and cart action buttons */
@media (pointer: coarse) {
  .shop-fit .variant-chip,
  .shop-fit .carat-btn,
  .shop-fit .metal-btn,
  .shop-fit .color-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }

  .diamond-carousel-nav {
    width: 40px;
    height: 40px;
  }

  .shop-fit .diamond-carousel-item {
    min-width: 64px;
  }

  .cart-action-btn {
    padding: 8px 14px;
  }
}

