/* ============================================================================
   RING BUILDER STYLES — edit freely.
   Layout: 3D viewer on the left, options panel on the right.
   On mobile ( <= 768px ) the two panes stack vertically.
   ============================================================================ */

:root {
  --font: "Mulish", system-ui, -apple-system, "Segoe UI", sans-serif;
  --text: #1f1f1f;
  --text-muted: #6f6f6f;
  --bg: #ffffff;
  --viewer-bg: #f4f4f4;
  --border: #e2e2e2;
  --accent: #1f1f1f;        /* selected option outline color */
  --price-bg: #faf7f2;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}

.app-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ------------------------------- viewer -------------------------------- */

.viewer-pane {
  position: relative;
  flex: 1 1 55%;
  min-width: 0;
  background: var(--viewer-bg);
}

#viewer-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.viewer-action-button {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.viewer-action-button--reset { right: 68px; }
.viewer-action-button:hover { background: #f6f6f6; }

/* ------------------------------- panel --------------------------------- */

.panel-pane {
  flex: 1 1 52%;
  max-width: 780px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  min-width: 0;
}

.configurator-panel {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 12px;
}

.option-row { margin-bottom: 18px; }

.option-row-heading {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.option-row-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.option-row-items--scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 4px;
}
.option-row-items--two-rows {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)); /* 10 items -> 2 rows of 5 */
}
.option-row-items--two-rows .option-row-item {
  min-width: 0; /* let the grid control the width */
}
@media (max-width: 768px) {
  .option-row-items--two-rows { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.option-row-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  min-width: 74px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-family: var(--font);
  font-size: 11px;
  color: var(--text);
  transition: border-color 0.15s;
  flex: 0 0 auto;
}
.option-row-item:hover { border-color: #b9b9b9; }
.option-row-item[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.option-row-item--compact { min-width: 46px; padding: 7px 6px; }

.option-row-icon {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.option-row-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.option-row-label { text-align: center; line-height: 1.25; }

/* band style category tabs */
.band-style-tabs {
  display: flex;
  flex-wrap: nowrap;      /* all five categories on one row */
  gap: 8px;
  margin-bottom: 12px;
}
.band-style-tab {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  padding: 9px 18px;
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 1;
}

@media (max-width: 768px) {
  .band-style-tabs { flex-wrap: wrap; } /* allow wrapping on phones */
}

/* band style thumbnails — larger than the other option rows */
.band-style-row .option-row-item {
  min-width: 104px;
  padding: 10px 12px;
}
.band-style-row .option-row-icon {
  width: 72px;
  height: 72px;
}
.band-style-row .option-row-label {
  font-size: 12.5px;
}
.band-style-tab[aria-selected="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* hover preview — enlarged band image while hovering a thumbnail */
.band-hover-preview {
  position: fixed;
  z-index: 50;
  display: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.18);
  padding: 12px;
  pointer-events: none;   /* never blocks the cursor or clicks */
  text-align: center;
}
.band-hover-preview img {
  width: 216px;           /* 3× the 72px thumbnail */
  height: 216px;
  object-fit: contain;
  display: block;
}
.band-hover-preview span {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
}

/* ------------------------------- price --------------------------------- */

.price-display {
  border-top: 1px solid var(--border);
  background: var(--price-bg);
  padding: 14px 22px;
}

.price-display-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.price-display-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.price-display-value { font-size: 22px; }
.price-display-value--loading { opacity: 0.35; }

.price-display-error {
  color: #b3261e;
  font-size: 13px;
}

/* price breakup (expandable) */
.price-breakup { margin-top: 10px; }
.price-breakup-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px dashed var(--border);
  font-size: 13px;
}
.price-breakup-row span { display: block; color: var(--text-muted); font-size: 12px; }
.price-breakup-toggle {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: underline;
  padding: 0;
  font-family: var(--font);
}

/* ------------------------------- mobile -------------------------------- */

@media (max-width: 768px) {
  .app-layout { flex-direction: column; overflow-y: auto; height: auto; }
  .viewer-pane { flex: none; height: 46vh; }
  .panel-pane { flex: none; max-width: none; border-left: none; }
  .configurator-panel { overflow: visible; }
  .price-display {
    position: sticky;
    bottom: 0;
  }
}
