/* ============================================================
   СВОЁ ТАКСИ — main.css
   Mobile-first, адаптивная типографика, safe-area, dvh/svh.
   Палитра взята из логотипа/референса:
     --black:        #000000
     --bg-elevated:  #0A0A0A
     --graphite:     #1A1A1A / #242424
     --border-dim:   #2A2A2A / #333333
     --yellow:       #FFD700  (фирменный жёлтый)
     --yellow-soft:  #FFC107
     --white:        #FFFFFF
     --text-dim:     #B0B0B0
     --text-mute:    #888888
   ============================================================ */

:root {
    /* Цвета */
    --black: #000000;
    --bg-base: #000000;
    --bg-elevated: #0A0A0A;
    --bg-graphite: #1A1A1A;
    --bg-card: #1C1C1C;
    --bg-card-hover: #242424;
    --border-dim: #2A2A2A;
    --border-mid: #333333;

    --yellow: #FFD700;
    --yellow-bright: #FFE15A;
    --yellow-soft: #FFC107;
    --yellow-glow: rgba(255, 215, 0, 0.45);
    --yellow-dim: rgba(255, 215, 0, 0.30);

    --white: #FFFFFF;
    --text-primary: #FFFFFF;
    --text-secondary: #B0B0B0;
    --text-muted: #888888;

    /* Радиусы */
    --r-pill: 999px;
    --r-btn: 16px;
    --r-card: 14px;
    --r-modal: 24px;

    /* Спейсинги */
    --side-pad: 20px;
    --gap-md: 16px;
    --gap-lg: 24px;

    /* Шрифт */
    --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Arial, sans-serif;
    --font-display: 'Unbounded', 'Manrope', sans-serif;

    /* Высоты */
    --header-h: 60px;
    --nav-h: 84px;
    --quick-order-h: 76px;
}

/* ---------- Базовый сброс ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.4;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    min-height: 100dvh;
    /* Лёгкий радиальный градиент для глубины */
    background-image:
        radial-gradient(ellipse 80% 50% at 50% 35%, rgba(255, 215, 0, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 50% 100%, rgba(255, 215, 0, 0.03) 0%, transparent 50%);
    background-attachment: fixed;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

button {
    font-family: inherit;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

ul {
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ============================================================
   Контейнер приложения
   ============================================================ */
body {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

@media (min-width: 768px) {
    body {
        max-width: 480px;
        box-shadow: 0 0 80px rgba(255, 215, 0, 0.05);
        min-height: 100dvh;
    }
}

/* ============================================================
   Верхняя панель
   ============================================================ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--header-h);
    padding: 0 var(--side-pad);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 215, 0, 0.08);
}

.app-header__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    height: 100%;
}

/* Кнопка меню ☰ */
.app-header__menu-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-pill);
    transition: background 0.2s ease;
}

.app-header__menu-btn:hover,
.app-header__menu-btn:active {
    background: rgba(255, 215, 0, 0.08);
}

.hamburger {
    display: block;
    width: 24px;
    height: 18px;
    position: relative;
}

.hamburger span {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--yellow);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
}

.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 8px; width: 80%; }
.hamburger span:nth-child(3) { top: 16px; }

/* Логотип */
.app-header__logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-header__logo img {
    height: 28px;
    width: auto;
    display: block;
}

/* Выбор города */
.app-header__city {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-graphite);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-pill);
    min-height: 44px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.app-header__city:hover,
.app-header__city:active {
    border-color: var(--yellow-dim);
    background: var(--bg-card-hover);
}

.app-header__city-pin {
    color: var(--yellow);
    display: flex;
    align-items: center;
}

.app-header__city-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.app-header__city-label {
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.app-header__city-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--white);
}

.app-header__city-chevron {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

/* ============================================================
   Основной контент
   ============================================================ */
.app-main {
    display: flex;
    flex-direction: column;
    min-height: calc(100dvh - var(--header-h));
    padding: 0 var(--side-pad);
    padding-bottom: calc(var(--nav-h) + var(--quick-order-h) + 12px);
    position: relative;
}

/* ============================================================
   Главный заголовок
   ============================================================ */
   .hero-headline {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 4px;
}

.hero-headline__title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 19px;              /* было 26px — уменьшили */
    line-height: 1.35;
    letter-spacing: 0.02em;
}

.hero-headline__line {
    display: block;
}

.hero-headline__line--primary {
    color: rgba(255, 255, 255, 0.5);   /* полупрозрачный белый вместо яркого */
    font-weight: 300;
}

.hero-headline__line--accent {
    color: rgba(255, 215, 0, 0.7);     /* приглушённый жёлтый */
    font-weight: 600;
    text-shadow: 0 0 16px rgba(255, 215, 0, 0.2);
}

@media (min-width: 393px) {
    .hero-headline__title { font-size: 20px; }
}

/* ============================================================
   AI-ядро
   ============================================================ */
.ai-core {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    max-width: 360px;
    margin: 20px auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-core__canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.ai-core__orbits {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.ai-core__orbit {
    fill: none;
    stroke: var(--yellow);
    stroke-width: 0.5;
    opacity: 0.18;
    stroke-dasharray: 3 6;
    transform-origin: center;
}

/* Подставка-отражение под сферой */
.ai-core__reflection {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 14px;
    pointer-events: none;
    z-index: 2;
}

.ai-core__reflection-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--yellow);
    filter: blur(4px);
}

.ai-core__reflection-ring--1 {
    width: 100%;
    height: 8px;
    opacity: 0.5;
}
.ai-core__reflection-ring--2 {
    width: 70%;
    height: 6px;
    opacity: 0.3;
}
.ai-core__reflection-ring--3 {
    width: 40%;
    height: 4px;
    opacity: 0.18;
}

/* Главная кнопка-микрофон */
.ai-core__mic-btn {
    position: relative;
    z-index: 5;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #1F1F1F 0%, #0A0A0A 80%);
    border: 2px solid var(--yellow);
    color: var(--yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow:
        0 0 32px rgba(255, 215, 0, 0.35),
        inset 0 0 24px rgba(255, 215, 0, 0.12);
    transition: transform 0.18s ease, box-shadow 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.ai-core__mic-btn:active {
    transform: scale(0.94);
    box-shadow:
        0 0 48px rgba(255, 215, 0, 0.55),
        inset 0 0 32px rgba(255, 215, 0, 0.2);
}

.ai-core__mic-core {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.ai-core__mic-icon {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

/* Концентрические волны (LISTENING) */
.ai-core__wave {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    border: 2px solid var(--yellow);
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    z-index: 4;
}

/* ============================================================
   Статус AI-ядра
   ============================================================ */
.ai-status {
    text-align: center;
    margin-top: 4px;
    margin-bottom: 16px;
    min-height: 24px;
}

.ai-status__text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: color 0.3s ease, opacity 0.3s ease;
}

.ai-status__text[data-state="listening"],
.ai-status__text[data-state="processing"] {
    color: var(--yellow);
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.4);
}

.ai-status__text[data-state="result"] {
    color: var(--white);
    font-weight: 600;
}

/* ============================================================
   Кнопка «Написать заказ»
   ============================================================ */
.text-order {
    margin: 8px 0 16px;
}

.text-order__btn {
    width: 100%;
    height: 56px;
    background: var(--bg-elevated);
    border: 2px solid var(--yellow);
    border-radius: var(--r-pill);
    color: var(--white);
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 22px;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
}

.text-order__btn:hover {
    background: rgba(255, 215, 0, 0.06);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.15);
}

.text-order__btn:active {
    transform: scale(0.98);
}

.text-order__icon {
    color: var(--yellow);
    display: flex;
}

.text-order__label {
    flex: 1;
    text-align: left;
}

.text-order__arrow {
    color: var(--yellow);
    display: flex;
    transition: transform 0.2s ease;
}

.text-order__btn:hover .text-order__arrow {
    transform: translateX(3px);
}

/* ============================================================
   Карточка результата заказа
   ============================================================ */
.order-result {
    margin: 8px 0 16px;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.order-result__card {
    background: linear-gradient(180deg, #141414 0%, #0A0A0A 100%);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: var(--r-card);
    padding: 18px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 24px rgba(255, 215, 0, 0.08);
}

.order-result__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.order-result__badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(255, 215, 0, 0.12);
    color: var(--yellow);
    border-radius: var(--r-pill);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.order-result__service {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.order-result__route {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.order-result__point {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 6px 0;
}

.order-result__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
}

.order-result__dot--from {
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.order-result__dot--to {
    background: var(--yellow);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.25), 0 0 12px var(--yellow-glow);
}

.order-result__point > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.order-result__caption {
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.order-result__value {
    font-size: 15px;
    font-weight: 600;
    color: var(--white);
}

.order-result__line {
    width: 2px;
    height: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 215, 0, 0.4));
    margin-left: 5px;
}

.order-result__continue {
    width: 100%;
    height: 48px;
    background: var(--yellow);
    color: var(--black);
    border-radius: var(--r-pill);
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
}

.order-result__continue:active {
    transform: scale(0.98);
}

.order-result__continue:hover {
    box-shadow: 0 6px 28px rgba(255, 215, 0, 0.45);
}

/* ============================================================
   Нижняя навигация услуг
   ============================================================ */
.services-nav {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom) + var(--quick-order-h) + 8px);
    left: 0;
    right: 0;
    z-index: 40;
    max-width: 480px;
    margin: 0 auto;
    padding: 0 var(--side-pad);
}

.services-nav__list {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0;
    /* чтобы items растягивались равномерно, но не вылезали */
    justify-content: space-between;
}

.services-nav__list::-webkit-scrollbar {
    display: none;
}

.services-nav__item {
    flex: 1 1 0;
    min-width: 0;
}

.service-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 2px;
    width: 100%;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.service-tab__icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-graphite);
    border: 1px solid var(--border-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    transition: all 0.2s ease;
}

.service-tab__label {
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.service-tab--active {
    color: var(--yellow);
}

.service-tab--active .service-tab__icon {
    background: var(--yellow);
    border-color: var(--yellow);
    color: var(--black);
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.5);
}

.service-tab--active .service-tab__label {
    font-weight: 700;
}

/* ============================================================
   Карточка быстрого заказа (нижняя)
   ============================================================ */
.quick-order-card {
    position: fixed;
    bottom: env(safe-area-inset-bottom);
    left: 0;
    right: 0;
    z-index: 45;
    max-width: 480px;
    margin: 0 auto;
    padding: 8px var(--side-pad);
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.9) 30%);
}

.quick-order-card__btn {
    width: 100%;
    height: 64px;
    background: var(--bg-card);
    border: 1px solid var(--border-dim);
    border-radius: var(--r-card);
    padding: 0 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.quick-order-card__btn:hover,
.quick-order-card__btn:active {
    border-color: var(--yellow-dim);
    background: var(--bg-card-hover);
    transform: translateY(-1px);
}

.quick-order-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card-hover);
    color: var(--yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 0 12px rgba(255, 215, 0, 0.1);
}

.quick-order-card__text {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 2px;
    line-height: 1.2;
}

.quick-order-card__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--white);
}

.quick-order-card__subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.quick-order-card__arrow {
    color: var(--text-secondary);
    display: flex;
    transition: transform 0.2s ease;
}

.quick-order-card__btn:hover .quick-order-card__arrow {
    transform: translateX(2px);
    color: var(--yellow);
}

/* ============================================================
   Модальные окна
   ============================================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal[hidden] {
    display: none;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: fadeIn 0.2s ease;
}

.modal__sheet {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: var(--bg-graphite);
    border-radius: var(--r-modal) var(--r-modal) 0 0;
    padding: 24px var(--side-pad) calc(24px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border-dim);
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal__title {
    font-size: 20px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 6px;
}

.modal__subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.modal__textarea {
    width: 100%;
    min-height: 120px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-mid);
    border-radius: var(--r-btn);
    padding: 14px 16px;
    color: var(--white);
    font-family: inherit;
    font-size: 15px;
    resize: vertical;
    margin-bottom: 16px;
    transition: border-color 0.2s ease;
}

.modal__textarea:focus {
    outline: none;
    border-color: var(--yellow);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.modal__textarea::placeholder {
    color: var(--text-muted);
}

.modal__submit-btn {
    width: 100%;
    height: 52px;
    background: var(--yellow);
    color: var(--black);
    border-radius: var(--r-pill);
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.15s ease;
}

.modal__submit-btn:active {
    transform: scale(0.98);
}

/* Список городов */
.city-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.city-list__item {
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-dim);
    border-radius: var(--r-btn);
    color: var(--white);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.city-list__item:hover,
.city-list__item:active {
    background: var(--bg-card-hover);
    border-color: var(--yellow-dim);
    color: var(--yellow);
}

/* ============================================================
   Toast (системные уведомления)
   ============================================================ */
.toast {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom) + 160px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    background: var(--bg-card);
    border: 1px solid var(--yellow-dim);
    color: var(--white);
    padding: 12px 20px;
    border-radius: var(--r-pill);
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    max-width: calc(100% - 32px);
    text-align: center;
    animation: toastIn 0.3s ease;
}

.toast[hidden] {
    display: none;
}

/* ============================================================
   Состояния AI-ядра (data-attr на .ai-core или body)
   ============================================================ */
body[data-ai-state="listening"] .ai-core__mic-btn {
    box-shadow:
        0 0 56px rgba(255, 215, 0, 0.6),
        inset 0 0 32px rgba(255, 215, 0, 0.25);
    transform: scale(1.06);
}

body[data-ai-state="listening"] .ai-core__mic-icon,
body[data-ai-state="processing"] .ai-core__mic-icon {
    animation: micPulse 1.2s ease-in-out infinite;
}

body[data-ai-state="processing"] .ai-core__mic-btn {
    box-shadow:
        0 0 48px rgba(255, 215, 0, 0.5),
        inset 0 0 28px rgba(255, 215, 0, 0.22);
    transform: scale(1.04);
}

body[data-ai-state="result"] .ai-core__mic-btn {
    box-shadow:
        0 0 32px rgba(80, 220, 120, 0.4),
        inset 0 0 24px rgba(80, 220, 120, 0.15);
    border-color: #5CD878;
    color: #5CD878;
}

/* ============================================================
   prefers-reduced-motion: отключаем интенсивные анимации
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ============================================================
   Дополнительные breakpoint'ы для крупных смартфонов
   ============================================================ */
@media (min-width: 414px) {
    .ai-core { max-width: 380px; }
    .hero-headline__title { font-size: 20px; }
    .ai-core__mic-btn { width: 100px; height: 100px; }
    .ai-core__wave { width: 100px; height: 100px; }
}

@media (min-width: 480px) {
    .ai-core { max-width: 400px; }
    .hero-headline__title { font-size: 21px; }
}

/* Desktop: ограничиваем "телефонную" компоновку */
@media (min-width: 768px) {
    body {
        border-left: 1px solid rgba(255, 215, 0, 0.08);
        border-right: 1px solid rgba(255, 215, 0, 0.08);
    }
    .hero-headline { margin-top: 32px; }
    .hero-headline__title { font-size: 22px; }
}
