/* Основные стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* Убираем подсветку тапов в Safari */
}

/* Улучшения для мобильных устройств */
html {
    -webkit-text-size-adjust: 100%; /* Предотвращаем автоматическое масштабирование текста в iOS */
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Плавная прокрутка */
html {
    scroll-behavior: smooth;
}

/* Улучшения для сенсорной прокрутки */
body, .section, .photo-gallery {
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(160deg, #334155 0%, #1e293b 50%, #0f172a 100%);
    min-height: 100vh;
    color: #333;
    position: relative; /* Для позиционирования водяного знака */
}

/* Водяной знак */
.watermark {
    position: fixed;
    bottom: 15px;
    right: 15px;
    color: rgba(255, 255, 255, 0.25);
    font-size: 12px;
    font-weight: 700;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    z-index: 9999;
    pointer-events: none;
    user-select: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transform: rotate(-3deg);
    letter-spacing: 0.5px;
    background: rgba(0, 0, 0, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease;
}

.watermark:hover {
    opacity: 0.8;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Универсальная шапка */
.header-section {
    background: white;
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

/* Компактная шапка для товара */
.header-section.compact {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.compact-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 8px 15px;
    background: #f8fafc;
}

.header-section.compact .header-container {
    display: none;
}

.header-section.compact .operators-stats {
    display: none;
}

.header-section.compact .compact-header {
    display: flex;
}

.compact-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.compact-back-btn {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.compact-back-btn:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
}

.compact-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

.header-expand-btn {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.header-expand-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.header-expand-btn.expanded::before {
    content: "▲";
}

.header-expand-btn:not(.expanded)::before {
    content: "▼";
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Мобильные кнопки скрыты по умолчанию на всех экранах */
.mobile-header-buttons {
    display: none;
}

/* Обычные кнопки показаны по умолчанию на всех экранах */
.header-buttons-row {
    display: flex;
}

/* Правый блок заголовка показан по умолчанию */
.header-right {
    display: flex;
}

.header-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.header-title {
    color: #2d3748;
    font-size: 1.5em;
    margin: 0;
    font-weight: 600;
}

.header-left .back-btn {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    align-self: flex-start;
    max-width: 150px;
}

.header-left .back-btn:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.header-center {
    flex: 2;
    display: flex;
    justify-content: center;
    margin-right: 10px;
}

.statistics-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    padding: 12px 20px;
    font-size: 14px;
    color: #718096;
}

.statistics-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.statistics-priority {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 11px;
    color: #a0aec0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
    white-space: nowrap;
}

.stat-separator {
    color: #cbd5e0;
    font-size: 16px;
    font-weight: 300;
}

.stat-value {
    color: #2d3748;
    font-size: 16px;
    font-weight: 700;
}

.stat-item-small {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
    white-space: nowrap;
}

.stat-separator-small {
    color: #cbd5e0;
    font-size: 12px;
    font-weight: 300;
}

.stat-value-small {
    color: #4a5568;
    font-size: 12px;
    font-weight: 600;
}

.header-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    margin-left: 20px;
}

.header-buttons-row {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.update-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.update-btn:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.recalculate-btn {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.recalculate-btn:hover {
    background: linear-gradient(135deg, #dd6b20 0%, #c05621 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(237, 137, 54, 0.3);
}

/* Статистика операторов */
.operators-stats {
    background: #f7fafc;
    border-top: 1px solid #e2e8f0;
    padding: 10px 20px;
}

.operators-list {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    max-width: 1400px;
    margin: 0 auto;
}

.operator-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: white;
    border-radius: 6px;
    border: 2px solid #e2e8f0;
    font-size: 13px;
    white-space: nowrap;
    transition: all 0.2s;
}

.operator-stat.current {
    border-color: #667eea;
    background: #ebf8ff;
    color: #2b6cb0;
    font-weight: 600;
}

.operator-name {
    font-weight: 500;
}

.operator-comments {
    color: #38a169;
    font-weight: 600;
}

.operator-today {
    color: #d69e2e;
    font-weight: 600;
}

/* Контент с отступом от шапки */
.section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    margin-top: 20px;
}

.content-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f7fafc;
}

.content-header h2 {
    color: #4a5568;
    font-size: 2em;
    margin-bottom: 5px;
}

.operator-info {
    color: #718096;
    font-size: 14px;
    margin: 0;
}

.hidden {
    display: none !important;
}

/* Логин */
.login-form {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
    padding: 40px 20px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 450px;
}

.login-form h1 {
    color: #4a5568;
    margin-bottom: 30px;
    font-size: 2.5em;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-form input {
    width: 100%;
    padding: 18px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    margin-bottom: 25px;
    transition: all 0.3s ease;
    background: #f8fafc;
    color: #2d3748;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.login-form input::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

.login-form button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-form button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.login-form button:active {
    transform: translateY(-1px);
}

/* Контейнер для логина */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #334155 0%, #1e293b 50%, #0f172a 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

/* Заголовки */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f7fafc;
}

.header h2 {
    color: #4a5568;
    font-size: 2em;
    margin-bottom: 5px;
}

.back-btn, .logout-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.back-btn:hover, .logout-btn:hover {
    background: #c53030;
}

/* Сетка товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    max-width: 100%;
}

.product-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 480px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e0;
}

.product-card h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.1em;
    line-height: 1.3;
    font-weight: 600;
    height: 2.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-image {
    width: 100%;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    background: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    max-width: 100%;
    max-height: 100%;
}

.no-image {
    color: #a0aec0;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-style: italic;
}

.product-description {
    color: #718096;
    font-size: 14px;
    line-height: 1.4;
    margin: 0 0 15px 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.6em;
}

.product-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 10px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-size: 11px;
    margin-top: 20px;
    margin-bottom: 15px;
    flex-wrap: nowrap;
}

.product-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    color: #718096;
    font-weight: 500;
}

.product-stats .stat-separator {
    color: #cbd5e0;
    font-size: 12px;
    font-weight: 300;
}

.select-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    width: 100%;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 0;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.select-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.select-btn:active {
    transform: translateY(0);
}

/* Детали товара */
.product-details {
    display: grid;
    gap: 30px;
}

.product-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.product-photos {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.main-photo {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.main-photo:hover {
    transform: scale(1.02);
}

.main-photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: pointer;
}

.photo-gallery {
    position: relative;
    display: flex;
    gap: 10px;
    overflow: hidden;
    max-width: 100%;
}

.photo-gallery-container {
    display: flex;
    gap: 10px;
    transition: transform 0.3s ease;
}

.photo-gallery img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.photo-gallery img:hover {
    transform: scale(1.1);
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
    z-index: 10;
}

.gallery-nav:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.gallery-nav.prev {
    left: 5px;
}

.gallery-nav.next {
    right: 5px;
}

.gallery-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.gallery-nav:disabled:hover {
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
}

.product-text {
    overflow: visible;
    white-space: normal;
    word-wrap: break-word;
    word-break: normal;
    min-height: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-text h3 {
    color: #2d3748;
    font-size: 1.5em;
    margin-bottom: 15px;
}

.product-text p {
    color: #718096;
    line-height: 1.5;
    margin-bottom: 15px;
    font-size: 14px;
    overflow: visible;
    white-space: normal;
    word-wrap: break-word;
    word-break: normal;
}

.product-text h4 {
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.product-text h4 + p {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 15px;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    display: block;
    word-wrap: break-word;
    word-break: normal;
}

/* Модальное окно для фото */
.photo-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.photo-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.photo-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
}

.photo-modal-close:hover {
    color: #ddd;
}

.photo-modal img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

/* Комментарии */
.comments-section {
    background: #f7fafc;
    padding: 20px;
    border-radius: 12px;
}

.comments-section h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.comment-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 13px;
}

.rating {
    color: #f6ad55;
    font-size: 14px;
}

.date {
    color: #a0aec0;
}

.comment-text {
    color: #4a5568;
    line-height: 1.4;
    margin-bottom: 10px;
    font-size: 14px;
}

.admin-answer {
    background: #ebf8ff;
    padding: 10px;
    border-radius: 6px;
    color: #2b6cb0;
    font-style: italic;
    font-size: 13px;
}

.admin-answer-empty {
    background: #f7fafc;
    border: 1px dashed #cbd5e0;
}

/* Кнопка «Править» комментария */
.edit-comment-btn {
    background: transparent;
    border: none;
    color: #718096;
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    margin-left: 6px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.edit-comment-btn:hover {
    color: #4a5568;
    background: #e2e8f0;
}

/* Форма редактирования комментария */
.comment-edit-form {
    padding: 12px 0;
    margin: 0;
}

.comment-edit-header {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.comment-edit-header .edit-author {
    flex: 1;
    min-width: 120px;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

.comment-edit-header .edit-date {
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
}

.edit-rating {
    display: inline-flex;
    gap: 2px;
    cursor: pointer;
}

.edit-rating-star {
    color: #f6ad55;
    font-size: 16px;
}

.edit-comment-text,
.edit-answer-text {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 10px;
    box-sizing: border-box;
}

.comment-edit-actions {
    display: flex;
    gap: 10px;
}

.edit-save-btn,
.edit-cancel-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: background 0.2s;
}

.edit-save-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.edit-save-btn:hover {
    filter: brightness(1.05);
}

.edit-cancel-btn {
    background: #e2e8f0;
    color: #4a5568;
}

.edit-cancel-btn:hover {
    background: #cbd5e0;
}

/* AI секция */
.ai-section {
    background: #f7fafc;
    padding: 20px;
    border-radius: 12px;
}

.generate-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 20px;
    transition: transform 0.2s;
}

.generate-btn:hover {
    transform: translateY(-2px);
}

.ai-comments {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.comment-type {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    min-height: 200px;
}

.comment-type h4 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 0.95em;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.options-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    transition: all 0.2s;
}

.option-item:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.option-item input[type="radio"] {
    margin-top: 3px;
    margin-right: 10px;
}

.option-item label {
    color: #4a5568;
    line-height: 1.4;
    cursor: default;
    flex: 1;
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 12px;
}

.button-group {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.edit-btn {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: transform 0.2s;
    white-space: nowrap;
    min-width: 100px;
}

.edit-btn:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
}

/* Форма создания комментария */
.create-comment-section {
    background: #f7fafc;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
}

.create-comment-section h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.3em;
    font-weight: 600;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group.half {
    flex: 1;
    margin-bottom: 0;
}

.form-group label {
    display: block;
    color: #4a5568;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
}

.input-with-button {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-with-button input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.input-with-button input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.generate-btn-small {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    min-width: 40px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.generate-btn-small:hover {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.generate-answer-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 8px;
    width: 100%;
}

.generate-answer-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
    font-family: inherit;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #a0aec0;
    font-style: italic;
}

.submit-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Загрузка */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

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

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

.loading p {
    color: white;
    font-size: 18px;
}

/* Адаптивность */
@media (max-width: 1400px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .product-card {
        min-height: 460px;
        padding: 18px;
    }
    
    .product-image {
        height: 180px;
    }
    
    .statistics-main {
        gap: 10px;
    }
    
    .stat-item {
        font-size: 13px;
    }
    
    .stat-value {
        font-size: 15px;
    }
}

@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .product-card {
        min-height: 460px;
        padding: 18px;
    }
    
    .product-image {
        height: 180px;
    }
    
    .statistics-main {
        gap: 8px;
    }
    
    .stat-item {
        font-size: 12px;
    }
    
    .stat-value {
        font-size: 14px;
    }
    
    .stat-separator {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    /* Мобильная адаптация шапки */
    .header-container {
        flex-direction: column;
        gap: 15px;
        padding: 12px 15px;
        align-items: center;
        max-width: 100%;
        position: relative;
    }
    
    /* Позиционирование мобильных кнопок */
    .mobile-header-buttons {
        position: absolute;
        top: 8px;
        right: 8px;
        gap: 8px;
        z-index: 10;
    }
    
    @media (max-width: 768px) {
        .mobile-header-buttons {
            display: flex;
        }
        
        /* Скрываем обычные кнопки на мобильных */
        .header-buttons-row {
            display: none;
        }
    }
    
    /* Стили для мобильных кнопок без фона */
    .mobile-btn {
        background: none;
        border: none;
        padding: 8px;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #4a5568;
        font-size: 18px;
        transition: all 0.2s ease;
        position: relative;
    }
    
    .mobile-btn:hover {
        background: rgba(74, 85, 104, 0.1);
        transform: scale(1.1);
    }
    
    .mobile-btn:active {
        background: rgba(74, 85, 104, 0.2);
        transform: scale(0.95);
    }
    
    .header-left {
        order: 1;
        align-items: center;
        text-align: center;
        width: 100%;
        justify-content: center;
        padding-top: 50px; /* Отступ сверху для мобильных кнопок */
    }
    
    .header-title {
        font-size: 1.3em;
    }
    
    .header-center {
        order: 2;
        flex: none;
        margin-right: 0;
        width: 100%;
        display: flex;
        justify-content: center;
        padding: 0;
    }
    
    .statistics-block {
        padding: 8px 12px;
        font-size: 12px;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        box-sizing: border-box;
    }
    
    .statistics-main {
        gap: 4px;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    
    .statistics-priority {
        gap: 8px;
        font-size: 9px;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    
    .header-right {
        order: 3;
        margin-left: 0;
        width: 100%;
        display: none; /* Полностью скрываем на мобильных */
    }
    

    
    /* Статистика операторов */
    .operators-stats {
        padding: 8px 15px;
    }
    
    .operators-list {
        gap: 8px;
        justify-content: center;
    }
    
    .operator-stat {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .section {
        padding: 20px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .product-card {
        min-height: auto;
        padding: 15px;
    }
    
    .product-image {
        height: 160px;
        margin-bottom: 12px;
    }
    
    .product-card h3 {
        font-size: 1em;
        margin-bottom: 12px;
        height: auto;
        -webkit-line-clamp: 3;
    }
    
    .product-description {
        font-size: 13px;
        -webkit-line-clamp: 2;
        min-height: 2.8em;
        margin-bottom: 8px;
    }
    
    .product-stats {
        padding: 4px 8px;
        gap: 4px;
        font-size: 9px;
        margin-top: 15px;
    }
    
    .product-stats .stat-label {
        font-size: 8px;
    }
    
    .product-stats .stat-value {
        font-size: 10px;
    }
    
    .product-stats .stat-separator {
        font-size: 8px;
        margin: 0 1px;
    }
    
    .select-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .statistics-main {
        gap: 6px;
        flex-wrap: wrap;
    }
    
    .stat-item {
        font-size: 11px;
    }
    
    .stat-value {
        font-size: 13px;
    }
    
    .stat-separator {
        font-size: 12px;
    }
    
    .header h2 {
        font-size: 1.5em;
    }
    
    .header-right {
        gap: 10px;
        margin-left: 15px;
    }
    
    /* Детали товара на мобильных */
    .product-info {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .main-photo {
        height: 250px;
    }
    
    .photo-gallery {
        max-width: 100%;
        overflow-x: auto;
    }
    
    .product-text h3 {
        font-size: 1.2em;
    }
    
    /* AI комментарии */
    .ai-comments {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .comment-type {
        padding: 12px;
        min-height: auto;
    }
    
    .comment-type h4 {
        font-size: 0.95em;
        margin-bottom: 10px;
    }
    
    .option-item {
        padding: 8px;
        margin-bottom: 8px;
    }
    
    .option-item label {
        font-size: 12px;
        line-height: 1.3;
        margin-bottom: 6px;
    }
    
    .edit-btn {
        padding: 4px 8px;
        font-size: 10px;
        min-width: 60px;
        border-radius: 4px;
    }
    
    /* Основные кнопки в товаре */
    .generate-btn {
        padding: 8px 16px;
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    .generate-answer-btn {
        padding: 6px 12px;
        font-size: 11px;
        margin-top: 6px;
    }
    
    /* Настройки промптов */
    .prompts-tabs {
        flex-wrap: wrap;
        gap: 2px;
    }
    
    .tab-btn {
        padding: 8px 12px;
        font-size: 12px;
        flex: 1;
        min-width: 0;
    }
    
    .prompt-item textarea {
        min-height: 100px;
        font-size: 14px;
    }
    
    .settings-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .save-btn,
    .reset-btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 14px;
    }
    
    /* Комментарии */
    .comments-section {
        padding: 15px;
        margin-top: 15px;
    }
    
    .comments-section h3 {
        font-size: 1.1em;
        margin-bottom: 15px;
    }
    
    .comment-item {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        margin-bottom: 8px;
    }
    
    .comment-text,
    .admin-answer {
        font-size: 12px;
        line-height: 1.4;
    }
    
    .admin-answer {
        padding: 8px;
        font-size: 11px;
    }
    
    /* AI секция */
    .ai-section {
        padding: 15px;
        margin-top: 15px;
    }
    
    /* Автоматическое растягивание полей ввода на мобильных */
    .form-group textarea[name="comment_text"],
    .form-group textarea[name="answer_text"] {
        min-height: 120px; /* Минимальная высота */
        height: auto; /* Автоматическая высота */
        resize: none; /* Отключаем ручное изменение размера */
        overflow-y: hidden; /* Скрываем прокрутку */
        padding: 12px;
        line-height: 1.5;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 5px;
    }
    
    /* Мобильные кнопки для маленьких экранов */
    .mobile-header-buttons {
        top: 6px;
        right: 6px;
        gap: 6px;
    }
    
    .mobile-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
        padding: 6px;
    }
    
    /* Дополнительная оптимизация шапки */
    .header-container {
        padding: 10px 12px;
        gap: 12px;
    }
    
    .header-left {
        padding-top: 46px; /* Меньший отступ для маленьких экранов */
    }
    
    .header-title {
        font-size: 1.1em;
    }
    
    .statistics-block {
        padding: 6px 10px;
        font-size: 10px;
    }
    
    .statistics-main {
        gap: 2px;
    }
    
    .stat-item {
        font-size: 9px;
    }
    
    .stat-value {
        font-size: 11px;
    }
    
    .stat-separator {
        font-size: 10px;
        margin: 0 2px;
    }
    
    .statistics-priority {
        gap: 6px;
        font-size: 8px;
    }
    
    .stat-value-small {
        font-size: 9px;
    }
    

    
    .operators-list {
        gap: 6px;
        flex-wrap: wrap;
    }
    
    .operator-stat {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .section {
        padding: 12px;
        border-radius: 8px;
        margin-bottom: 15px;
        margin-top: 15px;
    }
    
    .content-header h2 {
        font-size: 1.3em;
    }
    
    .product-card {
        padding: 12px;
    }
    
    .product-image {
        height: 140px;
    }
    
    .product-card h3 {
        font-size: 1em;
        margin-bottom: 10px;
    }
    
    .product-description {
        font-size: 12px;
        margin-bottom: 12px;
    }
    
    .product-stats {
        font-size: 8px;
        padding: 3px 6px;
        gap: 4px;
        margin-top: 10px;
    }
    
    .select-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    /* Детали товара */
    .main-photo {
        height: 200px;
    }
    
    .product-text h3 {
        font-size: 1.1em;
    }
    
    /* AI комментарии */
    .generate-btn {
        padding: 8px 14px;
        font-size: 12px;
        margin-bottom: 12px;
    }
    
    .comment-type {
        padding: 10px;
    }
    
    .comment-type h4 {
        font-size: 0.85em;
        margin-bottom: 8px;
    }
    
    .option-item {
        padding: 6px;
        margin-bottom: 6px;
    }
    
    .option-item label {
        font-size: 11px;
        margin-bottom: 4px;
    }
    
    .edit-btn {
        padding: 3px 6px;
        font-size: 9px;
        min-width: 50px;
        border-radius: 3px;
    }
    
    .generate-answer-btn {
        padding: 4px 8px;
        font-size: 10px;
        margin-top: 4px;
    }
    
    /* Настройки промптов */
    .tab-btn {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .prompt-item {
        padding: 10px;
    }
    
    .prompt-item textarea {
        min-height: 80px;
        font-size: 13px;
        padding: 10px;
    }
    
    .add-prompt-btn {
        padding: 10px 16px;
        font-size: 12px;
    }
    
    /* Модальное окно фото */
    .photo-modal-close {
        top: -30px;
        font-size: 28px;
    }
    
    /* Логин */
    .login-form {
        padding: 30px 15px;
        margin: 10px;
    }
    
    .login-form h1 {
        font-size: 2em;
        margin-bottom: 25px;
    }
    
    .login-form input {
        padding: 15px 18px;
        font-size: 15px;
        margin-bottom: 20px;
    }
    
    .login-form button {
        padding: 15px 30px;
        font-size: 16px;
    }
}

/* Утилиты */
.no-products {
    text-align: center;
    color: #a0aec0;
    font-size: 18px;
    padding: 40px;
} 

/* Увеличиваем ширину контейнера для деталей товара */
@media (min-width: 1200px) {
    .product-details .container {
        max-width: 1600px;
    }
    
    .product-info {
        grid-template-columns: 1fr 1fr;
        gap: 50px;
    }
} 

#productDetails {
    overflow: visible;
    white-space: normal;
    word-wrap: break-word;
    word-break: normal;
}

#productDetails h4 {
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 1.1em;
}

#productDetails p {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 15px;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    display: block;
    word-wrap: break-word;
    word-break: normal;
} 

/* Кнопки в заголовке */
.header-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.settings-btn {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.settings-btn:hover {
    background: linear-gradient(135deg, #3182ce 0%, #2c5aa0 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
}

.logout-btn {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.logout-btn:hover {
    background: linear-gradient(135deg, #c53030 0%, #a02323 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.3);
}

/* Настройки промптов */
.settings-content {
    max-width: 1000px;
    margin: 0 auto;
}

.prompts-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
}

.tab-btn {
    background: #f7fafc;
    color: #4a5568;
    border: none;
    padding: 12px 24px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    background: #edf2f7;
}

.tab-btn.active {
    background: white;
    color: #2d3748;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
    padding: 20px 0;
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.prompts-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.prompt-item {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    position: relative;
}

.prompt-item textarea {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    resize: vertical;
    line-height: 1.4;
}

.prompt-item textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.prompt-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.prompt-btn {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.prompt-btn:hover {
    background: #c53030;
}

.add-prompt-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: transform 0.2s;
    margin-bottom: 30px;
}

.add-prompt-btn:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

.settings-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
    flex-wrap: wrap;
}

.save-btn {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: transform 0.2s;
}

.save-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
}

.reset-btn {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: transform 0.2s;
}

.reset-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #dd6b20 0%, #c05621 100%);
} 

/* Дополнительные медиа-запросы для очень маленьких экранов */
@media (max-width: 320px) {
    /* Мобильные кнопки для очень маленьких экранов */
    .mobile-header-buttons {
        top: 4px;
        right: 4px;
        gap: 4px;
    }
    
    .mobile-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
        padding: 4px;
    }
    
    .header-left {
        padding-top: 42px; /* Еще меньший отступ для очень маленьких экранов */
    }
    
    .statistics-main {
        flex-direction: column;
        gap: 4px;
    }
    
    .statistics-priority {
        flex-direction: column;
        gap: 2px;
    }
    
    .header-right {
        padding: 0 15px;
    }
    

    
    .operators-list {
        flex-direction: column;
        align-items: center;
    }
    
    .operator-stat {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
    
    .prompts-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
    }
}

/* Улучшения для тач-интерфейса */
@media (hover: none) and (pointer: coarse) {
    /* Увеличиваем размеры кнопок для лучшего тача */
    .select-btn,
    .edit-btn,
    .generate-btn,
    .submit-btn,
    .update-btn,
    .recalculate-btn,
    .settings-btn,
    .logout-btn {
        min-height: 44px; /* Рекомендация Apple для тач-целей */
        touch-action: manipulation;
    }
    
    .generate-btn-small {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Убираем эффекты hover для тач-устройств */
    .product-card:hover,
    .main-photo:hover,
    .photo-gallery img:hover,
    .update-btn:hover,
    .settings-btn:hover,
    .logout-btn:hover,
    .mobile-btn:hover {
        transform: none;
        background: inherit;
        box-shadow: inherit;
    }
    
    /* Увеличиваем отступы для лучшего тача */
    .option-item {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Улучшаем навигацию по галерее */
    .gallery-nav {
        min-width: 44px;
        min-height: 44px;
        font-size: 16px;
    }
}

/* Адаптивность для формы */
@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-group.half {
        margin-bottom: 15px;
    }
    
    .create-comment-section {
        padding: 15px;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 10px;
        font-size: 15px; /* Предотвращает зум на iOS */
        min-height: 40px; /* Для лучшего тача */
    }
    
    .generate-btn-small {
        padding: 10px;
        min-width: 40px;
        min-height: 40px;
        font-size: 12px;
    }
    
    .submit-btn {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }
    
    /* Улучшения для формы на мобильных */
    .input-with-button {
        gap: 8px;
    }
    
    .generate-answer-btn {
        min-height: 40px;
        font-size: 12px;
        padding: 8px 12px;
    }
    
    .create-comment-section {
        padding: 12px;
    }
    
    .create-comment-section h3 {
        font-size: 1.1em;
        margin-bottom: 15px;
    }
    
    /* Дополнительная настройка полей для маленьких экранов */
    .form-group textarea[name="comment_text"],
    .form-group textarea[name="answer_text"] {
        min-height: 100px; /* Чуть меньше на маленьких экранах */
        font-size: 13px;
        padding: 10px;
    }
}

/* Адаптация для планшетов в портретной ориентации */
@media (max-width: 1024px) and (orientation: portrait) {
    .header-container {
        flex-wrap: wrap;
    }
    
    .header-center {
        order: 3;
        width: 100%;
        margin-top: 10px;
    }
    
    .ai-comments {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* Адаптация для альбомной ориентации на мобильных */
@media (max-height: 500px) and (orientation: landscape) {
    .header-container {
        padding: 8px 15px;
        gap: 8px;
    }
    
    .statistics-block {
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .section {
        margin-top: 10px;
        margin-bottom: 10px;
    }
    
    .login-form {
        padding: 20px 15px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .login-form h1 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }
}

/* Исправления для очень длинных слов и чисел */
.stat-item, .stat-value, .operator-stat, .product-description, 
.comment-text, .admin-answer, .product-text p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Скрытие элементов на мобильных для экономии места */
@media (max-width: 480px) {
    .watermark {
        font-size: 10px;
        padding: 2px 6px;
        bottom: 10px;
        right: 10px;
    }
    
    /* Компактный вид статистики приоритетов на очень маленьких экранах */
    .statistics-priority .stat-separator-small {
        display: none;
    }
    
    .statistics-priority .stat-item-small {
        margin: 0 2px;
    }
    
    /* Более компактное отображение информации о товаре */
    .product-stats .stat-separator {
        display: none;
    }
    
    .product-stats .stat-item {
        margin: 0 1px;
    }
} 