/* ============================================================
   Searchable Select — jQuery plugin styles
   Bootstrap 3 compatible, Turkish character aware
   ============================================================ */

/* ---- Wrapper ---- */
.ss-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

/* ---- Trigger button (replaces the native <select> visually) ---- */
.ss-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
    text-align: left;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0 15px;
    font-weight: 600;
    font-size: 14px;
    color: #334155;
    transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
    white-space: nowrap;
    overflow: hidden;
    line-height: 1.4;
    min-height: 34px; /* Bootstrap 3 default */
}

.ss-trigger:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background: #fff;
}

.ss-wrapper.ss-open .ss-trigger {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Disabled state */
.ss-wrapper.ss-disabled .ss-trigger {
    background: #e2e8f0;
    cursor: not-allowed;
    opacity: 0.75;
    border-color: #cbd5e1;
}

.ss-value-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ss-placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.ss-arrow {
    flex-shrink: 0;
    margin-left: 8px;
    color: #94a3b8;
    font-size: 11px;
    transition: transform 0.2s;
    line-height: 1;
}

.ss-wrapper.ss-open .ss-arrow {
    transform: rotate(180deg);
}

/* ---- Dropdown panel ---- */
.ss-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14);
    /* High enough to clear .inq-box-wrapper (z-index:10) and hero overlay (z-index:1-2) */
    z-index: 9999;
    display: none;
    overflow: hidden;
    min-width: 100%;
}

.ss-dropdown.ss-open {
    display: block;
}

/* ---- Search input inside dropdown ---- */
.ss-search-wrap {
    padding: 8px;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}

.ss-search {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #334155;
    outline: none;
    background: #fff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.ss-search:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

/* ---- Options list ---- */
.ss-options {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    max-height: 240px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.ss-option {
    padding: 9px 15px;
    cursor: pointer;
    font-size: 14px;
    color: #334155;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ss-option:hover,
.ss-option.ss-focused {
    background: #eff6ff;
    color: #2563eb;
}

.ss-option.ss-selected {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
}

.ss-option.ss-selected:hover,
.ss-option.ss-selected.ss-focused {
    background: #bfdbfe;
}

.ss-no-results {
    padding: 10px 15px;
    color: #94a3b8;
    font-size: 13px;
    text-align: center;
    list-style: none;
    font-style: italic;
}

/* ---- Mobile overlay (backdrop) ---- */
.ss-mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 9998;
    -webkit-tap-highlight-color: transparent;
}

/* ---- Mobile bottom sheet ---- */
@media (max-width: 767px) {
    .ss-dropdown.ss-open {
        position: fixed;
        bottom: 0;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        width: 100% !important;
        border-radius: 18px 18px 0 0;
        z-index: 9999;
        max-height: 72vh;
        display: flex;
        flex-direction: column;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.22);
    }

    /* Handle bar indicator */
    .ss-dropdown.ss-open::before {
        content: '';
        display: block;
        width: 40px;
        height: 4px;
        background: #cbd5e1;
        border-radius: 2px;
        margin: 10px auto 6px;
        flex-shrink: 0;
    }

    .ss-search-wrap {
        flex-shrink: 0;
    }

    /* 16px keeps iOS Safari from zooming the page when the search box gets focus. */
    .ss-search {
        font-size: 16px;
    }

    .ss-options {
        flex: 1;
        max-height: none;
        overscroll-behavior: contain;
        padding-bottom: env(safe-area-inset-bottom, 8px);
    }

    .ss-option {
        padding: 13px 18px;
        font-size: 15px;
        min-height: 44px; /* Touch target */
        display: flex;
        align-items: center;
    }
}

/* ---- Scrollbar styling ---- */
.ss-options::-webkit-scrollbar {
    width: 5px;
}
.ss-options::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.ss-options::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
.ss-options::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
