/**
 * Cartridge Form Styles
 * Профессиональная версия 2.5
 * Дизайн в стиле филком.рус
 * Добавлены цветные индикаторы для картриджей
 */

/* Импорт шрифтов */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&family=Roboto:wght@300;400;500;700&display=swap');

/* Сброс стилей */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Основной контейнер - без фона и отступов */
.cartridge-form-wrapper {
    width: 100%;
    background: transparent;
    font-family: 'Roboto', sans-serif;
}

.cartridge-form-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    background: transparent;
}

/* Сетка формы */
.cartridge-form-grid {
    display: flex;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.15);
    background: #ffffff;
    min-height: 550px;
    max-height: 700px;
}

/* Общие стили колонок */
.form-column {
    flex: 1;
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.form-column::-webkit-scrollbar {
    width: 5px;
}

.form-column::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.form-column::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

/* Левая колонка - светло-голубой фон как на филком.рус */
.left-column {
    background: #f0f7ff;
    flex: 1.2;
    border-right: 1px solid #d9e6f2;
}

/* Правая колонка */
.right-column {
    background: #ffffff;
    flex: 0.9;
}

/* Заголовки секций */
.section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 15px 0;
    letter-spacing: -0.02em;
}

/* Группы полей */
.form-group {
    margin-bottom: 12px;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 12px;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.required label::after {
    content: '*';
    color: #dc3545;
    margin-left: 4px;
}

/* Поля ввода */
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #1e293b;
    background-color: #ffffff;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
}

.form-control:hover {
    border-color: #94a3b8;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-control:disabled {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

/* Список картриджей - пустой по умолчанию */
.cartridges-list {
    flex: 1;
    background: #ffffff;
    border-radius: 12px;
    padding: 10px;
    border: 1px solid #d9e6f2;
    min-height: 180px;
    margin-top: 5px;
}

/* Сетка картриджей - 3 колонки */
.cartridges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: 100%;
}

/* Элемент картриджа - компактный с цветным индикатором */
.cartridge-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.cartridge-item:hover {
    border-color: #007bff;
    background: #f0f7ff;
    transform: translateY(-1px);
}

.cartridge-item.selected {
    border-color: #007bff;
    background: #e6f0ff;
    border-width: 2px;
}

.cartridge-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.cartridge-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.3;
    word-break: break-word;
    margin-bottom: 2px;
}

/* Контейнер для цвета с индикатором */
.color-indicator-container {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

/* Цветной индикатор */
.color-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.cartridge-item:hover .color-indicator {
    transform: scale(1.1);
    border-color: #007bff;
}

/* Название цвета */
.cartridge-color {
    font-family: 'Roboto', sans-serif;
    font-size: 10px;
    font-weight: 400;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* Специальные стили для разных цветов (будут добавляться динамически через JS) */
.color-indicator[data-color="черный"],
.color-indicator[data-color="black"] {
    background: #1e293b;
    border-color: #000;
}

.color-indicator[data-color="белый"],
.color-indicator[data-color="white"] {
    background: #ffffff;
    border-color: #cbd5e1;
}

.color-indicator[data-color="красный"],
.color-indicator[data-color="red"] {
    background: #dc2626;
}

.color-indicator[data-color="синий"],
.color-indicator[data-color="blue"] {
    background: #2563eb;
}

.color-indicator[data-color="зеленый"],
.color-indicator[data-color="green"] {
    background: #16a34a;
}

.color-indicator[data-color="желтый"],
.color-indicator[data-color="yellow"] {
    background: #eab308;
}

.color-indicator[data-color="оранжевый"],
.color-indicator[data-color="orange"] {
    background: #f97316;
}

.color-indicator[data-color="фиолетовый"],
.color-indicator[data-color="purple"] {
    background: #9333ea;
}

.color-indicator[data-color="розовый"],
.color-indicator[data-color="pink"] {
    background: #ec4899;
}

.color-indicator[data-color="коричневый"],
.color-indicator[data-color="brown"] {
    background: #92400e;
}

.color-indicator[data-color="серый"],
.color-indicator[data-color="gray"],
.color-indicator[data-color="grey"] {
    background: #6b7280;
}

.color-indicator[data-color="голубой"],
.color-indicator[data-color="cyan"] {
    background: #06b6d4;
}

.color-indicator[data-color="лайм"],
.color-indicator[data-color="lime"] {
    background: #84cc16;
}

/* Баннер с выгодой */
.banner-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 15px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #007bff;
    margin-bottom: 15px;
}

.banner-text {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #007bff;
    margin-bottom: 15px;
    line-height: 1.4;
    max-width: 90%;
}

.banner-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Правая колонка - информация о принтере */
.printer-info {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-left: 3px solid #007bff;
    border-top: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
}

.printer-info p {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    color: #334155;
    font-weight: 400;
}

.printer-info strong {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: #007bff;
    font-size: 14px;
}

/* Текст "для принтера" */
.printer-info .printer-label {
    font-size: 12px;
    color: #64748b;
    margin-right: 4px;
}

/* Выбранный картридж */
.selected-cartridge h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 8px 0 4px 0;
    line-height: 1.2;
    word-break: break-word;
}

/* Цена */
.price-tag {
    margin: 4px 0 10px;
}

.price-value {
    font-family: 'Montserrat', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #28a745;
    line-height: 1.1;
    display: inline-block;
    padding: 4px 12px;
    background: #f0fff4;
    border-radius: 30px;
    border: 1px solid #28a745;
}

/* Детали картриджа */
.cartridge-details {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px 15px;
    margin: 10px 0;
    border: 1px solid #e2e8f0;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #e2e8f0;
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-item span {
    font-family: 'Roboto', sans-serif;
    color: #64748b;
    font-size: 13px;
    font-weight: 400;
}

.detail-item strong {
    font-family: 'Montserrat', sans-serif;
    color: #1e293b;
    font-size: 13px;
    font-weight: 600;
}

/* Форма заявки */
.order-form {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #e2e8f0;
    margin-top: 5px;
}

.order-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px 0;
}

/* Ряд с полями */
.form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.form-row .form-group label {
    font-size: 10px;
    margin-bottom: 3px;
}

/* Кнопка отправки */
.btn-submit-order {
    width: 100%;
    padding: 12px 16px;
    background: #007bff;
    color: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 10px -4px rgba(0, 123, 255, 0.4);
    
    /* Вертикальное выравнивание */
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-align: center;
    vertical-align: middle;
    height: auto;
    min-height: 48px;
}

.btn-submit-order:hover:not(:disabled) {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn-submit-order:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #94a3b8;
}

.btn-text {
    display: inline-block;
    line-height: 1;
    vertical-align: middle;
    margin: 0;
    padding: 0;
}

.btn-loader {
    display: none;
    font-size: 16px;
    line-height: 1;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Сообщения */
.order-success,
.order-error {
    display: none;
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    text-align: center;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-weight: 500;
    animation: slideUp 0.3s ease;
}

.order-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #28a745;
}

.order-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #dc3545;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Placeholder */
.cartridges-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    text-align: center;
    color: #64748b;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    font-style: italic;
    background: #f8fafc;
    border-radius: 8px;
}

.cartridges-placeholder.error {
    color: #dc3545;
    background: #fff5f5;
}

/* ============================================ */
/* ПОЛНАЯ АДАПТИВНОСТЬ */
/* ============================================ */

/* Десктопы (1200px - 1400px) */
@media (max-width: 1400px) {
    .cartridge-form-container {
        max-width: 1200px;
    }
    
    .form-column {
        padding: 18px 15px;
    }
    
    .section-title {
        font-size: 15px;
        margin-bottom: 12px;
    }
    
    .price-value {
        font-size: 24px;
    }
    
    .banner-text {
        font-size: 15px;
    }
}

/* Планшеты (768px - 1199px) */
@media (max-width: 1199px) {
    .cartridge-form-grid {
        flex-direction: column;
        min-height: auto;
        max-height: none;
    }
    
    .left-column {
        border-right: none;
        border-bottom: 1px solid #d9e6f2;
    }
    
    .form-column {
        overflow-y: visible;
    }
    
    .cartridges-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .form-row {
        flex-direction: row;
    }
    
    .banner-text {
        font-size: 15px;
    }
}

/* Мобильные устройства (576px - 767px) */
@media (max-width: 767px) {
    .form-column {
        padding: 15px 12px;
    }
    
    .cartridges-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 8px;
    }
    
    .price-value {
        font-size: 22px;
        padding: 3px 10px;
    }
    
    .selected-cartridge h2 {
        font-size: 18px;
    }
    
    .banner-text {
        font-size: 14px;
    }
    
    .btn-submit-order {
        min-height: 44px;
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .color-indicator {
        width: 14px;
        height: 14px;
    }
}

/* Малые мобильные (до 575px) */
@media (max-width: 575px) {
    .form-column {
        padding: 12px 10px;
    }
    
    .section-title {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .form-group label {
        font-size: 11px;
    }
    
    .form-control {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .cartridges-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .cartridge-item {
        padding: 5px 6px;
    }
    
    .cartridge-name {
        font-size: 11px;
    }
    
    .cartridge-color {
        font-size: 9px;
    }
    
    .printer-info {
        padding: 10px 12px;
    }
    
    .printer-info p {
        font-size: 12px;
    }
    
    .printer-info strong {
        font-size: 13px;
    }
    
    .order-form {
        padding: 12px;
    }
    
    .banner-text {
        font-size: 13px;
    }
    
    .btn-submit-order {
        min-height: 42px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .color-indicator {
        width: 12px;
        height: 12px;
    }
}

/* Очень маленькие устройства */
@media (max-width: 360px) {
    .cartridges-grid {
        grid-template-columns: 1fr;
    }
    
    .banner-text {
        font-size: 12px;
    }
}

/* Альбомная ориентация */
@media (max-height: 600px) and (orientation: landscape) {
    .cartridge-form-grid {
        min-height: auto;
    }
    
    .cartridges-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .btn-submit-order {
        min-height: 40px;
    }
}

/* Высокие разрешения */
@media (min-width: 1800px) {
    .cartridge-form-container {
        max-width: 1600px;
    }
    
    .form-column {
        padding: 25px 20px;
    }
    
    .section-title {
        font-size: 18px;
        margin-bottom: 18px;
    }
    
    .price-value {
        font-size: 30px;
    }
    
    .selected-cartridge h2 {
        font-size: 24px;
    }
    
    .banner-text {
        font-size: 18px;
    }
    
    .btn-submit-order {
        min-height: 52px;
        font-size: 16px;
    }
    
    .color-indicator {
        width: 18px;
        height: 18px;
    }
    
    .cartridge-name {
        font-size: 13px;
    }
    
    .cartridge-color {
        font-size: 11px;
    }
}

/* Печать */
@media print {
    .btn-submit-order,
    .order-form {
        display: none;
    }
}