/* Room builder 1.5.35: panel usability, pricing and scene guidance refinements. */
@media (min-width: 992px) {
  body.room-builder #whatsapp-btn {
    display: none !important;
  }

  .bb-room-builder-page.container {
    padding: 14px 15px 48px 18px !important;
  }

  .bb-room-builder-page > .row {
    margin-right: 0;
    margin-left: 0;
  }

  .bb-room-builder-page #content {
    padding-right: 0 !important;
    padding-left: 0 !important;
  }

  #bb-room-builder .bb-room-layout {
    grid-template-columns: minmax(0, 1fr) clamp(400px, 26vw, 480px);
    grid-template-areas:
      "visual panel"
      "summary .";
    width: 100%;
    max-width: none;
    margin: 0;
    column-gap: clamp(18px, 1.3672vw, 28px);
  }

  #bb-room-builder .bb-room-visual-column {
    grid-area: visual;
    min-width: 0;
  }

  #bb-room-builder .bb-room-heading {
    margin-bottom: 12px !important;
    padding: 10px 14px 0 !important;
  }

  #bb-room-builder .bb-room-heading h1 {
    font-size: clamp(42px, 3.7761vw, 58px);
    font-weight: 400;
    line-height: 1.08;
  }

  #bb-room-builder .bb-room-heading h1 i {
    margin-left: 5px;
    font-size: 12px;
  }

  #bb-room-builder .bb-room-heading .bb-room-description {
    max-width: 720px;
    margin-top: 8px;
    font-size: 15px;
    line-height: 1.4;
  }

  #bb-room-builder .bb-room-stage {
    aspect-ratio: var(--bb-stage-desktop-aspect, 1.895935);
    background-position: center;
    background-size: cover;
  }

  #bb-room-builder .bb-control-panel {
    align-self: stretch;
    height: auto;
    min-height: 0;
    max-height: none;
    contain: none;
  }

  #bb-room-builder .bb-product-card,
  #bb-room-builder .bb-product-card.is-focused.is-selected {
    grid-template-columns: minmax(0, 1fr) 72px 66px 26px;
    column-gap: 3px;
  }

  #bb-room-builder .bb-product-select,
  #bb-room-builder .bb-product-card.is-focused.is-selected .bb-product-select {
    grid-template-columns: 18px 34px minmax(0, 1fr);
    gap: 6px;
  }

  #bb-room-builder .bb-product-media {
    width: 34px;
    height: 34px;
  }

  #bb-room-builder .bb-product-card > .bb-product-controls {
    grid-template-columns: 23px 26px 23px;
    width: 72px;
  }

  #bb-room-builder .bb-summary {
    margin-top: 10px;
    padding: 0 2px 18px;
  }

  #bb-room-builder .bb-summary-table-head,
  #bb-room-builder .bb-summary-item {
    grid-template-columns: minmax(82px, .8fr) minmax(140px, 2fr) 42px 78px 82px;
    gap: 8px;
  }

  #bb-room-builder + .bb-other-rooms,
  .bb-other-rooms {
    width: min(1320px, calc(100% - clamp(24px, 3vw, 48px)));
    max-width: 1320px;
    margin-right: auto;
    margin-left: auto;
  }
}

#bb-room-builder .bb-stage-instructions {
  top: 16px;
  left: 16px;
  grid-template-columns: 34px minmax(0, 1fr);
  width: min(300px, calc(100% - 150px));
  padding: 14px 16px;
  gap: 10px;
  background: rgba(52, 35, 38, .58);
  font-size: 13px;
  line-height: 1.48;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

#bb-room-builder .bb-stage-instructions i {
  font-size: 28px;
}

#bb-room-builder .bb-room-stage.has-interacted .bb-stage-instructions {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
}

#bb-room-builder .bb-control-panel {
  flex-direction: column;
}

#bb-room-builder .bb-control-header,
#bb-room-builder .bb-control-footer {
  flex: 0 0 auto;
}

#bb-room-builder .bb-control-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: auto;
  scrollbar-gutter: stable;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

#bb-room-builder .bb-product-card,
#bb-room-builder .bb-product-card.is-focused.is-selected {
  grid-template-columns: minmax(0, 1fr) 72px 72px;
  min-height: 82px;
  padding: 2px 3px;
  row-gap: 0;
}

#bb-room-builder .bb-product-card.has-personalization,
#bb-room-builder .bb-product-card.has-personalization.is-focused.is-selected {
  grid-template-columns: minmax(0, 1fr) 72px 68px 30px;
}

#bb-room-builder .bb-product-card > .bb-product-controls {
  align-self: center;
}

#bb-room-builder .bb-product-select,
#bb-room-builder .bb-product-card.is-focused.is-selected .bb-product-select {
  grid-template-columns: 20px 68px minmax(0, 1fr);
  min-height: 76px;
}

#bb-room-builder .bb-product-media {
  width: 68px;
  height: 68px;
}

#bb-room-builder .bb-product-media img {
  object-fit: cover;
  object-position: center;
}

#bb-room-builder .bb-product-copy strong {
  font-size: 12px;
}

#bb-room-builder .bb-control-footer {
  padding: 10px 14px 12px;
}

#bb-room-builder .bb-panel-totals {
  gap: 5px;
  margin-bottom: 10px;
}

#bb-room-builder .bb-panel-price-stack {
  display: grid;
  justify-items: end;
  gap: 1px;
  line-height: 1.05;
}

#bb-room-builder .bb-panel-price-stack del {
  color: #7d7d7d;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-decoration-color: #9a9a9a;
  text-decoration-thickness: 1px;
}

#bb-room-builder .bb-panel-price-stack .bb-mobile-total {
  color: #6b4f3a;
  font-size: 21px;
  font-weight: 700;
}

#bb-room-builder .bb-control-header > strong {
  width: 100%;
}

@media (max-width: 767px) {
  #bb-room-builder .bb-stage-instructions {
    top: 8px;
    left: 8px;
    grid-template-columns: 22px minmax(0, 1fr);
    width: min(220px, calc(100% - 106px));
    padding: 9px 10px;
    gap: 7px;
    font-size: 9px;
    line-height: 1.4;
  }

  #bb-room-builder .bb-stage-instructions i {
    font-size: 19px;
  }

  #bb-room-builder .bb-product-card,
  #bb-room-builder .bb-product-card.is-focused.is-selected {
    grid-template-columns: minmax(0, 1fr) 70px 62px;
    min-height: 72px;
  }

  #bb-room-builder .bb-product-card.has-personalization,
  #bb-room-builder .bb-product-card.has-personalization.is-focused.is-selected {
    grid-template-columns: minmax(0, 1fr) 70px 58px 26px;
  }

  #bb-room-builder .bb-product-select,
  #bb-room-builder .bb-product-card.is-focused.is-selected .bb-product-select {
    grid-template-columns: 17px 56px minmax(0, 1fr);
    min-height: 64px;
  }

  #bb-room-builder .bb-product-media {
    width: 56px;
    height: 56px;
  }
}

@media (max-width: 991px) {
  #bb-room-builder .bb-room-layout {
    grid-template-areas:
      "visual"
      "panel"
      "summary";
  }

  #bb-room-builder .bb-room-visual-column {
    grid-area: visual;
    min-width: 0;
  }

  #bb-room-builder .bb-control-scroll {
    flex: 0 1 auto;
    max-height: min(58vh, 620px);
    overflow-x: hidden;
    overflow-y: auto;
  }
}

/* Room builder 1.5.37: reference geometry and mobile scroll ownership. */
@media (min-width: 992px) {
  .bb-room-builder-page.container {
    padding: 14px 16px 48px !important;
  }

  #bb-room-builder .bb-room-layout {
    grid-template-columns: minmax(0, 1fr) clamp(430px, 27vw, 500px);
    grid-template-areas:
      "heading heading"
      "visual panel"
      "summary panel";
    align-items: start;
    column-gap: clamp(16px, 1.35vw, 24px);
    row-gap: 0;
  }

  #bb-room-builder .bb-room-heading {
    grid-area: heading;
    margin: 0 0 12px !important;
    padding: 4px 14px 0 !important;
  }

  #bb-room-builder .bb-room-visual-column {
    grid-area: visual;
  }

  #bb-room-builder .bb-room-stage {
    aspect-ratio: var(--bb-stage-desktop-aspect, 1.895935);
  }

  #bb-room-builder .bb-control-panel {
    grid-area: panel;
    align-self: start;
    height: min(860px, calc(100vh - 24px));
    min-height: 620px;
  }

  #bb-room-builder .bb-summary {
    grid-area: summary;
  }
}

@media (max-width: 991px) {
  #bb-room-builder .bb-room-layout {
    grid-template-areas:
      "heading"
      "visual"
      "panel"
      "summary";
  }

  #bb-room-builder .bb-room-heading {
    grid-area: heading;
  }

  #bb-room-builder .bb-room-visual-column {
    grid-area: visual;
  }

  #bb-room-builder .bb-control-panel {
    grid-area: panel;
  }

  #bb-room-builder .bb-summary {
    grid-area: summary;
  }
}

@media (max-width: 767px) {
  .bb-room-builder-page.container {
    padding: 10px 8px 100px !important;
  }

  #bb-room-builder .bb-room-layout {
    gap: 9px;
  }

  #bb-room-builder .bb-room-heading {
    padding: 0 5px !important;
  }

  #bb-room-builder .bb-room-heading h1 {
    font-size: 29px;
    line-height: 1.05;
  }

  #bb-room-builder .bb-room-heading .bb-room-description {
    margin-top: 5px;
    font-size: 11px;
    line-height: 1.35;
  }

  #bb-room-builder .bb-room-visual-column {
    position: static;
    top: auto;
    z-index: auto;
    width: calc(100% + 16px);
    margin-left: -8px;
    padding-top: 3px;
    background: #fff;
    align-self: start;
  }

  #bb-room-builder .bb-room-main,
  #bb-room-builder .bb-mobile-clear-wrap {
    margin-right: 0;
    margin-left: 0;
  }

  #bb-room-builder .bb-room-stage {
    aspect-ratio: var(--bb-stage-mobile-aspect, var(--bb-stage-desktop-aspect, 1.895935));
    border-radius: 5px;
  }

  #bb-room-builder .bb-control-panel {
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  #bb-room-builder .bb-control-scroll {
    max-height: none;
    overflow: visible;
    overscroll-behavior: auto;
    touch-action: pan-y;
  }

  #bb-room-builder .bb-control-header {
    min-height: 54px;
    padding: 0 13px;
  }

  #bb-room-builder .bb-control-header > strong {
    font-size: 28px;
  }
}

/* Component sizes live here too because this stylesheet loads after room-builder.css. */
#bb-room-builder .bb-room-heading h1 {
	font-weight: 400;
}

#bb-room-builder .bb-product-card,
#bb-room-builder .bb-product-card.is-focused.is-selected {
  grid-template-columns: minmax(0, 1fr) 76px 74px;
  min-height: 86px;
  padding: 2px 3px;
}

#bb-room-builder .bb-product-card.has-personalization,
#bb-room-builder .bb-product-card.has-personalization.is-focused.is-selected {
  grid-template-columns: minmax(0, 1fr) 76px 68px 30px;
}

#bb-room-builder .bb-product-select,
#bb-room-builder .bb-product-card.is-focused.is-selected .bb-product-select {
  grid-template-columns: 20px 76px minmax(0, 1fr);
  min-height: 80px;
  gap: 8px;
}

#bb-room-builder .bb-product-media {
  width: 76px;
  height: 76px;
}

#bb-room-builder .bb-product-copy {
  white-space: normal;
  mask-image: none;
  -webkit-mask-image: none;
}

#bb-room-builder .bb-product-copy strong {
  display: -webkit-box;
  max-height: 2.7em;
  overflow: hidden;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

@media (max-width: 767px) {
  #bb-room-builder .bb-product-card,
  #bb-room-builder .bb-product-card.is-focused.is-selected {
    grid-template-columns: minmax(0, 1fr) 70px 64px;
    min-height: 78px;
  }

  #bb-room-builder .bb-product-card.has-personalization,
  #bb-room-builder .bb-product-card.has-personalization.is-focused.is-selected {
    grid-template-columns: minmax(0, 1fr) 70px 58px 28px;
  }

  #bb-room-builder .bb-product-select,
  #bb-room-builder .bb-product-card.is-focused.is-selected .bb-product-select {
    grid-template-columns: 18px 64px minmax(0, 1fr);
    min-height: 72px;
    gap: 6px;
  }

  #bb-room-builder .bb-product-media {
    width: 64px;
    height: 64px;
  }
}

/* 1.5.39: responsive room artwork and the official room-title typeface. */
#bb-room-builder .bb-room-heading h1,
#bb-room-builder .bb-control-header > strong {
  font-family: 'Italianno', 'Brush Script MT', 'Segoe Script', cursive;
  font-weight: 400;
  letter-spacing: 0;
}

#bb-room-builder .bb-control-header > strong {
  font-size: 40px;
  line-height: 1;
}

@media (max-width: 767px) {
  #bb-room-builder .bb-room-heading h1 {
    font-size: 42px;
    line-height: 1;
  }

  #bb-room-builder .bb-control-header > strong {
    font-size: 36px;
  }
}

/* 1.5.38 mobile guidance must override the shared instruction geometry above. */
@media (max-width: 767px) {
  #bb-room-builder .bb-stage-instructions--mobile {
    top: 8px;
    left: 50%;
    grid-template-columns: none;
    width: min(220px, calc(100% - 170px));
    min-height: 38px;
    padding: 7px 9px;
    transform: translateX(-50%);
    font-size: 10px;
    line-height: 1.25;
  }

  #bb-room-builder .bb-room-stage.has-interacted .bb-stage-instructions--mobile {
    transform: translate(-50%, -5px);
  }
}

/* Collapsible stage guidance */
#bb-room-builder .bb-stage-instructions {
  display: flex;
  align-items: center;
  width: min(300px, calc(100% - 150px));
  min-height: 62px;
  max-height: 120px;
  padding: 14px 16px;
  overflow: hidden;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 7px;
  opacity: 1;
  visibility: visible;
  pointer-events: none;
  transform: translateY(0);
  transform-origin: top left;
  transition: width .46s cubic-bezier(.22, 1, .36, 1),
              min-height .4s cubic-bezier(.22, 1, .36, 1),
              max-height .4s cubic-bezier(.22, 1, .36, 1),
              padding .4s cubic-bezier(.22, 1, .36, 1),
              border-radius .4s ease,
              background-color .35s ease,
              box-shadow .35s ease,
              transform .35s ease;
}

#bb-room-builder .bb-stage-instructions--mobile {
  display: none;
}

#bb-room-builder .bb-room-stage.has-interacted .bb-stage-instructions {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#bb-room-builder .bb-stage-instructions-content {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  width: 100%;
  min-width: 266px;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  transition: opacity .2s ease, visibility .2s ease, transform .36s cubic-bezier(.22, 1, .36, 1);
}

#bb-room-builder .bb-stage-instructions-content > i {
  font-size: 28px;
}

#bb-room-builder .bb-stage-instructions-toggle {
  position: absolute;
  inset: 0;
  display: grid;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #6b4f3a;
  opacity: 0;
  pointer-events: none;
  transform: scale(.72) rotate(-18deg);
  transition: opacity .2s ease .08s, transform .42s cubic-bezier(.22, 1, .36, 1);
  place-items: center;
}

#bb-room-builder .bb-stage-instructions-toggle i {
  color: inherit;
  font-size: 17px;
  line-height: 1;
}

#bb-room-builder .bb-stage-instructions.is-collapsed {
  width: 42px;
  min-height: 42px;
  max-height: 42px;
  padding: 0;
  border-color: rgba(107, 79, 58, .18);
  border-radius: 50%;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 7px 20px rgba(37, 26, 31, .2);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

#bb-room-builder .bb-stage-instructions.is-collapsed .bb-stage-instructions-content {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-12px);
}

#bb-room-builder .bb-stage-instructions.is-collapsed .bb-stage-instructions-toggle {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1) rotate(0);
}

#bb-room-builder .bb-stage-instructions-toggle:hover,
#bb-room-builder .bb-stage-instructions-toggle:focus-visible {
  background: #6b4f3a;
  color: #fff;
  outline: 0;
}

@media (max-width: 767px) {
  #bb-room-builder .bb-stage-instructions--desktop {
    display: none;
  }

  #bb-room-builder .bb-stage-instructions--mobile {
    display: flex;
    width: min(220px, calc(100% - 170px));
    min-height: 38px;
    max-height: 80px;
    padding: 7px 9px;
    transform: translateX(-50%);
    transform-origin: top center;
  }

  #bb-room-builder .bb-room-stage.has-interacted .bb-stage-instructions--mobile {
    transform: translateX(-50%);
  }

  #bb-room-builder .bb-stage-instructions--mobile .bb-stage-instructions-content {
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 7px;
    min-width: 202px;
  }

  #bb-room-builder .bb-stage-instructions--mobile .bb-stage-instructions-content > i {
    font-size: 19px;
  }

  #bb-room-builder .bb-stage-instructions--mobile.is-collapsed {
    left: 8px;
    right: auto;
    width: 38px;
    min-height: 38px;
    max-height: 38px;
    padding: 0;
    transform: translateX(0);
    transform-origin: top left;
  }
}

@media (prefers-reduced-motion: reduce) {
  #bb-room-builder .bb-stage-instructions,
  #bb-room-builder .bb-stage-instructions-content,
  #bb-room-builder .bb-stage-instructions-toggle {
    transition-duration: .01ms;
  }
}

/* Room builder 1.5.47: keep the mobile room visible while the product list scrolls. */
@media (max-width: 767px) and (min-height: 560px) {
  #bb-room-builder .bb-room-visual-column {
    position: sticky;
    top: 0;
    z-index: 40;
    align-self: start;
    background: #fff;
    box-shadow: 0 8px 18px rgba(43, 28, 35, .08);
  }

  #bb-room-builder .bb-control-panel {
    position: relative;
    z-index: 1;
  }
}
