/* Просмотр этажей дома: canvas + SVG overlay */

#house-cut-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  display: none;
  background: #1a1a1a;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#house-cut-wrapper.is-visible {
  display: block;
}

body.show-house-cut #panorama {
  pointer-events: none;
}

body.show-house-cut #house-viewer-wrapper {
  display: none !important;
}

body.show-house-cut .ui {
  display: block !important;
  z-index: 100;
  pointer-events: auto;
}

#house-cut-viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
}

#house-cut-viewport.is-dragging {
  cursor: grabbing;
}

#house-cut-stage {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}

#house-cut-canvas {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#house-cut-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

#house-cut-svg svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

#house-cut-svg path[data-floor] {
  cursor: pointer;
  pointer-events: auto;
  transition: fill-opacity 0.15s ease, stroke 0.15s ease, stroke-width 0.15s ease;
}

#house-cut-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 26, 26, 0.72);
  color: #fff;
  font-family: Manrope, sans-serif;
  font-size: 15px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

#house-cut-loading.is-visible {
  opacity: 1;
  visibility: visible;
}

/* Плашка этажа */
.house-cut-tooltip {
  position: absolute;
  z-index: 5;
  box-sizing: border-box;
  min-width: calc(var(--cut-tip-min-width-base, 260px) * var(--ui-scale, 0.7));
  max-width: calc(var(--cut-tip-max-width-base, 340px) * var(--ui-scale, 0.7));
  padding: calc(var(--cut-tip-pad-y-base, 14px) * var(--ui-scale, 0.7))
    calc(var(--cut-tip-pad-x-base, 18px) * var(--ui-scale, 0.7));
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: calc(var(--cut-tip-radius-base, 16px) * var(--ui-scale, 0.7));
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  font-family: Manrope, sans-serif;
  color: #1a1a1a;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transform: none;
  transition: opacity 0.12s ease;
}

.house-cut-tooltip.is-visible {
  opacity: 1;
  visibility: visible;
}

.house-cut-tooltip__title {
  margin: 0 0 calc(10px * var(--ui-scale, 0.7));
  padding-bottom: calc(10px * var(--ui-scale, 0.7));
  border-bottom: 1px solid #e8e8e8;
  font-size: calc(var(--cut-tip-title-base, 18px) * var(--ui-scale, 0.7));
  font-weight: 700;
  line-height: 1.2;
  color: #5c3d3d;
}

.house-cut-tooltip__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.house-cut-tooltip__row {
  display: flex;
  align-items: baseline;
  gap: calc(8px * var(--ui-scale, 0.7));
  margin: 0;
  padding: calc(4px * var(--ui-scale, 0.7)) 0;
  font-size: calc(var(--cut-tip-row-base, 13px) * var(--ui-scale, 0.7));
  line-height: 1.35;
  color: #333;
}

.house-cut-tooltip__label {
  flex: 0 1 auto;
  white-space: nowrap;
}

.house-cut-tooltip__dots {
  flex: 1 1 auto;
  min-width: 12px;
  height: 1em;
  border-bottom: 1px dotted #bdbdbd;
  transform: translateY(-4px);
}

.house-cut-tooltip__price {
  flex: 0 0 auto;
  font-weight: 700;
  color: #111;
  white-space: nowrap;
}

.house-cut-tooltip__empty {
  margin: 0;
  font-size: calc(var(--cut-tip-row-base, 13px) * var(--ui-scale, 0.7));
  color: #777;
}

.house-cut-tooltip__go {
  display: block;
  width: 100%;
  margin: calc(14px * var(--ui-scale, 0.7)) 0 0;
  padding: calc(var(--cut-tip-btn-pad-y-base, 10px) * var(--ui-scale, 0.7))
    calc(12px * var(--ui-scale, 0.7));
  border: 2px solid #8a4f4a;
  border-radius: calc(10px * var(--ui-scale, 0.7));
  background: transparent;
  color: #8a4f4a;
  font-family: Manrope, sans-serif;
  font-size: calc(var(--cut-tip-btn-base, 14px) * var(--ui-scale, 0.7));
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.house-cut-tooltip__go:hover {
  background: rgba(138, 79, 74, 0.08);
}

/* Подсказка «можно таскать» */
.house-cut-drag-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  bottom: auto;
  z-index: 6;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(8px * var(--ui-scale, 0.7));
  padding: calc(12px * var(--ui-scale, 0.7)) calc(16px * var(--ui-scale, 0.7));
  border-radius: calc(16px * var(--ui-scale, 0.7));
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.house-cut-drag-hint.is-visible {
  opacity: 1;
  visibility: visible;
}

.house-cut-drag-hint__icon {
  width: calc(56px * var(--ui-scale, 0.7));
  height: calc(56px * var(--ui-scale, 0.7));
  position: relative;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none'%3E%3Cpath d='M32 10v8M32 46v8M10 32h8M46 32h8' stroke='%238b4a3c' stroke-width='2.5' stroke-linecap='round'/%3E%3Cpath d='M32 6l-4 5h8l-4-5zM32 58l-4-5h8l-4 5zM6 32l5-4v8l-5-4zM58 32l-5-4v8l5-4z' fill='%238b4a3c'/%3E%3Cpath d='M28.5 34.5V22.2c0-1.3 1-2.2 2.2-2.2s2.2 1 2.2 2.2V34M32.9 25.5V21c0-1.2 1-2.1 2.1-2.1 1.2 0 2.1.9 2.1 2.1v8.2M37.1 27.2v-3.4c0-1.1.9-2 2-2s2 .9 2 2v8.8c0 5.2-3.4 9.4-8.2 10.4-.7.1-1.4.2-2.1.2h-.3c-4.7 0-8.7-3.2-9.8-7.7l-1.9-7.4c-.3-1.2.4-2.4 1.6-2.7 1.1-.3 2.3.4 2.6 1.5l1.1 4.2' stroke='%238b4a3c' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: house-cut-drag-hint-pulse 1.4s ease-in-out infinite;
}

.house-cut-drag-hint__icon::before,
.house-cut-drag-hint__icon::after {
  content: none;
}

.house-cut-drag-hint__text {
  font-family: Manrope, sans-serif;
  font-size: calc(12px * var(--ui-scale, 0.7));
  font-weight: 600;
  color: #5c3d3d;
  white-space: nowrap;
}

@keyframes house-cut-drag-hint-pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.06); opacity: 1; }
}
