/**
 * Стили для попапов консультации
 * Скопированы из category.css и адаптированы
 */

:root {
    --button-radius: 8px;
    --series-gap: 10px;
}

/* ===== ПОПАПЫ: КОНТЕЙНЕРЫ ===== */

/* Попап консультации для СПИСКОВ товаров */
.consultation-popup,
#consultation-popup-lists {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

/* Попап товара (консультация для страницы товара) */
.product-consultation-popup,
#consultation-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 10000;
}


/* ===== ПОПАПЫ: СОДЕРЖИМОЕ ===== */

.consultation-popup__content,
.product-consultation-popup__content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 2;
    transform: scale(0.1);
    opacity: 0;
    transition: transform 0.25s ease-out, opacity 0.25s ease-out;
}

.consultation-popup.popup-visible .consultation-popup__content,
.product-consultation-popup.popup-visible .product-consultation-popup__content {
    transform: scale(1);
    opacity: 1;
}

/* ===== ПОПАПЫ: ЗАГОЛОВОК ===== */

.consultation-popup__header,
.product-consultation-popup__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.consultation-popup__title,
.product-consultation-popup__title {
    margin: 0;
    font-size: 24px;
}

.consultation-popup__close,
.product-consultation-popup__close {
    font-size: 28px;
    cursor: pointer;
}

.consultation-popup__close:hover,
.product-consultation-popup__close:hover {
    opacity: 0.7;
}

/* ===== ФОРМЫ ===== */

.consultation-popup__form,
.product-consultation-popup__form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.series__form-row {
    display: flex;
    gap: 20px;
    width: 100%;
}

.series__form-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1 1 100%;
}

.series__half-width {
    width: calc(50% - 10px);
}

.series__form-group label {
    margin-bottom: 5px;
    line-height: 24px;
    font-weight: 400;
    font-size: 14px;
    color: #979797;
}

.series__form-group label::after {
    content: '';
    display: none;
}

.series__form-group.required label::after {
    content: '*';
    color: #D40510;
    margin-left: 2px;
    display: inline;
}

.series__form-group input,
.series__form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.series__form-group textarea {
    resize: vertical;
}

/* Фокус на полях */
.consultation-popup__form input:focus,
.consultation-popup__form textarea:focus,
.product-consultation-popup__form input:focus,
.product-consultation-popup__form textarea:focus {
    border-color: #D40510;
    outline: none;
}

/* ===== КНОПКИ ===== */

.series__form-submit {
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    font-size: 16px;
    border-radius: var(--button-radius);
    cursor: pointer;
    background-color: #D40510;
    color: white;
    border: none;
    font-weight: 500;
}

.series__form-submit:hover {
    background-color: #b8040e;
}

.consultation-popup__button-upload,
.series__button-upload {
    width: 100%;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
    font-size: 16px;
    border-radius: var(--button-radius);
    cursor: pointer;
    background-color: white;
    color: #D40510;
    border: 1px solid #D40510;
    font-weight: 500;
}

.consultation-popup__button-upload .series__icon,
.series__button-upload .series__icon {
    margin-right: 10px;
    font-size: 24px;
    font-weight: 500;
    color: #D40510;
}

.series__icon.material-symbols-outlined {
    font-variation-settings:
        'FILL' 0,
        'wght' 200,
        'GRAD' 0,
        'opsz' 20;
}

/* ===== ЗАГРУЗКА ФАЙЛОВ ===== */

.series__file-upload-container {
    margin-bottom: 20px;
    width: 100%;
}

.series__file-upload-flex-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--series-gap);
}

.series__file-upload-flex-wrapper > div {
    width: 50%;
}

.series__file-limit {
    font-size: 14px;
    color: #606060;
    margin-top: 5px;
    margin-bottom: 0px;
}

.series__file-limit-wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.series__file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.series__remove-file {
    background: none;
    border: none;
    color: #D40510;
    cursor: pointer;
    margin-left: 10px;
}

/* ===== ЧЕКБОКС ПОЛИТИКИ ===== */

.series__checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    width: 100%;
    margin-top: 10px;
}

.series__checkbox input {
    margin: 0;
    width: auto;
    accent-color: #D40510;
}

.series__checkbox-wrap {
    display: flex;
    align-items: center;
}

.policy-checkbox {
    display: flex;
    margin-right: 10px;
}

.policy-checkbox::after {
    content: '*';
    color: #D40510;
    margin-left: 3px;
    display: inline;
}

.policy-checkbox > input[type='checkbox']:hover {
    box-shadow: 0 0 0 1px #D40510;
}

.policy-checkbox > input[type='checkbox'] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #D40510;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
    position: relative;
    background-color: white;
}

.policy-checkbox > input[type='checkbox']:checked {
    background-color: #D40510;
}

.policy-checkbox > input[type='checkbox']:checked::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 4px;
    width: 5px;
    height: 11px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.serie__policy-text {
    flex: 1;
}

.series__policy-title {
    line-height: 2.0;
    font-weight: 400;
    font-size: 16px;
    color: #979797;
    display: inline;
    white-space: normal;
    word-wrap: break-word;
}

.series__policy-title-underlined {
    text-decoration: underline;
    cursor: pointer;
    display: inline;
    color: #979797;
}

.series__policy-title-underlined:hover {
    color: #b8040e;
    text-decoration: underline;
}

/* ===== ВАЛИДАЦИЯ (ОШИБКИ) ===== */

.series-error {
    border: 1px solid rgba(212, 5, 16, 1) !important;
    transition: border-color 0.2s ease;
}

/* ===== ALERTIFY УВЕДОМЛЕНИЯ ===== */

.alertify-notifier {
    z-index: 11000 !important;
}

.alertify-notifier .ajs-message {
    background-color: #4CAF50;
    color: white !important;
    border: none;
}

.alertify-notifier .ajs-message.ajs-error {
    background-color: #D40510;
    color: white !important;
}

.alertify-notifier .ajs-message.ajs-success {
    background-color: #4CAF50;
    color: white !important;
}

/* Принудительно белый текст */
.alertify-notifier .ajs-message,
.alertify-notifier .ajs-message * {
    color: white !important;
}

/* ===== АДАПТИВНОСТЬ ===== */

@media (min-width: 768px) {
    .consultation-popup__form .series__form-group.series__half-width,
    .product-consultation-popup__form .series__form-group.series__half-width {
        flex: 1 1 calc(50% - 10px);
    }
}

@media (max-width: 767px) {
    .series__form-row {
        flex-direction: column;
    }

    .series__half-width {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .series__file-upload-flex-wrapper {
        flex-direction: column;
    }

    .series__file-upload-flex-wrapper > div {
        width: 100%;
    }
}
