/* =========================================================
   "Monte seu ambiente" em 3D ([data-room], assets/js/3d/room.js)
   Ocupa a tela abaixo do cabeçalho fixo (--room-offset vem do JS).
   ========================================================= */

.room3d {
  --rm-bg: #e9e6e1;
  --rm-panel: #fff;
  --rm-soft: #f4f2ee;
  --rm-line: rgba(0, 0, 0, 0.1);
  --rm-ink: var(--ink-soft, #121212);
  --rm-muted: rgba(0, 0, 0, 0.6);
  --rm-accent: var(--accent, #e01b26);
  --rm-accent-rgb: var(--accent-rgb, 224, 27, 38);
  --rm-warn: #9a5b00;
  display: block;
  height: calc(100dvh - var(--room-offset, 0px));
  min-height: 540px;
  background: var(--rm-bg);
  color: var(--rm-ink);
  font-family: var(--font, 'Urbanist', 'Helvetica Neue', Arial, sans-serif);
  line-height: 1.4;
  letter-spacing: 0.2px;
}

.room3d[hidden] {
  display: none;
}

/* resets de baixa especificidade (a página de teste não carrega o CSS do site) */
:where(.room3d) button {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
}

:where(.room3d) :is(h1, h2, p) {
  margin: 0;
}

:where(.room3d) ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

:where(.room3d) [hidden] {
  display: none !important;
}

.room3d svg {
  display: block;
  flex: none;
}

.room3d button:focus-visible,
.room3d input:focus-visible,
.room3d select:focus-visible {
  outline: 2px solid var(--rm-ink);
  outline-offset: 2px;
}

/* ---------- Estrutura ---------- */
.rm {
  display: grid;
  height: 100%;
  grid-template-columns: 360px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    'top top'
    'cat stage'
    'cat foot';
}

/* ---------- Barra superior ---------- */
.rm-top {
  grid-area: top;
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: 'text tools close';
  align-items: center;
  gap: 10px 16px;
  padding: 12px 20px;
  background: var(--rm-panel);
  border-bottom: 1px solid var(--rm-line);
}

.rm-head {
  display: contents;
}

.rm-head__text {
  grid-area: text;
  min-width: 0;
}

.rm-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0;
  outline: none;
}

.rm-sub {
  margin-top: 2px;
  font-size: 13px;
  color: var(--rm-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rm-close {
  grid-area: close;
  border: 1px solid rgba(0, 0, 0, 0.14);
}

.rm-tools {
  grid-area: tools;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.rm-select {
  position: relative;
  display: block;
}

.rm-select select {
  appearance: none;
  height: 40px;
  padding: 0 38px 0 16px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='%23333' d='M9.35.65a.5.5 0 00-.7 0L5 4.29 1.35.65a.5.5 0 00-.7.7l4 4a.5.5 0 00.7 0l4-4a.5.5 0 000-.7z'/%3E%3C/svg%3E") right 15px center / 10px no-repeat;
  color: inherit;
  font: 600 14px var(--font, inherit);
  letter-spacing: 0.2px;
  cursor: pointer;
}

.rm-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.rm-pill svg {
  width: 18px;
  height: 18px;
}

.rm-pill[aria-expanded='true'] {
  border-color: var(--rm-ink);
}

.rm-seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: #efede9;
}

.rm-seg button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  color: rgba(0, 0, 0, 0.68);
  font-size: 13.5px;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.rm-seg button svg {
  width: 17px;
  height: 17px;
}

.rm-seg button[aria-pressed='true'] {
  background: var(--rm-ink);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

/* Medidas do ambiente */
.rm-sizewrap {
  position: relative;
}

.rm-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 30;
  width: 300px;
  padding: 14px 16px 12px;
  border: 1px solid var(--rm-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.16);
}

.rm-pop__title {
  font-size: 14px;
  font-weight: 700;
}

.rm-dimf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.rm-dimf__label {
  font-size: 13.5px;
  font-weight: 600;
}

.rm-stepper {
  display: inline-flex;
  align-items: center;
  height: 40px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 999px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rm-stepper:focus-within {
  border-color: var(--rm-accent);
  box-shadow: 0 0 0 3px rgba(var(--rm-accent-rgb), 0.12);
}

.rm-stepper__btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
}

.rm-stepper__btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.rm-stepper__btn svg {
  width: 16px;
  height: 16px;
}

.rm-stepper__input {
  width: 50px;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: inherit;
  font: 600 15px var(--font, inherit);
  text-align: right;
}

.rm-stepper__input[aria-invalid='true'] {
  color: var(--rm-accent);
}

.rm-stepper__unit {
  margin: 0 4px 0 3px;
  font-size: 13px;
  color: var(--rm-muted);
}

.rm-pop__area {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--rm-muted);
}

/* Botões redondos de ícone */
.rm-iconbtn {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.rm-iconbtn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.rm-iconbtn svg {
  width: 20px;
  height: 20px;
}

/* ---------- Catálogo lateral ---------- */
.rm-cat {
  grid-area: cat;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--rm-panel);
  border-right: 1px solid var(--rm-line);
}

.rm-tabs {
  display: flex;
  gap: 18px;
  padding: 10px 18px 0;
  border-bottom: 1px solid var(--rm-line);
}

.rm-tabs button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 2px 12px;
  color: rgba(0, 0, 0, 0.55);
  font-size: 14.5px;
  font-weight: 600;
}

.rm-tabs button[aria-selected='true'] {
  color: var(--rm-ink);
}

.rm-tabs button[aria-selected='true']::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--rm-accent);
}

.rm-tabs__count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #efede9;
  color: var(--rm-ink);
  font-size: 12px;
  font-weight: 700;
}

.rm-pane {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.rm-search {
  position: relative;
  margin: 12px 16px 0;
}

.rm-search svg {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 18px;
  height: 18px;
  color: rgba(0, 0, 0, 0.5);
  transform: translateY(-50%);
  pointer-events: none;
}

.rm-search input {
  width: 100%;
  height: 42px;
  padding: 0 16px 0 40px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 999px;
  outline: none;
  background: #faf9f7;
  color: inherit;
  font: 400 14.5px var(--font, inherit);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.rm-search input:focus {
  border-color: var(--rm-accent);
  box-shadow: 0 0 0 3px rgba(var(--rm-accent-rgb), 0.12);
}

.rm-chips {
  display: flex;
  gap: 6px;
  padding: 10px 16px 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.rm-chips::-webkit-scrollbar {
  display: none;
}

.rm-chip {
  flex: none;
  height: 32px;
  padding: 0 13px;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.rm-chip:hover {
  border-color: rgba(0, 0, 0, 0.4);
}

.rm-chip[aria-pressed='true'] {
  border-color: var(--rm-ink);
  background: var(--rm-ink);
  color: #fff;
}

.rm-list {
  flex: 1;
  min-height: 0;
  padding: 6px 10px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.rm-prod {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px;
  border-radius: 14px;
  text-align: left;
  transition: background-color 0.15s ease;
}

.rm-prod:hover {
  background: var(--rm-soft);
}

.rm-prod:active {
  transform: scale(0.99);
}

.rm-prod__img,
.rm-placed__img,
.rm-sel__img {
  display: block;
  overflow: hidden;
  border-radius: 10px;
  background: var(--thumb-bg, #f5f3f0);
}

.rm-prod__img {
  width: 64px;
  height: 64px;
}

.rm-prod__img :is(picture, img, .img-missing),
.rm-placed__img :is(picture, img, .img-missing),
.rm-sel__img :is(picture, img, .img-missing) {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rm-prod__info {
  min-width: 0;
}

.rm-prod__name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
}

.rm-prod__meta {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--rm-muted);
}

.rm-prod__price {
  display: block;
  margin-top: 2px;
  font-size: 13.5px;
  font-weight: 700;
}

.rm-prod__price small,
.rm-placed__meta small,
.rm-sel__meta small {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--rm-muted);
}

/* "no PIX" nunca quebra no meio */
.rm-prod__price small,
.rm-placed__meta small,
.rm-sel__meta small {
  white-space: nowrap;
}

/* sem WebGL a lista continua visível, mas desativada */
.rm-prod:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rm-prod:disabled:hover {
  background: none;
}

.rm-prod:disabled .rm-prod__plus {
  background: rgba(0, 0, 0, 0.35);
  transform: none;
}

.rm-prod__plus {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--rm-accent);
  color: #fff;
  transition: transform 0.15s ease;
}

.rm-prod:hover .rm-prod__plus {
  transform: scale(1.08);
}

.rm-prod__plus svg {
  width: 16px;
  height: 16px;
}

.rm-prod__count {
  position: absolute;
  top: 3px;
  left: 3px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--rm-ink);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.rm-list__empty {
  padding: 24px 12px;
  color: var(--rm-muted);
  font-size: 14px;
  text-align: center;
}

/* Itens no ambiente */
.rm-placed {
  flex: 1;
  min-height: 0;
  padding: 8px 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.rm-placed__item {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 4px;
  border-radius: 14px;
  transition: background-color 0.15s ease;
}

.rm-placed__item:hover {
  background: var(--rm-soft);
}

.rm-placed__item.is-sel {
  background: #efebe5;
}

.rm-placed__main {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px;
  text-align: left;
}

.rm-placed__img {
  flex: none;
  width: 48px;
  height: 48px;
}

.rm-placed__info {
  flex: 1;
  min-width: 0;
}

.rm-placed__name {
  display: block;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rm-placed__meta {
  display: block;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rm-placed__flag {
  color: var(--rm-accent);
}

.rm-placed__flag.is-soft {
  color: var(--rm-warn);
}

.rm-placed__flag svg {
  width: 18px;
  height: 18px;
}

.rm-clear {
  align-self: flex-start;
  margin: 6px 18px 16px;
}

.rm-clear.is-confirm {
  border-color: var(--rm-accent);
  color: var(--rm-accent);
}

/* ---------- Palco 3D ---------- */
.rm-stage {
  grid-area: stage;
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  outline: none;
  background: var(--rm-bg);
}

.rm-stage:focus-visible {
  box-shadow: inset 0 0 0 3px rgba(var(--rm-accent-rgb), 0.35);
}

.rm-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.rm-svg {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.rm-svg text {
  fill: #4a4540;
  font-family: var(--font, 'Urbanist', sans-serif);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-anchor: middle;
  dominant-baseline: middle;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.88);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.rm-svg .rm-tick {
  fill: #6b645c;
}

.rm-svg .rm-plabel {
  fill: #2e2a26;
}

.rm-svg .rm-plabel--sel {
  font-size: 12px;
  font-weight: 700;
  fill: #111;
}

.rm-svg .rm-plabel--dims {
  fill: #111;
}

.rm-dim line {
  stroke: #3d3833;
  stroke-width: 1.2;
}

.rm-dim--room .rm-dim__label {
  font-size: 12px;
  font-weight: 700;
  fill: #1d1d1f;
}

.rm-dim--gap line {
  stroke: #1d1d1f;
  stroke-dasharray: 4 3;
}

.rm-dim--gap line + line,
.rm-dim--gap line + line + line {
  stroke-dasharray: none;
}

.rm-dim--gap .rm-dim__label {
  fill: #1d1d1f;
  font-weight: 700;
}

/* Alça de giro */
.rm-rot {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #fff;
  color: var(--rm-ink);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25), 0 0 0 1.5px rgba(0, 0, 0, 0.08);
  cursor: grab;
  touch-action: none;
  will-change: transform;
}

.rm-rot[hidden] {
  display: none !important;
}

.rm-rot svg {
  width: 20px;
  height: 20px;
}

.rm-rot.is-dragging {
  background: var(--rm-ink);
  color: #fff;
  cursor: grabbing;
}

/* Avisos */
.rm-flash {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: max-content;
  max-width: calc(100% - 24px);
  transform: translateX(-50%);
  pointer-events: none;
}

.rm-alert,
.rm-note {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 14px;
  border-radius: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
}

.rm-alert svg {
  width: 18px;
  height: 18px;
}

.rm-alert--bad {
  border: 1px solid rgba(var(--rm-accent-rgb), 0.35);
  background: #fff;
  color: var(--rm-accent);
}

.rm-alert--soft {
  border: 1px solid #efd29a;
  background: #fff8ea;
  color: var(--rm-warn);
}

.rm-note {
  background: rgba(20, 20, 20, 0.88);
  color: #fff;
}

/* Estado vazio */
.rm-empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 20px;
  pointer-events: none;
}

.rm-empty__card {
  max-width: 340px;
  padding: 22px 24px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
  text-align: center;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.rm-empty__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: rgba(var(--rm-accent-rgb), 0.1);
  color: var(--rm-accent);
}

.rm-empty__icon svg {
  width: 26px;
  height: 26px;
}

.rm-empty__title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.rm-empty__text {
  margin-top: 6px;
  font-size: 14px;
  color: var(--rm-muted);
}

/* Item selecionado */
.rm-sel {
  position: absolute;
  bottom: 14px;
  left: 50%;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(620px, calc(100% - 24px));
  padding: 10px 12px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.18);
  transform: translateX(-50%);
}

.rm-sel__row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.rm-sel__img {
  flex: none;
  width: 44px;
  height: 44px;
}

.rm-sel__info {
  flex: 1;
  min-width: 0;
}

.rm-sel__name {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rm-sel__meta {
  display: block;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rm-sel__meta > span {
  font-weight: 500;
  color: var(--rm-muted);
}

.rm-sel__row--tools {
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.rm-sel__variant {
  font-size: 13px;
  color: var(--rm-muted);
}

.rm-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rm-swatch {
  width: 32px;
  height: 32px;
  padding: 3px;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  transition: border-color 0.15s ease;
}

.rm-swatch:hover {
  border-color: rgba(0, 0, 0, 0.4);
}

.rm-swatch[aria-pressed='true'] {
  border-color: var(--rm-ink);
}

.rm-swatch span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.rm-swatch[data-out] span {
  opacity: 0.45;
}

.rm-sel__acts {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.rm-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.rm-act:hover {
  background: var(--rm-soft);
}

.rm-act[data-rm-act^='rot'] {
  width: 38px;
  padding: 0;
}

.rm-act svg {
  width: 18px;
  height: 18px;
}

.rm-act--danger:hover {
  border-color: rgba(var(--rm-accent-rgb), 0.5);
  color: var(--rm-accent);
}

/* Dica de uso */
.rm-hint {
  position: absolute;
  bottom: 12px;
  left: 14px;
  z-index: 1;
  max-width: calc(100% - 28px);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: rgba(0, 0, 0, 0.66);
  font-size: 12.5px;
  pointer-events: none;
}

/* Carregando */
.rm-loading {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  background: var(--rm-bg);
  color: var(--rm-muted);
  font-size: 14px;
  text-align: center;
}

.rm-loading.is-error {
  color: var(--rm-ink);
}

/* Sem WebGL: cartão com o aviso e o botão de voltar */
.rm-fail {
  max-width: 360px;
  padding: 24px 26px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.rm-fail__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: rgba(154, 91, 0, 0.12);
  color: var(--rm-warn);
}

.rm-fail__icon svg {
  width: 24px;
  height: 24px;
}

.rm-fail__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.rm-fail__text {
  margin: 6px 0 16px;
  color: var(--rm-muted);
  font-size: 14px;
}

.rm-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0, 0, 0, 0.15);
  border-top-color: var(--rm-accent);
  border-radius: 50%;
  animation: rm-spin 0.8s linear infinite;
}

@keyframes rm-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Rodapé: total e carrinho ---------- */
.rm-foot {
  grid-area: foot;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  background: var(--rm-panel);
  border-top: 1px solid var(--rm-line);
}

.rm-total {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.rm-total__label {
  font-size: 12.5px;
  color: var(--rm-muted);
}

.rm-total__value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
}

.rm-total__alt {
  font-size: 12px;
  color: var(--rm-muted);
}

.rm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.rm-btn svg {
  width: 20px;
  height: 20px;
}

.rm-btn--primary {
  background: var(--rm-accent);
  color: #fff;
}

.rm-btn--primary:hover:not(:disabled) {
  background: var(--accent-hover, #c8161f);
  transform: translateY(-1px);
}

.rm-btn--primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.rm-btn--primary.is-done {
  background: var(--success, #16703d);
}

.rm-btn--ghost {
  min-height: 40px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #fff;
  font-size: 13.5px;
  font-weight: 600;
}

.rm-btn--ghost svg {
  width: 18px;
  height: 18px;
}

/* ---------- Telas médias ---------- */
@media (max-width: 1100px) {
  .rm {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .rm-pill svg,
  .rm-seg button svg {
    display: none;
  }
}

/* ---------- Celular ---------- */
@media (max-width: 820px) {
  .room3d {
    min-height: 520px;
  }

  .rm {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    grid-template-areas:
      'top'
      'stage'
      'cat'
      'foot';
  }

  .rm-top {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      'text close'
      'tools tools';
    gap: 8px;
    padding: 10px 14px;
  }

  .rm-title {
    font-size: 18px;
  }

  .rm-sub {
    font-size: 12px;
  }

  .rm-close {
    width: 36px;
    height: 36px;
  }

  .rm-tools {
    gap: 6px;
  }

  .rm-select select {
    height: 36px;
    padding: 0 30px 0 12px;
    background-position: right 11px center;
    font-size: 13px;
  }

  .rm-pill {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
  }

  .rm-seg {
    margin-left: auto;
  }

  .rm-seg button {
    height: 30px;
    padding: 0 11px;
    font-size: 13px;
  }

  /* no celular o painel de medidas ocupa a largura da barra (não estoura a tela) */
  .rm-sizewrap {
    position: static;
  }

  .rm-pop {
    top: calc(100% - 2px);
    left: 14px;
    right: 14px;
    width: auto;
  }

  .rm-cat {
    border-top: 1px solid var(--rm-line);
    border-right: 0;
  }

  .rm-tabs {
    gap: 16px;
    padding: 2px 14px 0;
  }

  .rm-tabs button {
    padding: 8px 2px 9px;
    font-size: 13.5px;
  }

  .rm-search {
    margin: 8px 14px 0;
  }

  .rm-search input {
    height: 38px;
    font-size: 14px;
  }

  .rm-chips {
    padding: 8px 14px 2px;
  }

  .rm-chip {
    height: 30px;
    font-size: 12.5px;
  }

  .rm-list {
    display: flex;
    flex: none;
    gap: 8px;
    padding: 8px 14px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .rm-list::-webkit-scrollbar {
    display: none;
  }

  .rm-list__item {
    flex: none;
    width: 168px;
    scroll-snap-align: start;
  }

  .rm-list__empty {
    width: 100%;
    padding: 14px 0;
  }

  .rm-prod {
    grid-template-columns: 50px minmax(0, 1fr);
    gap: 8px;
    height: 100%;
    padding: 6px;
    border: 1px solid var(--rm-line);
  }

  .rm-prod__img {
    width: 50px;
    height: 50px;
  }

  .rm-prod__plus,
  .rm-prod__meta {
    display: none;
  }

  .rm-prod__name {
    font-size: 12.5px;
  }

  .rm-prod__price {
    font-size: 12.5px;
  }

  .rm-placed {
    flex: none;
    max-height: 150px;
    padding: 4px 8px;
  }

  .rm-placed__main {
    padding: 5px 6px;
  }

  .rm-placed__img {
    width: 38px;
    height: 38px;
  }

  .rm-clear {
    margin: 2px 14px 10px;
  }

  .rm-sel {
    bottom: 10px;
    gap: 6px;
    width: calc(100% - 20px);
    padding: 8px 10px;
    border-radius: 16px;
  }

  .rm-sel__img {
    width: 36px;
    height: 36px;
  }

  .rm-sel__name {
    font-size: 13px;
  }

  .rm-sel__meta {
    font-size: 12px;
  }

  .rm-sel__row--tools {
    flex-wrap: nowrap;
  }

  .rm-swatches {
    flex-wrap: nowrap;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .rm-swatch {
    flex: none;
    width: 30px;
    height: 30px;
  }

  .rm-act {
    width: 38px;
    padding: 0;
  }

  .rm-act span {
    display: none;
  }

  .rm-rot {
    width: 44px;
    height: 44px;
  }

  .rm-hint {
    bottom: 10px;
    left: 10px;
    max-width: calc(100% - 20px);
    font-size: 11.5px;
  }

  .rm-flash {
    top: 10px;
  }

  .rm-alert,
  .rm-note {
    padding: 7px 12px;
    font-size: 12.5px;
  }

  .rm-empty__card {
    padding: 16px 18px;
  }

  .rm-empty__title {
    font-size: 16px;
  }

  .rm-empty__text {
    font-size: 13px;
  }

  .rm-foot {
    gap: 10px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .rm-total__value {
    font-size: 18px;
  }

  .rm-total__label {
    font-size: 11.5px;
  }

  .rm-total__alt {
    display: none;
  }

  .rm-buy {
    min-height: 44px;
    padding: 0 16px;
    font-size: 13px;
  }

  .rm-buy svg {
    width: 18px;
    height: 18px;
  }
}

/* Avisos do site (ex.: "3 itens adicionados ao carrinho") acima do rodapé do ambiente, sem cobrir o botão */
body.is-room .toast {
  bottom: calc(86px + env(safe-area-inset-bottom, 0px));
}

@media (prefers-reduced-motion: reduce) {
  .room3d * {
    transition: none !important;
    animation: none !important;
  }
}
