/* Стили для кнопки виртуальной примерки */
.ai-fitting-trigger {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    
    padding: 16px 24px;
    border-radius: 50px;
    border: none;
    
    font-size: 16px;
    font-weight: 600;
    
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    
    transition: all 0.3s ease;
}

.ai-fitting-trigger:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.6);
}

.ai-fitting-trigger:active {
    transform: translateY(-1px);
}

/* Модальное окно */
.ai-fitting-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.ai-fitting-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.ai-fitting-modal-content {
    position: relative;
    background: #fff;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1;
    margin: 0 auto;
}

.ai-fitting-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 32px;
    font-weight: 300;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.ai-fitting-close:hover {
    color: #333;
}

.ai-fitting-title {
    margin: 0 0 20px 0;
    font-size: 28px;
    font-weight: 700;
    color: #333;
    text-align: center;
}

.ai-fitting-instruction {
    background: #f8f9ff;
    border-left: 4px solid #667eea;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
}

.ai-fitting-instruction p {
    margin: 0 0 10px 0;
    color: #555;
    font-size: 15px;
}

.ai-fitting-instruction ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.ai-fitting-instruction li {
    margin: 5px 0;
    color: #666;
    font-size: 14px;
}

/* Область загрузки фото */
.ai-fitting-upload-area {
    margin-bottom: 30px;
}

.ai-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 60px 20px;
    
    cursor: pointer;
    transition: all 0.3s;
}

.ai-upload-label:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.ai-upload-label svg {
    color: #667eea;
    margin-bottom: 15px;
}

.ai-upload-label span {
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
}

.ai-photo-preview {
    text-align: center;
}

.ai-photo-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.ai-change-photo {
    background: #f0f0f0;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: background 0.2s;
}

.ai-change-photo:hover {
    background: #e0e0e0;
}

/* Ошибка загрузки */
.ai-upload-error {
    color: #e53935;
    font-size: 14px;
    margin-top: 10px;
    text-align: center;
    font-weight: 600;
}

/* Кнопки */
.ai-btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 18px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.ai-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.ai-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Прелоадер */
.ai-fitting-loader {
    text-align: center;
    padding: 40px 20px;
}

.ai-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: ai-spin 1s linear infinite;
}

@keyframes ai-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ai-fitting-loader p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

.ai-fitting-loader small {
    color: #999;
    font-size: 13px;
}

/* Результат */
.ai-fitting-result {
    text-align: center;
}

.ai-fitting-result h4 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #333;
}

.ai-result-img {
    max-width: 100%;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.ai-result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.ai-btn-download {
    display: inline-block;
    background: #28a745;
    color: #fff;
    padding: 14px 30px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.ai-btn-download:hover {
    background: #218838;
    transform: translateY(-2px);
}

.ai-btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: none;
    padding: 14px 30px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.ai-btn-secondary:hover {
    background: #e0e0e0;
}

/* Адаптивность */
@media (max-width: 768px) {
    .ai-fitting-modal {
        padding: 10px;
    }

    .ai-fitting-trigger {
        bottom: 20px;
        right: 20px;
        padding: 14px 20px;
        font-size: 14px;
    }

    .ai-fitting-modal-content {
        padding: 30px 20px;
        width: 95%;
    }
    
    .ai-fitting-title {
        font-size: 22px;
    }
    
    .ai-result-actions {
        flex-direction: column;
    }
    
    .ai-btn-download,
    .ai-btn-secondary {
        width: 100%;
        text-align: center;
    }
}
