/* ============================================================
   Home booking — mobile premium (Apple-inspired)
   Scoped: .home-booking @ max-width 768px
   ============================================================ */

/* Tüm ekranlar — svg { max-width:100% } global kuralını ez (dev ikon hatası) */
.home-booking svg.field-icon {
    width: 18px;
    height: 18px;
    max-width: 18px;
    min-width: 18px;
    flex-shrink: 0;
}
.home-booking .dt-pair__icon svg {
    width: 16px;
    height: 16px;
    max-width: 16px;
    min-width: 16px;
}
.home-booking .swap-btn--circle svg {
    width: 16px;
    height: 16px;
    max-width: 16px;
}
.home-booking .popular-route-pill svg {
    width: 14px;
    height: 14px;
    max-width: 14px;
    min-width: 14px;
}
.home-booking .search-submit--premium svg {
    width: 18px;
    height: 18px;
    max-width: 18px;
}
.home-booking .sb-pill {
    display: flex;
    align-items: center;
}
.home-booking label.sb-pill {
    cursor: text;
}

.home-booking .sb-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 56px;
    padding: 0 1rem;
    background: var(--home-surface-elevated, #1C1C1E);
    border: 1px solid var(--home-border, rgba(255, 255, 255, 0.08));
    border-radius: 14px;
}

.home-booking .sb-pill input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    color: #fff;
}

.home-booking .sb-card--datetime {
    background: var(--home-surface-elevated, #1C1C1E);
    border: 1px solid var(--home-border, rgba(255, 255, 255, 0.08));
    border-radius: 14px;
    overflow: visible;
}

/* Tarih/saat — siyah input arka planını kaldır (mobil + masaüstü) */
.home-booking .search-field--embedded,
.home-booking .search-field--embedded .dt-pair,
.home-booking .search-field--embedded .dt-pair__row,
.home-booking .search-field--embedded .dt-pair__field,
.home-booking .search-field--embedded .dt-pair__body,
.home-booking .search-field--embedded input,
.home-booking .search-field--embedded button.dt-pair__field--time,
.home-booking .dt-pair--inline .dt-pair__input,
.home-booking .dt-pair--inline .dt-pair__input--time,
.home-booking .dt-pair--inline input.form-control,
.home-booking .dt-pair--inline input.form-control.input {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.home-booking .search-field--embedded .dt-pair__field:hover,
.home-booking .search-field--embedded .dt-pair__field:focus-within,
.home-booking .search-field--embedded button.dt-pair__field--time:hover,
.home-booking .search-field--embedded button.dt-pair__field--time:focus {
    background: transparent !important;
}

.home-booking .dt-pair__field--date > input.flatpickr-input {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    pointer-events: none;
    overflow: hidden;
}

.home-booking .dt-pair__field--date {
    background: transparent !important;
    position: relative;
}

.home-booking .search-field--embedded {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0;
}

.home-booking .popular-route-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: #1C1C1E;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.8125rem;
    text-decoration: none;
}

.home-booking .popular-route-pill__from,
.home-booking .popular-route-pill__to {
    max-width: 14ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-booking {
    --home-bg: #0A0A0A;
    --home-surface: #141414;
    --home-surface-elevated: #1C1C1E;
    --home-accent: #F5A623;
    --home-accent-dk: #E09410;
    --home-accent-glow: rgba(245, 166, 35, 0.4);
    --home-text: #FFFFFF;
    --home-text-soft: rgba(255, 255, 255, 0.72);
    --home-placeholder: #6B6B6B;
    --home-border: rgba(255, 255, 255, 0.08);
    --home-glass: rgba(255, 255, 255, 0.05);
    --home-radius-pill: 14px;
    --home-radius-cta: 16px;
    --home-field-h: 56px;
    --home-gap: 12px;
    --home-font: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
}

@media (max-width: 768px) {
    html {
        scroll-behavior: smooth;
    }

    .home-booking {
        font-family: var(--home-font);
        padding: 0 1rem 2rem;
        margin-top: -2.75rem;
        position: relative;
        z-index: 10;
    }

    /* ── Hero ─────────────────────────────────────────────── */
    .hero--home {
        margin: 0 !important;
        border-radius: 0;
        min-height: min(52vh, 420px);
        padding: max(3.5rem, env(safe-area-inset-top, 0px) + 2.5rem) 1.25rem 5.5rem;
        background-color: var(--home-bg) !important;
    }
    .hero--home::before {
        background: linear-gradient(
            180deg,
            rgba(10, 10, 10, 0.25) 0%,
            rgba(10, 10, 10, 0.55) 45%,
            rgba(10, 10, 10, 0.92) 100%
        );
    }
    .hero--home .hero-inner {
        max-width: 28rem;
        margin: 0 auto;
        text-align: left;
    }
    .hero--home .hero__headline {
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
    }
    .hero--home .hero__headline-primary {
        display: block;
        font-size: clamp(1.75rem, 8vw, 2.125rem);
        font-weight: 800;
        line-height: 1.1;
        letter-spacing: -0.03em;
        color: var(--home-text);
        max-width: 14ch;
    }
    .hero--home .hero__headline-secondary {
        display: block;
        font-size: clamp(1rem, 4.5vw, 1.125rem);
        font-weight: 400;
        line-height: 1.35;
        color: var(--home-text-soft);
        max-width: 22ch;
    }
    .hero--home p.lede {
        display: none;
    }

    /* ── Frosted form card ────────────────────────────────── */
    .home-booking .search-bar--premium {
        display: flex;
        flex-direction: column;
        margin: 0;
        max-width: none;
        padding: 1.125rem;
        gap: var(--home-gap);
        background: var(--home-glass);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--home-border);
        border-radius: 20px;
        box-shadow: none;
        opacity: 0;
        transform: translateY(16px);
        animation: homeFormEnter 0.4s ease-out 0.08s forwards;
    }
    @keyframes homeFormEnter {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .home-booking .sb-stack {
        display: flex;
        flex-direction: column;
        gap: var(--home-gap);
    }

    /* ── Location pills ───────────────────────────────────── */
    .home-booking .sb-locations {
        display: flex;
        flex-direction: column;
        gap: var(--home-gap);
        position: relative;
    }
    .home-booking .sb-pill {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        min-height: var(--home-field-h);
        height: var(--home-field-h);
        padding: 0 1rem;
        background: var(--home-surface-elevated);
        border: 1px solid var(--home-border);
        border-radius: var(--home-radius-pill);
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }
    .home-booking .sb-pill:focus-within {
        border-color: rgba(245, 166, 35, 0.55);
        box-shadow: 0 0 0 2px var(--home-accent-glow);
    }
    .home-booking .sb-pill .field-icon {
        width: 18px;
        height: 18px;
        color: var(--home-placeholder);
        flex-shrink: 0;
    }
    .home-booking .sb-pill input {
        flex: 1;
        min-width: 0;
        border: none;
        outline: none;
        background: transparent;
        font-family: inherit;
        font-size: 16px;
        font-weight: 500;
        color: var(--home-text);
    }
    .home-booking .sb-pill input::placeholder {
        color: var(--home-placeholder);
        font-weight: 400;
    }

    .home-booking .sb-swap-wrap {
        display: flex;
        justify-content: center;
        margin: -6px 0;
        position: relative;
        z-index: 2;
    }
    .home-booking .swap-btn--circle {
        width: 40px;
        height: 40px;
        display: grid;
        place-items: center;
        padding: 0;
        border-radius: 50%;
        background: var(--home-surface);
        border: 1px solid var(--home-border);
        color: var(--home-text-soft);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                    border-color 0.2s ease,
                    color 0.2s ease;
    }
    .home-booking .swap-btn--circle svg {
        width: 16px;
        height: 16px;
    }
    .home-booking .swap-btn--circle.is-spinning {
        transform: rotate(180deg);
    }
    .home-booking .swap-btn--circle:active {
        transform: scale(0.94);
    }
    .home-booking .swap-btn--circle.is-spinning:active {
        transform: rotate(180deg) scale(0.94);
    }

    /* ── Datetime unified card (50/50) ───────────────────── */
    .home-booking .sb-card--datetime {
        min-height: var(--home-field-h);
        padding: 0;
        background: var(--home-surface-elevated);
        border: 1px solid var(--home-border);
        border-radius: var(--home-radius-pill);
        overflow: visible;
        transition: border-color 0.2s ease, box-shadow 0.2s ease;
    }
    .home-booking .sb-card--datetime:focus-within {
        border-color: rgba(245, 166, 35, 0.55);
        box-shadow: 0 0 0 2px var(--home-accent-glow);
    }
    .home-booking .search-field--embedded {
        min-height: 0 !important;
    }
    .home-booking .search-field--embedded input,
    .home-booking .dt-pair--inline .dt-pair__input,
    .home-booking .dt-pair--inline .dt-pair__input--time {
        color: var(--home-text);
    }
    .home-booking .dt-pair--inline {
        width: 100%;
    }
    .home-booking .dt-pair--inline .dt-pair__row {
        flex-direction: row;
        align-items: stretch;
        min-height: var(--home-field-h);
    }
    .home-booking .dt-pair--inline .dt-pair__field {
        flex: 1 1 50%;
        min-height: var(--home-field-h);
        padding: 0 0.75rem;
        gap: 0.5rem;
    }
    .home-booking .dt-pair--inline .dt-pair__field--time {
        padding-left: 0.75rem;
    }
    .home-booking .dt-pair--inline .dt-pair__sep {
        width: 1px;
        height: auto;
        align-self: stretch;
        margin: 10px 0;
        background: var(--home-border);
    }
    .home-booking .dt-pair--inline .dt-pair__icon {
        width: 16px;
        height: 16px;
        color: var(--home-placeholder);
    }
    .home-booking .dt-pair--inline .dt-pair__field--time .dt-pair__icon {
        display: grid;
    }
    .home-booking .dt-pair--inline .dt-pair__input,
    .home-booking .dt-pair--inline .dt-pair__input--time {
        font-size: 16px;
        font-weight: 500;
        color: var(--home-text);
    }
    .home-booking .dt-pair--inline .dt-pair__input::placeholder,
    .home-booking .dt-pair--inline [data-placeholder] {
        color: var(--home-placeholder);
        font-weight: 400;
    }
    .home-booking .dt-pair__field:hover,
    .home-booking .dt-pair__field:focus-within {
        background: transparent;
    }

    /* ── Collapsible return ───────────────────────────────── */
    .home-booking .sb-return-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: var(--home-field-h);
        padding: 0 1rem;
        font-family: inherit;
        font-size: 16px;
        font-weight: 500;
        color: var(--home-text-soft);
        background: var(--home-surface-elevated);
        border: 1px solid var(--home-border);
        border-radius: var(--home-radius-pill);
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: border-color 0.2s ease, color 0.2s ease;
    }
    .home-booking .sb-return-toggle__chevron {
        width: 18px;
        height: 18px;
        color: var(--home-placeholder);
        transition: transform 0.3s ease;
    }
    .home-booking .sb-return.is-open .sb-return-toggle__chevron {
        transform: rotate(180deg);
    }
    .home-booking .sb-return.is-open .sb-return-toggle {
        color: var(--home-text);
        border-color: rgba(245, 166, 35, 0.35);
    }
    .home-booking .sb-return-panel {
        display: grid;
        grid-template-rows: 0fr;
        transition: grid-template-rows 0.3s ease;
    }
    .home-booking .sb-return-panel > .sb-return-panel__inner {
        overflow: hidden;
    }
    .home-booking .sb-return.is-open .sb-return-panel {
        grid-template-rows: 1fr;
    }
    .home-booking .sb-return-panel__inner {
        padding-top: var(--home-gap);
    }

    /* ── Passenger — minimal stepper ─────────────────────── */
    .home-booking .sb-pill--pax {
        justify-content: space-between;
    }
    .home-booking .sb-pill--pax .field-icon {
        color: var(--home-placeholder);
    }
    .home-booking .sb-pax-label {
        flex: 1;
        font-size: 16px;
        font-weight: 500;
        color: var(--home-text-soft);
    }
    .home-booking .pax-stepper--minimal {
        display: inline-flex;
        align-items: center;
        gap: 1rem;
        background: none;
        border: none;
    }
    .home-booking .pax-stepper--minimal .pax-stepper__btn {
        width: 44px;
        height: 44px;
        display: grid;
        place-items: center;
        padding: 0;
        border: none;
        background: transparent;
        color: var(--home-text);
        font-size: 1.375rem;
        font-weight: 300;
        line-height: 1;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.15s ease, transform 0.15s ease;
    }
    .home-booking .pax-stepper--minimal .pax-stepper__btn:active {
        transform: scale(0.88);
        color: var(--home-accent);
    }
    .home-booking .pax-stepper--minimal .pax-stepper__input {
        width: 2rem;
        min-width: 2rem;
        border: none;
        background: transparent;
        text-align: center;
        font-family: inherit;
        font-size: 17px;
        font-weight: 600;
        color: var(--home-text);
        padding: 0;
        -moz-appearance: textfield;
        appearance: textfield;
    }
    .home-booking .pax-stepper--minimal .pax-stepper__input::-webkit-outer-spin-button,
    .home-booking .pax-stepper--minimal .pax-stepper__input::-webkit-inner-spin-button {
        -webkit-appearance: none;
        margin: 0;
    }

    /* ── CTA ─────────────────────────────────────────────── */
    .home-booking .search-submit--premium {
        width: 100%;
        height: 60px;
        min-height: 60px;
        margin: 0.25rem 0 0;
        padding: 0 1.25rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        font-family: inherit;
        font-size: 1.0625rem;
        font-weight: 700;
        color: #fff;
        background: var(--home-accent) !important;
        border: none;
        border-radius: var(--home-radius-cta);
        box-shadow: 0 4px 24px rgba(245, 166, 35, 0.22);
        cursor: pointer;
        position: relative;
        overflow: hidden;
        -webkit-tap-highlight-color: transparent;
        transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    }
    .home-booking .search-submit--premium svg {
        width: 18px;
        height: 18px;
    }
    .home-booking .search-submit--premium:active {
        transform: scale(0.97);
        box-shadow: 0 2px 16px rgba(245, 166, 35, 0.45);
        background: var(--home-accent-dk) !important;
    }
    .home-booking .search-submit--premium .search-submit__ripple {
        position: absolute;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.35);
        transform: scale(0);
        animation: homeRipple 0.5s ease-out forwards;
        pointer-events: none;
    }
    @keyframes homeRipple {
        to {
            transform: scale(2.5);
            opacity: 0;
        }
    }

    /* Hide legacy swap row in grid flow */
    .home-booking .search-swap {
        display: none;
    }

    /* ── Popular routes ───────────────────────────────────── */
    .home-booking .popular-routes--premium {
        margin-top: 1.75rem;
        padding: 0;
        align-items: flex-start;
        text-align: left;
    }
    .home-booking .popular-routes--premium .popular-routes__label {
        font-size: 0.6875rem;
        font-weight: 600;
        letter-spacing: 0.1em;
        text-transform: uppercase;
        color: var(--home-placeholder);
        margin-bottom: 0.25rem;
    }
    .home-booking .popular-routes--premium .popular-routes__list {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.5rem;
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        padding-bottom: 0.25rem;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .home-booking .popular-routes--premium .popular-routes__list::-webkit-scrollbar {
        display: none;
    }
    .home-booking .popular-route-pill {
        flex: 0 0 auto;
        scroll-snap-align: start;
        display: inline-flex;
        align-items: center;
        gap: 0.375rem;
        max-width: min(280px, 78vw);
        min-height: 44px;
        padding: 0.5rem 0.875rem;
        background: var(--home-surface-elevated);
        border: 1px solid var(--home-border);
        border-radius: 999px;
        color: var(--home-text-soft);
        font-size: 0.8125rem;
        font-weight: 500;
        text-decoration: none;
        opacity: 1;
        transform: none;
        animation: homeChipIn 0.35s ease-out both;
        transition: border-color 0.2s ease, color 0.2s ease;
    }
    .home-booking .popular-route-pill:nth-child(1) { animation-delay: 0.05s; }
    .home-booking .popular-route-pill:nth-child(2) { animation-delay: 0.1s; }
    .home-booking .popular-route-pill:nth-child(3) { animation-delay: 0.15s; }
    .home-booking .popular-route-pill:nth-child(4) { animation-delay: 0.2s; }
    .home-booking .popular-route-pill:nth-child(5) { animation-delay: 0.25s; }
    .home-booking .popular-route-pill:nth-child(6) { animation-delay: 0.3s; }
    .home-booking .popular-route-pill:nth-child(7) { animation-delay: 0.35s; }
    .home-booking .popular-route-pill:nth-child(8) { animation-delay: 0.4s; }
    @keyframes homeChipIn {
        from {
            opacity: 0.6;
            transform: translateY(6px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    .home-booking .popular-route-pill__from,
    .home-booking .popular-route-pill__to {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 9rem;
    }
    .home-booking .popular-route-pill svg {
        width: 12px;
        height: 12px;
        flex-shrink: 0;
        color: var(--home-placeholder);
        opacity: 0.85;
    }
    .home-booking .popular-route-pill:active {
        border-color: rgba(245, 166, 35, 0.4);
        color: var(--home-text);
    }

    /* Flatpickr — ana sayfa mobil: ortalanmış, body'ye append */
    .flatpickr-calendar.flatpickr-ccn--home {
        border-radius: 16px;
        box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-booking .search-bar--premium,
    .home-booking .popular-route-pill {
        animation: none;
        opacity: 1;
        transform: none;
    }
    .home-booking .swap-btn--circle,
    .home-booking .sb-return-panel,
    .home-booking .sb-return-toggle__chevron {
        transition: none;
    }
}
