/* Основные стили для canvas */
.lower-canvas {
    width: 100% !important;
    height: 100% !important;
    transform-origin: 0 0;
}
.upper-canvas {
    width: 100% !important;
    height: 100% !important;
    transform-origin: 0 0;
}

/* Кнопка добавления изображения на мобильных */
.mobile-file-btn {
    position: fixed;
    bottom: 120px;
    right: 20px;
    z-index: 10000;
    padding: 10px 15px;
    background-color: #2196f3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Контейнер для слайдера удаления фона */
.slider-container {
    position: fixed;
    bottom: 70px;
    right: 20px;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}
.remove-bg-slider {
    width: 150px;
}

/* Кнопка закрытия */
.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10002;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    visibility: visible !important;
    opacity: 1;
}

/* Контейнер для canvas */
.canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 1);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
}
.inner-container {
    position: relative;
    background-color: transparent;
    overflow: hidden;
    display: block;
}

/* Стили для нижней панели Magnific Popup */
.mfp-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

/* Стили для кнопок "Создать макет" и "Выбор макета" */
.create-layout-btn,
.select-layout-btn {
    background-color: #2196f3;
    color: white;
    border: none;
    padding: 15px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    order: 2;
}
.create-layout-btn:hover,
.select-layout-btn:hover {
    background-color: #1976d2;
}
.select-layout-btn {
    transform: translate(-10px, -45px);
}

/* Управление видимостью кнопок */
.mobile-only {
    display: none;
}
.desktop-only {
    display: inline;
}
@media (max-width: 767px) {
    .mobile-only {
        display: block;
    }
    .desktop-only {
        display: none;
    }
    .create-layout-btn,
    .select-layout-btn {
        padding: 12px 10px;
        font-size: 12px;
    }
}

/* Стили для модального окна выбора макета */
.layout-selection-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    justify-content: center;
    align-items: center;
}
.layout-selection-modal-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    min-width: 340px;
    max-width: 400px;
    position: relative;
    text-align: center;
}
.layout-selection-modal-content p {
    margin: 0 0 20px;
    font-size: 16px;
    font-weight: bold;
}
.layout-description {
    font-size: 14px;
    font-weight: normal;
    margin: 10px 0;
    color: #555;
}
.layout-selection-modal-buttons {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: nowrap;
    width: 100%;
}
.layout-selection-btn {
    background-color: #2196f3; /* Match Выбор макета */
    color: white;
    border: none;
    padding: 10px 0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    width: 140px;
    text-align: center;
    order: unset;
}
.layout-selection-modal-buttons .create-layout-btn {
    position: static;
    bottom: auto;
    right: auto;
    z-index: auto;
    background-color: #2196f3; /* Match Выбор макета */
    padding: 10px 0;
    width: 140px;
    margin: 0;
    order: 1;
}
.layout-selection-modal-buttons .btn-primary-add-to-complex-layout {
    order: 2;
}
.layout-selection-modal-buttons .create-layout-btn:hover,
.layout-selection-modal-buttons .btn-primary-add-to-complex-layout:hover,
.layout-selection-btn:hover {
    background-color: #1976d2; /* Match Выбор макета hover */
}
.layout-selection-modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #333;
}

/* Медиа-запросы для мобильных устройств */
@media (max-width: 767px) {
    .layout-selection-modal-content {
        width: 95%;
        padding: 15px;
        min-width: 300px;
    }
    .layout-selection-btn,
    .layout-selection-modal-buttons .create-layout-btn {
        padding: 8px 0;
        font-size: 12px;
        width: 120px;
    }
}