/**
 * TT Search Dropdown — Autocomplete Styles
 *
 * @package TatilTour
 * @since 1.1.0
 */

/* ── Dropdown Container ──────────────────────────── */
.tt-sd {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: var(--z-dropdown, 100);
    background: #fff;
    border-radius: 0;
    box-shadow: 0 12px 40px rgba(0,0,0,0.15), 0 4px 12px rgba(0,0,0,0.08);
    max-height: 420px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
    scrollbar-width: thin;
    scrollbar-color: var(--tt-primary, #fd5c02) #f0f0f0;
}

.tt-sd--open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Scrollbar */
.tt-sd::-webkit-scrollbar {
    width: 5px;
}
.tt-sd::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 0 0 12px 0;
}
.tt-sd::-webkit-scrollbar-thumb {
    background: var(--tt-primary, #fd5c02);
    border-radius: 3px;
}

/* ── Group (Category) ────────────────────────────── */
.tt-sd__group {
    border-bottom: 1px solid #f0eeec;
}
.tt-sd__group:last-child {
    border-bottom: none;
}

.tt-sd__group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tt-primary, #fd5c02);
}
.tt-sd__group-title i {
    font-size: 12px;
    width: 16px;
    text-align: center;
}

/* ── Result Item ─────────────────────────────────── */
.tt-sd__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--tt-dark, #3e3837);
    transition: background .15s;
    cursor: pointer;
}

.tt-sd__item:hover,
.tt-sd__item--active {
    background: #fff5ef;
}

/* Thumbnail */
.tt-sd__thumb {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f3f1;
}
.tt-sd__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tt-sd__thumb--icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff5ef, #ffe8d6);
}
.tt-sd__thumb--icon i {
    font-size: 18px;
    color: var(--tt-primary, #fd5c02);
}

/* Text */
.tt-sd__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tt-sd__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--tt-dark, #3e3837);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.tt-sd__meta {
    font-size: 12px;
    color: #8a8280;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.tt-sd__price {
    font-weight: 700;
    color: var(--tt-primary, #fd5c02);
}

.tt-sd__stars {
    color: #f5a623;
    font-size: 11px;
    letter-spacing: -1px;
}

.tt-sd__duration,
.tt-sd__city {
    color: #8a8280;
}

/* ── Empty / Loading ─────────────────────────────── */
.tt-sd__empty,
.tt-sd__loading {
    padding: 24px 16px;
    text-align: center;
    color: #8a8280;
    font-size: 14px;
}
.tt-sd__empty i,
.tt-sd__loading i {
    margin-right: 8px;
    color: var(--tt-primary, #fd5c02);
}

.tt-sd__loading {
    padding: 16px;
}

/* ── Mobile Responsive ───────────────────────────── */
@media (max-width: 768px) {
    .tt-sd {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        max-height: 60vh;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -8px 40px rgba(0,0,0,0.2);
        z-index: 500;
    }

    .tt-sd--open {
        transform: translateY(0);
    }

    .tt-sd__item {
        padding: 12px 16px;
    }

    .tt-sd__thumb {
        width: 44px;
        height: 44px;
    }

    .tt-sd__group-title {
        padding: 12px 16px 8px;
        font-size: 12px;
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 1;
    }
}

/* ── Position context for Elementor widget ────────── */
.tt-ew-search__field--destination {
    position: relative;
}
