/**
 * Стили страницы заказа такси
 */

/* Карта */
#map {
    width: 100%;
    height: 50vh;
    min-height: 300px;
}

/* Полноэкранный режим карты */
#map:-webkit-full-screen {
    width: 100vw !important;
    height: 100vh !important;
    max-height: none !important;
    min-height: 0 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 99999 !important;
}

#map:fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    max-height: none !important;
    min-height: 0 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 99999 !important;
}

/* Скрываем лишние элементы Яндекс.Карт */
#map [class*="gotoymaps"],
#map [class*="gototech"],
#map [class*="copyrights-promo"] > a,
#map [class*="copyrights__promo"] > a {
    display: none !important;
}

/* Копирайт (условия использования) - слева */
#map [class*="copyrights-pane"] {
    left: 10px !important;
    right: auto !important;
    bottom: 10px !important;
}

/* Лого Яндекс.Карт - справа внизу */
#map [class*="copyright__logo"] {
    position: fixed !important;
    left: auto !important;
    right: 10px !important;
    top: auto !important;
    bottom: 10px !important;
    z-index: 100;
}

/* Отключаем клики на POI */
#map [class*="places-pane"] {
    pointer-events: none !important;
}

/* Карта в тёмной теме */
[data-bs-theme="dark"] #map .ymaps-2-1-79-map {
    filter: invert(1) hue-rotate(180deg) brightness(0.95) saturate(0.85);
}

[data-bs-theme="dark"] #map .ymaps-2-1-79-controls-pane,
[data-bs-theme="dark"] #map .ymaps-2-1-79-places-pane,
[data-bs-theme="dark"] #map .ymaps-2-1-79-ground-pane {
    filter: invert(1) hue-rotate(-180deg) brightness(1.05) saturate(1.2);
}

/* Форма заказа */
.order-form {
    background: var(--bs-body-bg);
    border-radius: 0;
    position: relative;
    z-index: 10;
}

/* Вертикальная пунктирная линия */
.route-line {
    position: absolute;
    left: 18px;
    width: 2px;
    background: repeating-linear-gradient(
        to bottom,
        var(--bs-danger) 0,
        var(--bs-danger) 6px,
        transparent 6px,
        transparent 10px
    );
    z-index: 1;
    pointer-events: none;
}

/* Точка маршрута */
.route-point {
    position: relative;
    padding-left: 40px;
    z-index: 2;
}

.route-point::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 20px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid var(--bs-primary);
    background: #fff;
    z-index: 3;
}

.route-point.point-start::before {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
}

.route-point.point-end::before {
    background: var(--bs-danger);
    border-color: var(--bs-danger);
}

.route-point.point-intermediate::before {
    background: var(--bs-warning);
    border-color: var(--bs-warning);
}

/* Поле адреса */
.address-input {
    padding-right: 40px;
}

.btn-point-options {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: var(--bs-secondary);
}

[data-bs-theme="dark"] .btn-point-options {
    color: #9ca3af;
}

.btn-point-options:hover {
    color: var(--bs-primary);
}

/* Подсказка "Действия в точке" */
.point-options-hint {
    position: absolute;
    right: -4px;
    bottom: calc(100% + 9px);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    color: var(--bs-primary);
    font-weight: 500;
    pointer-events: none;
    white-space: nowrap;
    opacity: 1;
    transition: opacity .3s ease;
    z-index: 5;
}

.point-options-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

.point-hint-arrow {
    display: block;
    font-size: 10px;
    margin-right: -48px;
    animation: point-hint-bounce 1.4s ease-in-out infinite;
}

@keyframes point-hint-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(3px); }
}

/* Опции точки */
.point-options {
    background: var(--bs-light);
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
    display: none;
}

.point-options.show {
    display: block;
}

/* Поле ввода адреса */
.address-input-wrap {
    position: relative;
    z-index: 10;
}

.route-point:focus-within {
    z-index: 100;
}

/* Активная точка маршрута */
.route-point.active-point .address-input-wrap {
    border: 2px solid var(--bs-primary);
    border-radius: 8px;
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.25);
}

.route-point.active-point .address-input {
    border-color: transparent;
}

.route-point.active-point.point-start .address-input-wrap {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.25);
}

.route-point.active-point.point-end .address-input-wrap {
    border-color: var(--bs-danger);
    box-shadow: 0 0 0 3px rgba(234, 67, 53, 0.25);
}

.route-point.active-point.point-intermediate .address-input-wrap {
    border-color: var(--bs-warning);
    box-shadow: 0 0 0 3px rgba(251, 188, 4, 0.25);
}

/* Подсказки адресов */
.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    max-height: 250px;
    overflow-y: auto;
    display: none;
}

.suggestions-list.show {
    display: block;
}

.suggestion-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid var(--bs-border-color);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item.active {
    background: var(--bs-primary);
    color: #fff;
}

.suggestions-list:not(.keyboard-nav) .suggestion-item:hover {
    background: var(--bs-primary);
    color: #fff;
}

.suggestion-item .suggestion-title {
    font-weight: 500;
}

.suggestion-item .suggestion-subtitle {
    font-size: 12px;
    opacity: 0.7;
}

/* Кнопка добавления точки */
.btn-add-point {
    border: 2px dashed var(--bs-border-color);
    background: transparent;
    color: var(--bs-secondary);
    padding: 12px;
    border-radius: 8px;
    margin-left: 40px;
    width: calc(100% - 40px);
    position: relative;
    z-index: 5;
}

.btn-add-point:hover {
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}

/* Кнопка удаления точки */
.btn-remove-point {
    position: absolute;
    left: -5px;
    top: 15px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: var(--bs-danger);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.route-point.point-intermediate .btn-remove-point {
    display: flex;
}

/* Секция маршрута */
.route-section {
    background: var(--bs-light);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 2px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.route-section.active {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 3px rgba(var(--bs-primary-rgb), 0.15);
}

.route-section-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bs-border-color);
}

.route-section-header h6 {
    color: var(--bs-dark);
}

.route-section.active .route-section-header h6 {
    color: var(--bs-primary);
}

.route-section .route-points-container {
    position: relative;
}

.route-section .btn-add-point {
    margin-left: 40px;
    width: calc(100% - 40px);
}

/* Шаг 2: Выбор типа поездки */
.order-step {
    background: var(--bs-body-bg);
    min-height: 100vh;
}

/* Сводка пассажиров */
.passengers-summary {
    background: var(--bs-light);
    border-radius: 12px;
    padding: 16px;
}

.passenger-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.passengers-summary .route-summary-item {
    align-items: center;
}

.passengers-summary .passenger-text {
    font-size: 14px;
}

/* Сводка маршрута */
.route-summary {
    background: var(--bs-light);
    border-radius: 12px;
    padding: 16px;
}

.route-summary-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--bs-border-color);
}

.route-summary-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.route-summary-item:first-child {
    padding-top: 0;
}

.route-summary-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.route-summary-icon.icon-there {
    background: var(--bs-primary);
    color: #fff;
}

.route-summary-icon.icon-back {
    background: var(--bs-secondary);
    color: #fff;
}

.route-summary-content {
    flex: 1;
    min-width: 0;
}

.route-summary-label {
    font-size: 12px;
    color: var(--bs-secondary);
    margin-bottom: 4px;
}

.route-summary-label .route-distance {
    font-weight: 600;
    color: var(--bs-primary);
}

.route-summary-points {
    font-size: 14px;
}

.route-summary-points .point {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 4px;
}
.route-summary-points .point:last-child {
    margin-bottom: 0;
}

.route-summary-points .point-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 5px;
}

.route-summary-points .point-dot.start { background: var(--bs-primary); }
.route-summary-points .point-dot.intermediate { background: var(--bs-warning); }
.route-summary-points .point-dot.end { background: var(--bs-danger); }

.route-summary-points .point-meta {
    font-size: 12px;
    color: var(--bs-secondary);
    margin-top: 2px;
    margin-bottom: 4px;
    padding-left: 16px;
}

.route-summary-points .point-meta span {
    margin-right: 12px;
}

.route-summary-points .point-meta .wait-badge {
    color: var(--bs-primary);
}

.route-summary-points .point-meta .action-badge {
    font-weight: 500;
}

.route-summary-points .point-meta .action-badge.meet {
    color: var(--bs-success);
}

.route-summary-points .point-meta .action-badge.escort {
    color: var(--bs-success);
}

/* Выбор типа поездки */
.trip-type-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

@media (min-width: 576px) {
    .trip-type-tabs {
        flex-direction: row;
    }
}

.trip-type-tab {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid var(--bs-border-color);
    border-radius: 12px;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-weight: 500;
    transition: all 0.2s;
}

.trip-type-tab:hover {
    border-color: var(--bs-primary);
}

.trip-type-tab.active {
    border-color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.1);
    color: var(--bs-primary);
}

/* Блок расписания */
.schedule-tabs {
    display: flex;
    background: var(--bs-light);
    border-radius: 10px;
    padding: 4px;
}

.schedule-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--bs-body-color);
    font-weight: 500;
    transition: all 0.2s;
}

.schedule-tab.active {
    background: var(--bs-body-bg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Переключатели-таблетки (пол, класс авто) */
.option-tabs {
    display: flex;
    background: var(--bs-light);
    border-radius: 10px;
    padding: 4px;
}

.option-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--bs-body-color);
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0;
}

.btn-check:checked + .option-tab {
    background: var(--bs-body-bg);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* День недели */
.weekday-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--bs-border-color);
}

.weekday-item:last-child {
    border-bottom: none;
}

/* Кнопки копирования расписания — на линии-разделителе */
.copy-schedule-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    position: relative;
    padding: 8px 0;
}
.copy-schedule-buttons::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--bs-border-color);
}
.weekday-item:has(+ .copy-schedule-buttons) {
    border-bottom: none;
}
.btn-copy-schedule {
    position: relative;
    z-index: 1;
    background-color: var(--bs-body-bg);
    font-size: 12px;
    padding: 3px 12px;
    border-radius: 20px;
    border: 1px solid var(--bs-border-color);
    color: var(--bs-primary);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .2s, color .2s;
}
.btn-copy-schedule:hover {
    background-color: var(--bs-primary);
    color: #fff;
    border-color: var(--bs-primary);
}

.weekday-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.weekday-name {
    font-weight: 500;
}

.weekday-dates {
    display: block;
    font-size: 12px;
    color: var(--bs-secondary);
    margin-top: 2px;
}

.weekday-times {
    margin-top: 12px;
    padding-left: 0;
}

/* Элемент даты */
.date-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--bs-border-color);
}

.date-item:last-child {
    border-bottom: none;
}
.date-item:has(+ .copy-schedule-buttons) {
    border-bottom: none;
}

.date-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.date-name {
    font-weight: 500;
}

.date-times {
    margin-top: 12px;
}

/* Календарь выбора периода */
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.calendar-month-year {
    font-weight: 600;
    font-size: 16px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 12px;
    color: var(--bs-secondary);
    margin-bottom: 8px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
}

.calendar-day:hover:not(.disabled):not(.empty) {
    background: var(--bs-light);
}

.calendar-day.disabled {
    color: var(--bs-secondary);
    opacity: 0.5;
    cursor: not-allowed;
}

.calendar-day.empty {
    cursor: default;
}

.calendar-day.selected {
    background: var(--bs-primary);
    color: #fff;
}

.calendar-day.in-range {
    background: rgba(var(--bs-primary-rgb), 0.2);
    border-radius: 0;
}

.calendar-day.range-start {
    border-radius: 50% 0 0 50%;
}

.calendar-day.range-end {
    border-radius: 0 50% 50% 0;
}

.calendar-day.range-start.range-end {
    border-radius: 50%;
}

/* Шаг 0: Форма пассажиров */
.step0-container {
    min-height: calc(100vh - 80px);
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

[data-bs-theme="dark"] .step0-container {
    background: linear-gradient(135deg, #1a1f29 0%, #12161c 100%);
}

.step0-header {
    text-align: center;
    padding-top: 2rem;
    margin-bottom: 2rem;
}

.step0-header h1 {
    font-weight: 700;
    color: var(--bs-body-color);
}

.step0-form {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    padding: 2rem;
}

[data-bs-theme="dark"] .step0-form {
    background: var(--bs-body-bg);
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.child-card {
    background: var(--bs-light);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

.child-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.child-card-title {
    font-weight: 600;
    color: var(--bs-primary);
}

.btn-remove-child {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: var(--bs-danger);
    color: #fff;
    border-radius: 50%;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.children-list:empty + .no-children-msg {
    display: block;
}

.no-children-msg {
    display: none;
    text-align: center;
    color: var(--bs-secondary);
    padding: 1rem;
}

/* Сводка расписания на шаге 3 (опции) */
.schedule-summary {
    background: var(--bs-light);
    border-radius: 12px;
    padding: 16px;
}

.schedule-summary .schedule-date {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 8px 0;
}

.schedule-summary .schedule-date .date-value {
    font-weight: 600;
    color: var(--bs-dark);
}

.schedule-summary .schedule-times {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 14px;
    color: var(--bs-secondary);
}

.schedule-summary .schedule-times i {
    margin-right: 4px;
}

.schedule-summary .schedule-times i.fa-arrow-right {
    color: var(--bs-primary);
}

.schedule-summary .schedule-period {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 8px 0;
    border-bottom: 1px solid var(--bs-border-color);
    margin-bottom: 12px;
}

.schedule-summary .schedule-period .period-label {
    font-size: 13px;
    color: var(--bs-secondary);
}

.schedule-summary .schedule-period .period-value {
    font-weight: 600;
    color: var(--bs-dark);
}

.schedule-summary .schedule-weekdays {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.schedule-summary .schedule-day {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 8px 12px;
    background: var(--bs-body-bg);
    border-radius: 8px;
}

.schedule-summary .day-name {
    font-weight: 500;
    min-width: 100px;
}

.schedule-summary .day-times {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 14px;
    color: var(--bs-secondary);
}

.schedule-summary .day-times i {
    margin-right: 4px;
}

.schedule-summary .day-times i.fa-arrow-right {
    color: var(--bs-primary);
}
