:root {
    --primary-color: #4f46e5;
    --primary-dark: #4338ca;
    --secondary-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px 20px 60px 20px;
}

.container {
    max-width: 790px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 30px;
}

.product-card {
    position: relative;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.product-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.product-number {
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    text-align: center;
    justify-content: center;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark-color);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.form-group {
    margin-bottom: 10px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
    font-size: 0.95rem;
}

.input-with-icon {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    z-index: 2;
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s;
    background: white;
}

.input-with-icon input, .input-with-icon select {
    padding-left: 40px;
}

textarea {
    resize: vertical;
    min-height: 100px;
    font-size: 0.95rem;
    line-height: 1.5;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.input-suffix {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-weight: 500;
    z-index: 2;
}

.select-wrapper {
    position: relative;
}

.select-wrapper select {
    padding-right: 40px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.select-wrapper select[multiple] {
    height: 250px;
    padding-right: 12px;
    font-size: 0.9rem;
}

.select-arrow {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    pointer-events: none;
    z-index: 2;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    border: 2px solid var(--danger-color);
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-block {
    width: 100%;
}

.buttons-group {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}
.buttons-group .btn {
    width: 100%;
}
.generate-description {
    margin: 15px 0;
}
.selection-block {
    margin-bottom: 15px;
}
.img-btns {
    margin-bottom: 15px;
}
@media (max-width: 768px) {
    .buttons-group {
        flex-direction: column;
        margin-top: 20px;
    }
}

/* Изображения */
.images-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.image-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: var(--light-color);
    border-radius: 10px;
    border: 2px solid var(--border-color);
    transition: all 0.3s;
}

.image-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.image-placeholder {
    width: 60px;
    height: 60px;
    background: white;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 24px;
    overflow: hidden;
}

.image-info {
    flex: 1;
}

.image-name {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--dark-color);
}

.image-status {
    font-size: 0.85rem;
    font-weight: 500;
}

.image-status.pending {
    color: var(--warning-color);
}

.image-status.success {
    color: var(--secondary-color);
}

.image-status.error {
    color: var(--danger-color);
}

.image-url-input {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.image-actions {
    display: flex;
    gap: 8px;
}

/* Ошибки */
.error-message {
    color: var(--danger-color);
    font-size: 0.9rem;
    margin-top: 5px;
}

input.error, select.error, textarea.error {
    border-color: var(--danger-color);
}

input.error:focus, select.error:focus, textarea.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Подсказки */
.info-tooltip {
    display: inline-block;
    width: 18px;
    height: 18px;
    background: #d1d5db;
    color: #4b5563;
    border-radius: 50%;
    text-align: center;
    line-height: 18px;
    font-size: 12px;
    cursor: help;
    margin-left: 5px;
}

.hint-text {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 5px;
    font-style: italic;
}

.warning-text {
    font-size: 0.85rem;
    color: var(--warning-color);
    margin-top: 5px;
    font-weight: 500;
}

/* Загрузка */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid var(--border-color);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Уведомления */
#notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.notification {
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    transform: translateX(0);
    transition: transform 0.3s ease;
}

.notification.hiding {
    transform: translateX(100%);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--secondary-color);
}

.notification.error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

.notification.warning {
    background: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--warning-color);
}

.notification.info {
    background: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--primary-color);
}

.notification i {
    font-size: 20px;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 3px;
}

.notification-message {
    font-size: 0.9rem;
    opacity: 0.9;
}

.notification-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-size: 18px;
    opacity: 0.7;
    transition: opacity 0.3s;
}

.notification-close:hover {
    opacity: 1;
}

/* Категории с вложенностью */
.category-option {
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.category-option:hover {
    background-color: var(--light-color);
}

.category-level-1 { padding-left: 12px; font-weight: 600; }
.category-level-2 { padding-left: 24px; }
.category-level-3 { padding-left: 36px; font-style: italic; }
.category-level-4 { padding-left: 48px; font-style: italic; }

/* Анимации */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-card {
    animation: fadeIn 0.3s ease;
}

/* Для мобильных устройств */
@media (max-width: 768px) {
    .card {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .card-title {
        font-size: 1.3rem;
    }
    
    .image-item {
        flex-direction: column;
        align-items: stretch;
    }
    
    .image-actions {
        justify-content: center;
        margin-top: 10px;
    }
    
    .notification {
        max-width: calc(100vw - 40px);
    }
}