/* ============================================================
   magazin-fit.css – стили для виджета примерки картин в магазине
   Версия: 1.0
   ============================================================ */

/* Основной контейнер */
#magazinFitContainer {
    margin: 20px 0;
    padding: 20px;
    background: #faf8f6;
    border-radius: 16px;
    max-width: 100%;
    box-sizing: border-box;
}
#magazinFitContainer h3 {
    text-align: center;
    margin-top: 0;
}
#magazinFitContainer p {
    text-align: center;
    color: #555;
}

/* Пресеты интерьеров (12 шт) */
.mf-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}
.mf-preset-bg {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: 0.2s;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}
.mf-preset-bg.active {
    border-color: #d8450b !important;
    box-shadow: 0 0 0 2px #d8450b;
}
.mf-preset-bg:hover {
    transform: scale(1.05);
}

/* Зоны загрузки (для интерьера и своей картины) */
.mf-drop-zone {
    border: 2px dashed #c0b8ae;
    border-radius: 16px;
    padding: 15px;
    background: #f5f2ed;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
    flex: 1;
    min-width: 200px;
    position: relative;
}
.mf-drop-zone.dragover {
    border-color: #d8450b;
    background: #f0ece7;
}
.mf-drop-zone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
}
.mf-drop-icon {
    font-size: 30px;
    display: block;
}
.mf-drop-hint {
    font-size: 12px;
    color: #999;
}

/* Палитра цветов и узоров (упрощена) */
.mf-palettes {
    text-align: center;
    margin: 10px 0;
}
.mf-palette-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 5px;
}
.mf-palette-label {
    font-weight: bold;
    font-size: 14px;
}
#mfColorPalette,
#mfPatternPalette {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}
.mf-color-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    position: relative;
}
.mf-color-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-image: 
        radial-gradient(circle at 30% 40%, rgba(255,255,255,0.15) 0%, transparent 60%),
        radial-gradient(circle at 70% 60%, rgba(0,0,0,0.05) 0%, transparent 50%);
    pointer-events: none;
}
.mf-color-btn:hover {
    transform: scale(1.08);
    border-color: #888;
}
.mf-color-btn.active {
    border-color: #d8450b;
    box-shadow: 0 0 0 2px #d8450b;
}
.mf-pattern-btn {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    border: 3px solid transparent;
    cursor: pointer;
    transition: 0.2s;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.mf-pattern-btn:hover {
    transform: scale(1.08);
    border-color: #888;
}
.mf-pattern-btn.active {
    border-color: #d8450b;
    box-shadow: 0 0 0 2px #d8450b;
}
.mf-pattern-btn svg {
    width: 28px;
    height: 28px;
}
#mfClearBtn {
    margin-top: 8px;
    padding: 4px 16px;
    background: #ccc;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
}

/* Управление масштабом */
.mf-controls {
    text-align: center;
    margin: 10px 0;
}
.mf-control-btn {
    padding: 8px 16px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    cursor: pointer;
    margin: 0 5px;
    transition: 0.2s;
}
.mf-control-btn:hover {
    background: #555;
}
.mf-control-btn.reset {
    background: #666;
    font-size: 14px;
}
.mf-control-btn.reset:hover {
    background: #888;
}
#mfZoomLevel {
    font-size: 14px;
    font-weight: bold;
    margin: 0 10px;
}

/* Холст */
.mf-canvas-wrapper {
    background: #eae7e2;
    border-radius: 12px;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
#mfCanvas {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    touch-action: none;
    background: #eae7e2;
    border-radius: 12px;
}

/* Кнопка скачивания */
.mf-download-btn {
    background: #1a1a1a;
    color: #fff;
    padding: 10px 30px;
    border: none;
    border-radius: 40px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s;
}
.mf-download-btn:hover {
    background: #333;
}
.mf-download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.mf-hint {
    font-size: 12px;
    color: #999;
    margin-top: 8px;
}

/* Подсказка "Нажми на картину, чтобы примерить" */
.mf-gallery-hint {
    text-align: center;
    margin: 10px 0 20px 0;
    padding: 12px 20px;
    background: #f0e6d3;
    border-radius: 8px;
    border-left: 4px solid #d8450b;
}
.mf-gallery-hint span {
    font-size: 16px;
    color: #333;
    font-weight: 600;
}
.mf-gallery-hint i {
    margin-right: 8px;
}

/* Адаптив */
@media (max-width: 480px) {
    .mf-preset-bg {
        width: 60px;
        height: 45px;
    }
    .mf-color-btn {
        width: 28px;
        height: 28px;
    }
    .mf-pattern-btn {
        width: 30px;
        height: 30px;
    }
    .mf-pattern-btn svg {
        width: 22px;
        height: 22px;
    }
}