/**
 * Стили для мобильной формы заявки на перевозку
 *
 * @package TaycanEvgeniiMudrenko
 */

/* Скрываем мобильную форму на десктопах */
@media (min-width: 769px) {
    .mobile-transport-form-button-container,
    .mobile-transport-form-container,
    .mobile-overlay {
        display: none !important;
    }
}

/* Показываем мобильную форму только на мобильных устройствах */
@media (max-width: 768px) {

    /* Затемнение фона */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.7);
        z-index: 100001; /* Увеличиваем z-index, чтобы быть поверх хедера */
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    /* Контейнер формы */
    .mobile-transport-form-container {
        display: none;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #fff;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.2);
        z-index: 100002; /* Увеличиваем z-index, чтобы быть поверх хедера */
        transform: translateY(100%);
        transition: transform 0.4s ease-out;
        max-height: 90vh; /* Увеличиваем максимальную высоту */
        overflow-y: auto; /* Добавляем вертикальную прокрутку */
        -webkit-overflow-scrolling: touch; /* Плавный скролл на iOS */
    }

    /* Шапка формы */
    .mobile-transport-form-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 30px 20px 20px 20px; /* Увеличиваем отступы сверху и снизу */
        border-bottom: 1px solid #eee;
        position: sticky;
        top: 0;
        background-color: #fff;
        z-index: 10; /* Увеличиваем z-index для правильной иерархии */
        border-radius: 20px 20px 0 0; /* Добавляем скругление углов */
    }

    .mobile-transport-form-header h2 {
        margin: 0;
        font-size: 22px; /* Увеличиваем размер */
        font-weight: 700;
        color: #333;
    }

    .mobile-close-form {
        font-size: 32px; /* Увеличиваем размер */
        color: #777;
        cursor: pointer;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-top: -5px; /* Опускаем крестик чуть ниже */
    }

    /* Содержимое формы */
    .mobile-form-content {
        padding: 20px;
    }

    .mobile-required-note {
        font-size: 12px;
        color: #e74c3c;
        margin-bottom: 20px;
        text-align: center;
    }

    /* Группы полей */
    .mobile-form-group {
        margin-bottom: 20px;
    }

    .mobile-form-group label {
        display: block;
        margin-bottom: 8px;
        font-weight: 500;
        color: #333;
    }

    .mobile-form-control {
        width: 100%;
        padding: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        font-size: 16px;
        background-color: #f9f9f9;
        box-sizing: border-box;
    }

    .mobile-form-control:focus {
        border-color: #0071CE;
        outline: none;
        box-shadow: 0 0 0 2px rgba(0, 113, 206, 0.2);
    }

    /* Селект */
    select.mobile-form-control {
        appearance: none;
        background-image: url('data:image/svg+xml;utf8,<svg fill="%23888" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
        background-repeat: no-repeat;
        background-position: right 10px center;
    }

    /* Тип перевозки */
    .mobile-transport-type-toggle {
        display: flex;
        gap: 10px;
    }

    .mobile-transport-type-option {
        flex: 1;
        padding: 15px 10px;
        border: 1px solid #ddd;
        border-radius: 8px;
        text-align: center;
        cursor: pointer;
        transition: all 0.3s;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        background-color: #f9f9f9;
    }

    .mobile-transport-type-option i {
        font-size: 18px;
    }

    .mobile-transport-type-option.active {
        background-color: #e6f0fa;
        border-color: #0071CE;
        color: #0071CE;
    }

    /* Текстовая область */
    textarea.mobile-form-control {
        min-height: 100px;
        resize: vertical;
    }

    /* Кнопка отправки */
    .mobile-submit-button {
        display: block;
        width: 100%;
        padding: 16px 20px;
        background-color: #0071CE;
        border: none;
        border-radius: 8px;
        color: white;
        font-size: 16px;
        font-weight: 700;
        text-transform: uppercase;
        text-align: center;
        cursor: pointer;
        transition: background-color 0.3s;
        margin-top: 20px; /* Увеличиваем отступ сверху */
        margin-bottom: 10px; /* Добавляем отступ снизу */
        box-shadow: 0 4px 15px rgba(0, 113, 206, 0.3);
    }

    /* Стили для активного состояния */
    body.mobile-modal-open {
        overflow: hidden;
        position: relative; /* Устанавливаем позиционирование для body */
    }

    .mobile-overlay.active {
        display: block;
        opacity: 1;
    }

    .mobile-transport-form-container.active {
        display: block;
        transform: translateY(0);
    }

    /* Специфичные стили для хедера при открытой форме */
    body.mobile-modal-open .header {
        z-index: auto; /* Сбрасываем z-index хедера */
    }
}
