/* Gold Grillz Designer. Page-specific presentation only.
   White surfaces. Warm gold is an accent, not a page wash. */

.builder-page,
.builder-page .page-content {
  background: #fff;
}

.gb {
  margin: 0 auto;
  padding-bottom: 28px;
}

.gb-intro {
  padding: 22px 0 14px;
  max-width: 40rem;
}

.gb-intro h1 {
  margin: 0 0 8px;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.gb-intro p {
  margin: 0;
  max-width: 42em;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.6;
}

.gb-hint {
  margin-top: 10px !important;
  color: var(--gold-deep) !important;
  font-size: 0.68rem !important;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gb-card,
.gb-browser,
.gb-config,
.gb-summary,
.gb-review,
.gb-choose,
.gb-chart {
  background: #fff;
}

.gb-chart {
  border: 1px solid var(--line);
  padding: 16px 12px 12px;
}

.gb-arch-title {
  margin: 0 0 6px;
  text-align: center;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.gb-arch-title--lower { margin: 8px 0 0; }

.gb-arch {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gb-side-label {
  margin: 0 0 4px;
  text-align: center;
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.gb-vline,
.gb-occlusal {
  background: var(--line-strong);
}

.gb-vline {
  width: 1px;
  height: 14px;
  margin: 2px auto;
}

.gb-occlusal {
  height: 1px;
  margin: 4px 8px;
}

.gb-teeth {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  align-items: end;
}

.gb-teeth--lower { align-items: start; }

.tooth {
  --tooth-fill: #fff;
  --tooth-stroke: #ddd4c8;
  position: relative;
  display: grid;
  justify-items: center;
  align-items: end;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0;
  color: var(--ink);
  touch-action: manipulation;
}

.tooth--lower { align-items: start; }

.tooth svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.tooth--lower svg {
  transform: scaleY(-1);
  transform-origin: center;
}

.tooth svg path {
  fill: var(--tooth-fill);
  stroke: var(--tooth-stroke);
  stroke-width: 1.8;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: fill 160ms var(--ease-out), stroke 160ms var(--ease-out);
}

.tooth__num {
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  font-family: var(--font-serif);
  font-size: clamp(14px, 2.5vw, 20px);
  line-height: 1;
  pointer-events: none;
}

.tooth--n2 .tooth__num { top: 56%; }
.tooth--n3 .tooth__num { top: 48%; }
.tooth--n4 .tooth__num { top: 58%; }
.tooth--n5 .tooth__num { top: 60%; }
.tooth--lower .tooth__num { top: 46%; }
.tooth--lower.tooth--n2 .tooth__num { top: 44%; }
.tooth--lower.tooth--n3 .tooth__num { top: 52%; }
.tooth--lower.tooth--n4 .tooth__num { top: 42%; }
.tooth--lower.tooth--n5 .tooth__num { top: 40%; }

@media (hover: hover) {
  .tooth:hover:not(.is-configured) { --tooth-stroke: var(--gold); }
}

.tooth:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}

.tooth.is-active:not(.is-configured) {
  --tooth-fill: #f8f1e4;
  --tooth-stroke: var(--gold);
}

.tooth.is-candidate:not(.is-configured) {
  --tooth-fill: #fff;
  --tooth-stroke: var(--gold);
}

.tooth.is-candidate svg path {
  stroke-dasharray: 5 3.5;
}

.tooth.is-configured {
  --tooth-fill: #c9a36a;
  --tooth-stroke: #7a5c34;
}

.tooth.is-active.is-configured {
  --tooth-fill: #c9a36a;
  --tooth-stroke: #3f2c18;
}

.tooth.is-active svg path { stroke-width: 2.6; }

.gb-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  margin: 12px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.gb-legend li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.72rem;
}

.gb-swatch {
  width: 12px;
  height: 12px;
  border: 1.5px solid #ddd4c8;
  background: #fff;
  border-radius: 2px;
}

.gb-swatch.is-active { border-color: var(--gold); background: #f8f1e4; }
.gb-swatch.is-candidate { border-color: var(--gold); border-style: dashed; background: #fff; }
.gb-swatch.is-configured { border-color: #7a5c34; background: #c9a36a; }

.gb-choose {
  margin-top: 18px;
  padding: 16px 18px 14px;
  border: 1px solid var(--line);
}

.gb-kicker,
.gb-mini,
.gb-count {
  margin: 0 0 6px;
  color: var(--gold-deep);
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gb-choose h2,
.gb-browser h2,
.gb-config h2,
.gb-summary h2,
.gb-review h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.gb-choose-label {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.45;
}

.gb-choose-actions,
.gb-actions,
.gb-bag-success,
.gb-config-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.gb-choose-actions { margin-top: 14px; }
.gb-choose-note { flex: 1 0 100%; margin: 0; }

.gb-select,
.gb-change,
.gb .btn {
  font-family: var(--font-sans);
}

.gb-select,
.gb-change {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background-color 150ms var(--ease-out), color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}

.gb-select:hover,
.gb-select:focus-visible,
.gb-change:hover,
.gb-change:focus-visible {
  background: var(--ink);
  color: #fff;
}

.gb-actions { margin-top: 18px; }

.gb-actions .btn,
#gb-confirm,
.gb-bag-success .btn {
  min-height: 48px;
}

.gb-bag:disabled,
.gb-bag:disabled:hover,
.gb-bag:disabled:focus-visible {
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line-strong);
  opacity: 1;
  cursor: not-allowed;
}

.gb-text-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 2px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-underline-offset: 4px;
  background: transparent;
}

.gb-text-btn:hover,
.gb-text-btn:focus-visible { color: var(--gold-deep); }

.gb-browser,
.gb-config { margin-top: 28px; padding-top: 8px; }
.gb-summary { margin-top: 32px; }

.gb-browser__head {
  display: grid;
  gap: 14px;
  align-items: end;
}

.gb-search label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gb-search__row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gb-search input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.gb-search input:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 2px;
  border-color: var(--gold);
}

.gb-search input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.gb-status,
.gb-empty,
.gb-note {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}

.gb-note { color: var(--muted); font-size: 0.82rem; }
.gb-retry { width: auto; min-width: 180px; margin-top: 12px; }

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

.gb-design {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  padding: 8px 8px 12px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: center;
  transition: border-color 150ms var(--ease-out);
}

@media (hover: hover) {
  .gb-design:hover { border-color: var(--gold); }
}

.gb-design__media {
  position: relative;
  margin-bottom: 10px;
  padding: 8px;
  background: #fff;
}

.gb-design__img,
.gb-selected img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
}

.gb-selected img {
  width: min(100%, 280px);
  padding: 12px;
  border: 1px solid var(--line);
}

.gb-sale-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  padding: 4px 7px;
  background: var(--gold-deep);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}

.gb-detail-hit {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: inherit;
}

.gb-detail-hit:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
}

.gb-detail-name {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
}

.gb-detail-name:hover,
.gb-detail-name:focus-visible {
  color: var(--gold-deep);
}

.gb-detail-name:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
}

.gb-view-details {
  align-self: center;
  min-height: 36px;
  margin: 0 0 8px;
}

.gb-selected .gb-detail-hit {
  width: min(100%, 280px);
}

.gb-design__name {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1.3;
  overflow-wrap: break-word;
}

.gb-design__price {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 0.95rem;
}

.gb-design__price s,
.gb-design__price strong { font-weight: 400; }
.gb-design__price strong { font-family: var(--font-serif); font-size: 1.05rem; }
.gb-design__price s { margin-right: 6px; color: var(--muted); }

.gb-save,
.gb-design__stock {
  margin: 0 0 8px;
  color: var(--gold-deep);
  font-size: 0.75rem;
}

.gb-design__stock.is-out { letter-spacing: 0.08em; text-transform: uppercase; }
.gb-design .gb-select { width: 100%; margin-top: auto; }
.gb-more { display: flex; width: max-content; max-width: 100%; margin: 18px auto 0; }

.gb-skeleton {
  height: 260px;
  border: 1px solid var(--line);
  background: linear-gradient(90deg, #f3f3f3 0%, #fff 45%, #f3f3f3 100%);
  background-size: 200% 100%;
  animation: gb-shimmer 1.6s ease-in-out infinite;
}

@keyframes gb-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.gb-config-layout {
  display: grid;
  gap: 22px;
  margin-top: 16px;
}

.gb-selected h3 {
  margin: 12px 0 4px;
  font-size: 1.4rem;
  font-weight: 400;
}

.gb-options h3 {
  margin: 0 0 4px;
  font-size: 1.3rem;
  font-weight: 400;
}

.gb-bound {
  margin: 0 0 18px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
}

.gb-bound .gb-option__label {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gb-bound__value {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.12rem;
  line-height: 1.35;
}

.gb-bound__note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.gb-option,
fieldset.gb-option {
  margin: 0;
  padding: 14px 0 6px;
  min-width: 0;
  max-width: 100%;
  min-inline-size: 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.gb-option__label,
.gb-option legend {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  padding: 0;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 500;
  float: none;
}

.gb-req { color: var(--muted); font-weight: 400; }

.gb-option select,
.gb-option input[type="text"],
.gb-option input[type="date"],
.gb-option input[type="file"],
.gb-option textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.gb-option textarea { min-height: 84px; resize: vertical; }

.gb-option select:focus-visible,
.gb-option input:focus-visible,
.gb-option textarea:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 2px;
  border-color: var(--gold);
}

.gb-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 8px;
}

.gb-choice input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--gold-deep);
}

.gb-choice span { min-width: 0; line-height: 1.35; overflow-wrap: break-word; }

.gb-option.is-invalid {
  padding-left: 12px;
  padding-right: 12px;
  background: #fff;
  box-shadow: inset 2px 0 0 var(--gold-deep);
}

.gb-option.is-invalid select,
.gb-option.is-invalid input,
.gb-option.is-invalid textarea { border-color: var(--gold-deep); }

.gb-field-error,
.gb-inline-error,
.gb-bag-status.is-error { color: var(--gold-deep); }

.gb-field-error,
.gb-inline-error { margin: 4px 0 0; font-size: 0.88rem; line-height: 1.4; }
.gb-config-actions { margin-top: 18px; }
#gb-confirm { flex: 1 1 100%; }

.gb-count { margin-top: 6px; }
.gb-build-list,
.gb-review-list { margin: 8px 0 0; padding: 0; list-style: none; }

.gb-build-item {
  display: grid;
  gap: 2px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.gb-build-item.is-set { box-shadow: inset 2px 0 0 var(--gold-soft); padding-left: 12px; }
.gb-build-item__pos { font-family: var(--font-serif); font-size: 1.12rem; line-height: 1.3; }
.gb-build-item__design { color: var(--ink); font-size: 0.92rem; }
.gb-build-item__meta { color: var(--muted); font-size: 0.84rem; }
.gb-build-item__price { font-family: var(--font-serif); font-size: 1.15rem; }
.gb-build-item__actions { display: flex; flex-wrap: wrap; gap: 4px 14px; }

.gb-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--ink);
}

.gb-total span {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.gb-total strong { font-family: var(--font-serif); font-size: 1.65rem; font-weight: 400; }

.gb-bag-status { margin: 14px 0 0; color: var(--ink); }
.gb-bag-success { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.gb-bag-success__title { flex: 1 0 100%; margin: 0; font-family: var(--font-serif); font-size: 1.2rem; line-height: 1.4; }

.gb-clear { margin-top: 4px; }
.gb-confirm {
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #fff;
}
.gb-confirm p { margin: 0 0 4px; }

.gb-review-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  line-height: 1.45;
}

.gb [hidden] { display: none !important; }

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

.gb-chart,
.gb-browser,
.gb-config,
.gb-summary,
.gb-review,
.gb-choose {
  scroll-margin-top: 96px;
  scroll-margin-bottom: calc(var(--bottom-nav-h) + 16px);
}

@media (min-width: 768px) {
  .gb-intro { padding: 28px 0 16px; }
  .gb-chart { padding: 18px 16px 14px; }
  .gb-arch {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr);
    gap: 0 6px;
    align-items: end;
  }
  .gb-arch--lower { align-items: start; }
  .gb-arch--lower .gb-side-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  .gb-vline { width: 1px; height: auto; margin: 0; align-self: stretch; }
  .gb-designs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .gb-build-item {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "pos price"
      "design price"
      "meta actions";
    column-gap: 24px;
    align-items: start;
  }
  .gb-build-item__pos { grid-area: pos; }
  .gb-build-item__design { grid-area: design; }
  .gb-build-item__meta { grid-area: meta; }
  .gb-build-item__price { grid-area: price; justify-self: end; }
  .gb-build-item__actions { grid-area: actions; justify-self: end; }
  .gb-actions .btn,
  .gb-choose-actions .gb-select,
  .gb-choose-actions .btn { flex: 0 0 auto; }
  #gb-confirm { flex: 0 1 280px; }
}

@media (min-width: 1024px) {
  .gb-designs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gb-browser__head { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 12px 36px; }
  .gb-config-layout {
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    gap: 28px 48px;
    align-items: start;
  }
  .gb-selected { position: sticky; top: calc(var(--header-compact-h) + 16px); }
}

@media (min-width: 1280px) {
  .gb-designs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 359px) {
  .gb-designs { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .tooth svg path,
  .gb-design,
  .gb-select,
  .gb-change { transition: none; }
  .gb-skeleton { animation: none; background: #f3f3f3; }
}

.gb-editorial {
  margin-top: 44px;
  padding: 36px 0 4px;
  border-top: 1px solid var(--line);
  background: #fff;
  max-width: none;
}

.gb-editorial-intro {
  max-width: 28rem;
  margin: 0 0 8px;
}

.gb-editorial-intro h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}

.gb-editorial-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.gb-editorial-block {
  min-width: 0;
  padding: 22px 0 6px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.gb-editorial-kicker {
  margin: 0 0 8px;
  color: var(--gold-deep);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.3;
  text-transform: uppercase;
}

.gb-editorial h2 {
  margin: 0 0 0.55em;
  max-width: 18em;
  font-family: var(--font-serif);
  font-size: clamp(1.22rem, 1.8vw, 1.5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}

.gb-editorial-intro h2 {
  max-width: none;
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
}

.gb-editorial p {
  max-width: 40em;
  margin: 0 0 0.85em;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.65;
}

.gb-editorial a:not(.gb-editorial-cta) {
  color: var(--gold-deep);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.gb-editorial-actions {
  margin: 2px 0 10px;
}

.gb-editorial-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  color: var(--gold-deep);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-decoration: none;
  text-transform: uppercase;
  border-bottom: 1px solid var(--gold);
  padding-bottom: 3px;
}

.gb-editorial-cta::after {
  content: "\2192";
  letter-spacing: 0;
}

.gb-editorial-cta:hover,
.gb-editorial-cta:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

@media (min-width: 1024px) {
  .gb-summary { margin-top: 52px; }

  .gb-editorial {
    margin-top: 76px;
    padding-top: 40px;
  }

  .gb-editorial-intro {
    margin-bottom: 18px;
  }

  .gb-editorial-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 64px;
  }

  .gb-editorial-block {
    padding-top: 26px;
  }
}
