/* ====== Общие стили ====== */
html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    font-family: 'Advent Pro', sans-serif;
    background-color: #fff;
    color: #111;
}

/* ====== Заголовок ====== */
.viz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    border-bottom: 1px solid #eee;
    background: #fff;
    z-index: 10;
}

.viz-header h1 {
    font-weight: 700;
    font-size: 1.8rem;
    margin: 0;
}

.viz-header span {
    font-weight: 400;
}

.main-site-btn {
    border: 1px solid #111;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    color: #111;
    font-weight: 500;
    transition: all 0.3s;
}

.main-site-btn:hover {
    background-color: #111;
    color: #fff;
}

/* ====== Основная структура ====== */
.viz-main {
    display: flex;
    height: calc(100vh - 80px); /* вычитаем высоту заголовка */
    width: 100%;
    overflow: hidden;
}

/* ====== Левое меню ====== */
.viz-menu {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 18px;
    width: 220px;
    min-width: 220px;
    background-color: #f8f8f8;
    padding: 40px 30px;
    border-right: 1px solid #ddd;
    box-sizing: border-box;
}

.viz-menu a {
    font-weight: 500;
    text-decoration: none;
    color: #111;
    font-size: 1.2rem;
    transition: color 0.3s;
}

.viz-menu a.active {
    font-weight: 700;
    border-bottom: 2px solid #111;
    padding-bottom: 3px;
}

.viz-menu a.active::after {
    content: " →";
    font-weight: 700;
}

.viz-menu a.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.viz-menu a:hover {
    color: #555;
}

/* ====== Контентная часть ====== */
.viz-content {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 20px;
    background: #fff;
    box-sizing: border-box;
}

/* ====== Зона загрузки ====== */
.upload-area {
    text-align: center;
}

.upload-box {
    border: 2px dashed #dadada;
    border-radius: 10px;
    width: 600px;
    height: 420px;
    background-color: #f8f8f8;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.upload-box:hover {
    border-color: #3f3f3f;
    background-color: #f2f2f2;
}

.upload-content h2 {
    font-weight: 500;
    font-size: 1.4rem;
}

.upload-content p {
    color: #555;
    margin-top: 10px;
    font-size: 0.95rem;
}

/* ====== Предпросмотр изображения ====== */
.image-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 70vh;
    overflow: hidden;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* сохраняем пропорции, не обрезаем */
    border-radius: 8px;
    border: 1px solid #ccc;
}

/* ====== Кнопки ====== */
.upload-controls {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn {
    border: 1px solid #111;
    padding: 8px 18px;
    font-weight: 500;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
}

.btn:hover {
    background-color: #111;
    color: #fff;
}

.btn.primary {
    background-color: #111;
    color: #fff;
}

.btn.primary:hover {
    opacity: 0.8;
}

/* ====== Шаг 2 (узор) ====== */
.step-2 {
    display: flex;
    gap: 50px;
    align-items: center;
    justify-content: center;
}

.image-preview-area img {
    width: 400px;
    border: 1px solid #ccc;
    border-radius: 8px;
}

.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.controls-panel h3 {
    margin-bottom: 10px;
}


/* ===== Шаг 3 ===== */
.facade-section {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}


.facade-left {
    position: absolute;
    left: 220px;              /* учёт левого меню */
    right: 220px;             /* учёт правой галереи */
    top: 80px;                /* под шапкой */
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: all 0.5s ease; /* плавный переход */
}

/* Когда галерея скрыта */
.facade-left.wide {
    right: 0; /* убираем отступ справа */
}



.facade-gallery {
    position: fixed;
    top: 78px;              /* высота шапки — подгоняем под .viz-header */
    right: 0;
    width: 250px;
    height: calc(100vh - 80px); /* оставляем место под шапку */
    background-color: #f8f8f8;
    border-left: 1px solid #ddd;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    z-index: 10;
}



.facade-gallery h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    font-weight: 400;
    text-align: center;
}

.gallery-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gallery-item {
    width: 100%;
    border-radius: 6px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.3s, transform 0.2s;
}

.gallery-item:hover {
    transform: scale(1.03);
}

.gallery-item.selected {
    border-color: #111;
}














/* ===== ШАГ 4 ===== */
.step-4 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.overlay-container {
  position: relative;
  width: auto;
  max-width: 90%;
  height: 70vh;
  margin: auto;
  overflow: hidden;
}

.facade-base {
  height: 100%;
  width: auto;
  display: block;
  margin: 0 auto;
  object-fit: contain;
  pointer-events: none;
}

/* трансформируемое изображение */
.warp-box {
  position: absolute;
  left: 0;
  top: 0;
  width: 500px;
  height: 350px;
  transform: translate(-50%, -50%);  
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform-origin: 0 0;
  cursor: grab;
  z-index: 3;
}

/* ручки */
.handle {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #333;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  cursor: grab;
  z-index: 5;
  transition: transform 0.15s ease;
}

.handle:active {
  transform: scale(1.3);
  cursor: grabbing;
}

.overlay-controls {
  margin-top: 25px;
  display: flex;
  gap: 15px;
}