/* ===== SERVICE MODAL ===== */
.service-modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5); z-index: 1000;
    display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 768px) { .service-modal-overlay { align-items: center; } }

.service-modal {
    background: white; border-radius: 20px 20px 0 0;
    width: 100%; max-width: 500px; max-height: 90vh;
    display: flex; flex-direction: column;
    animation: slideUp 0.3s ease; overflow: hidden;
}
@media (min-width: 768px) { .service-modal { border-radius: 20px; max-height: 80vh; } }

.service-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px; border-bottom: 1px solid #f0f0f0; flex-shrink: 0;
}
.service-modal-back, .service-modal-close {
    background: none; border: none; padding: 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px; transition: background 0.2s;
}
.service-modal-back:hover, .service-modal-close:hover { background: #f5f5f5; }
.service-modal-back svg, .service-modal-close svg { width: 24px; height: 24px; stroke: #666; }
.service-modal-title { font-size: 18px; font-weight: 600; color: #1a1a1a; margin: 0; }

.service-modal-body {
    flex: 1; overflow-y: auto; padding: 20px;
    -webkit-overflow-scrolling: touch;
}
.service-modal-footer {
    padding: 20px; border-top: 1px solid #f0f0f0; flex-shrink: 0;
}

/* Фото + название */
.service-header-row { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.service-photo-wrapper { position: relative; cursor: pointer; flex-shrink: 0; }
.service-photo {
    width: 70px; height: 70px; border-radius: 14px;
    background: #f8f8f8; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    overflow: hidden; border: 1px dashed #ccc;
    cursor: pointer; transition: all 0.2s;
}
.service-photo:hover { border-color: #dd1847; background: #fdf2f5; }
.service-photo img { width: 100%; height: 100%; object-fit: cover; }
.service-photo-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.2s;
}
.service-photo-wrapper:hover .service-photo-overlay { opacity: 1; }
.service-photo-delete {
    position: absolute; bottom: -5px; right: -5px;
    width: 26px; height: 26px; border-radius: 50%;
    background: #f44336; border: 2px solid white; color: white;
    cursor: pointer; display: flex; align-items: center;
    justify-content: center; padding: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15); z-index: 5;
}
.service-name-category { flex: 1; display: flex; flex-direction: column; gap: 10px; }

/* Поля */
.service-input {
    width: 100%; padding: 12px 14px; border: 1px solid #e0e0e0;
    border-radius: 12px; font-size: 15px; background: #f8f8f8;
    transition: all 0.2s; box-sizing: border-box; font-family: inherit;
}
.service-input:focus { outline: none; border-color: #dd1847; background: white; }
.service-category-row {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 12px; background: #f8f8f8;
    border-radius: 10px; cursor: pointer; transition: background 0.2s;
}
.service-category-row:hover { background: #f0f0f0; }
.service-category-label { font-size: 13px; color: #888; }
.service-category-value { flex: 1; font-size: 14px; font-weight: 500; color: #1a1a1a; }

/* Блоки */
.service-block {
    margin-bottom: 20px; padding: 16px;
    background: white; border: 1px solid #f0f0f0; border-radius: 16px;
}
.service-block-title { font-size: 15px; font-weight: 600; color: #1a1a1a; margin: 0; }
.service-section-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 0; cursor: pointer;
}
.service-section-row:not(:last-child) {
    border-bottom: 1px solid #f5f5f5; margin-bottom: 4px; padding-bottom: 12px;
}
.service-section-value { font-size: 14px; color: #888; margin-right: 8px; }

/* Стоимость */
.service-price-header {
    display: flex; align-items: center; justify-content: space-between;
    margin: 12px 0; font-size: 14px; color: #1a1a1a;
}
.service-price-row {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 14px; color: #1a1a1a;
}
.service-price-controls { display: flex; align-items: center; gap: 10px; }
.price-from-btn {
    padding: 6px 12px; background: #f8f8f8; border: 1px solid #e0e0e0;
    border-radius: 16px; font-size: 13px; font-weight: 500; color: #888;
    cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.price-from-btn.active { background: #dd1847; border-color: #dd1847; color: white; }
.service-price-currency { font-size: 14px; color: #666; font-weight: 500; }

/* Тоггл */
.service-toggle { position: relative; display: inline-block; width: 48px; height: 26px; }
.service-toggle input { opacity: 0; width: 0; height: 0; }
.service-toggle-slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc; transition: .3s; border-radius: 26px;
}
.service-toggle-slider:before {
    position: absolute; content: ""; height: 22px; width: 22px;
    left: 2px; bottom: 2px; background-color: white; transition: .3s; border-radius: 50%;
}
.service-toggle input:checked + .service-toggle-slider { background-color: #dd1847; }
.service-toggle input:checked + .service-toggle-slider:before { transform: translateX(22px); }

/* Описание */
.service-textarea {
    width: 100%; padding: 12px; border: 1px solid #e0e0e0;
    border-radius: 12px; font-size: 15px; background: #f8f8f8;
    resize: vertical; min-height: 80px; font-family: inherit;
    box-sizing: border-box; margin-top: 10px;
}
.service-textarea:focus { outline: none; border-color: #dd1847; background: white; }

/* Фото работ */
.service-photos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.service-photo-add {
    width: 90px; height: 90px; border: 2px dashed #e0e0e0;
    border-radius: 12px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 4px;
    cursor: pointer; transition: all 0.2s; background: #f8f8f8;
}
.service-photo-add:hover { border-color: #dd1847; background: #fdf2f5; }
.service-photo-add.disabled { opacity: 0.4; pointer-events: none; }
.service-work-photo-item {
    position: relative; width: 90px; height: 90px;
    border-radius: 12px; overflow: hidden; border: 1px solid #e0e0e0;
}
.service-work-photo-item img { width: 100%; height: 100%; object-fit: cover; }
.service-work-photo-delete {
    position: absolute; top: 4px; right: 4px;
    width: 22px; height: 22px; border-radius: 50%;
    background: rgba(0,0,0,0.6); border: none; color: white;
    cursor: pointer; display: flex; align-items: center;
    justify-content: center; font-size: 14px; line-height: 1;
}
.service-photos-hint { font-size: 12px; color: #999; margin-top: 8px; margin-bottom: 0; }

/* Удалить */
.service-block-danger { border-color: #f44336; background: #fff8f8; }
.service-delete-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 12px; background: transparent; border: none;
    color: #f44336; font-size: 14px; font-weight: 500; cursor: pointer;
    font-family: inherit;
}

/* Сохранить */
.service-save-btn {
    width: 100%; padding: 16px; background: #dd1847; color: white;
    border: none; border-radius: 12px; font-size: 16px; font-weight: 600;
    cursor: pointer; font-family: inherit;
}
.service-save-btn:hover { background: #c4153e; }
.service-save-btn:disabled { background: #ccc; cursor: not-allowed; }

/* Категории */
.category-selector-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 1200;
    display: flex; align-items: center; justify-content: center;
}
.category-selector-content {
    background: white; border-radius: 20px; width: 90%;
    max-width: 420px; max-height: 70vh; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.category-selector-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px; border-bottom: 1px solid #f0f0f0;
}
.category-selector-header h3 { margin: 0; font-size: 18px; font-weight: 600; }
.category-selector-close {
    background: none; border: none; width: 32px; height: 32px;
    border-radius: 8px; cursor: pointer; color: #666;
}
.category-selector-list { max-height: 50vh; overflow-y: auto; padding: 8px; }
.category-selector-item {
    padding: 16px; border-radius: 12px; cursor: pointer;
    transition: background 0.2s; color: #1a1a1a;
}
.category-selector-item:hover { background: #f5f5f5; }
.category-selector-footer { padding: 16px; border-top: 1px solid #f0f0f0; }
.create-category-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 14px; background: white;
    border: 1px dashed #dd1847; border-radius: 12px;
    color: #dd1847; font-size: 15px; font-weight: 500; cursor: pointer;
}

/* Создание категории */
.create-category-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 1300;
    display: flex; align-items: center; justify-content: center;
}
.create-category-modal {
    background: white; border-radius: 20px; width: 90%;
    max-width: 420px; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.create-category-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px; border-bottom: 1px solid #f0f0f0;
}
.create-category-header h3 { margin: 0; font-size: 18px; font-weight: 600; }
.create-category-close {
    background: none; border: none; padding: 8px; cursor: pointer;
    border-radius: 8px; color: #666;
}
.create-category-body { padding: 20px; }
.create-category-input {
    width: 100%; padding: 14px; border: 1px solid #e0e0e0;
    border-radius: 12px; font-size: 15px; background: #f8f8f8;
    box-sizing: border-box; font-family: inherit;
}
.create-category-input:focus { outline: none; border-color: #dd1847; background: white; }
.create-category-footer { padding: 16px 20px 20px; display: flex; gap: 10px; }
.create-category-cancel-btn {
    flex: 1; padding: 14px; background: #f5f5f5; border: none;
    border-radius: 12px; font-size: 15px; font-weight: 500;
    color: #666; cursor: pointer; font-family: inherit;
}
.create-category-create-btn {
    flex: 1; padding: 14px; background: #dd1847; border: none;
    border-radius: 12px; font-size: 15px; font-weight: 600;
    color: white; cursor: pointer; font-family: inherit;
}
.service-modal-overlay {
    z-index: 2100 !important;
}

@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }