/* ═══════════════════════════════════════════════════════════════
   CUSTOM SELECT — Toner Group branded dropdown
   Replaces bootstrap-select / select2 entirely.
   ═══════════════════════════════════════════════════════════════ */

/* ── Wrapper ─────────────────────────────────────────────────── */
.ttg-select-wrap {
    position: relative;
    width: 100%;
    font-family: inherit;
    user-select: none;
}

/* ── Trigger button ──────────────────────────────────────────── */
.ttg-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    background: #fafafa;
    font-size: 13.5px;
    color: #666;
    cursor: pointer;
    transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
    box-sizing: border-box;
    text-align: left;
    line-height: 1.4;
    min-height: 44px;
}

.ttg-select-trigger:focus {
    outline: none;
    border-color: #ea1b25;
    box-shadow: 0 0 0 3px rgba(234, 27, 37, 0.10);
}

.ttg-select-trigger.ttg-open {
    border-color: #ea1b25;
    box-shadow: 0 0 0 3px rgba(234, 27, 37, 0.10);
    background: #fff;
    border-radius: 10px 10px 0 0;
}

.ttg-select-trigger.ttg-has-value {
    color: #222;
    background: #fff;
}

.ttg-select-trigger.ttg-disabled {
    background: #f5f5f5;
    color: #bbb;
    cursor: not-allowed;
    border-color: #e5e5e5;
    pointer-events: none;
}

/* ── Trigger text & arrow ────────────────────────────────────── */
.ttg-trigger-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ttg-trigger-arrow {
    flex-shrink: 0;
    margin-left: 10px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    transition: transform 0.22s ease, color 0.18s;
}

.ttg-select-trigger.ttg-open .ttg-trigger-arrow {
    transform: rotate(180deg);
    color: #ea1b25;
}

/* ── Dropdown panel ──────────────────────────────────────────── */
.ttg-select-dropdown {
    position: absolute;
    top: calc(100% - 1.5px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1.5px solid #ea1b25;
    border-top: 3px solid #ea1b25;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    z-index: 99999;
    overflow: hidden;
    display: none;
    flex-direction: column;
    max-height: 280px;
}

.ttg-select-dropdown.ttg-drop-open {
    display: flex;
    animation: ttgDropIn 0.16s ease;
}

@keyframes ttgDropIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Search box ──────────────────────────────────────────────── */
.ttg-select-search-wrap {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.ttg-select-search {
    width: 100%;
    padding: 7px 10px 7px 32px;
    border: 1.5px solid #e0e0e0;
    border-radius: 6px;
    font-size: 12.5px;
    color: #333;
    background: #fafafa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23aaa' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 10px center;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.ttg-select-search:focus {
    outline: none;
    border-color: #ea1b25;
    background-color: #fff;
}

.ttg-select-search::placeholder {
    color: #bbb;
}

/* ── Options list ────────────────────────────────────────────── */
.ttg-select-list {
    overflow-y: auto;
    flex: 1;
    padding: 4px 0;
}

.ttg-select-list::-webkit-scrollbar {
    width: 5px;
}
.ttg-select-list::-webkit-scrollbar-track { background: #f8f8f8; }
.ttg-select-list::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 4px; }
.ttg-select-list::-webkit-scrollbar-thumb:hover { background: #ea1b25; }

/* ── Option item ─────────────────────────────────────────────── */
.ttg-select-option {
    padding: 9px 14px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    display: flex;
    align-items: center;
    gap: 7px;
    border-bottom: 0.5px solid #80808024;
}

.ttg-select-option:hover {
    background: #fff5f5;
    color: #ea1b25;
}

.ttg-select-option.ttg-selected {
    background: #fff0f0;
    color: #ea1b25;
    font-weight: 600;
}

.ttg-select-option.ttg-selected::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #ea1b25;
    border-radius: 50%;
    flex-shrink: 0;
}

.ttg-select-option:not(.ttg-selected)::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    flex-shrink: 0;
}

/* ── No results / Loading ────────────────────────────────────── */
.ttg-select-empty {
    padding: 14px;
    text-align: center;
    font-size: 12.5px;
    color: #aaa;
    font-style: italic;
}

.ttg-select-loading {
    padding: 14px;
    text-align: center;
    font-size: 12.5px;
    color: #aaa;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.ttg-loading-dot {
    width: 6px;
    height: 6px;
    background: #ea1b25;
    border-radius: 50%;
    animation: ttgPulse 1s ease infinite;
}
.ttg-loading-dot:nth-child(2) { animation-delay: 0.2s; }
.ttg-loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes ttgPulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ── Index page specific sizing ──────────────────────────────── */
.dropdown-group .ttg-select-trigger {
    font-size: 14px;
    padding: 11px 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
}

.dropdown-group .ttg-select-trigger.ttg-open {
    border-color: #ea1b25;
}

.dropdown-group .ttg-select-dropdown {
    border: 2px solid #ea1b25;
    border-top: 3px solid #ea1b25;
}

/* ── Finder modal specific overrides ─────────────────────────── */
.finder-field-group .ttg-select-trigger {
    border-radius: 10px;
    font-size: 13.5px;
}

.finder-field-group .ttg-select-trigger.ttg-open {
    border-radius: 10px 10px 0 0;
}

.finder-field-group .ttg-select-dropdown {
    border-radius: 0 0 10px 10px;
}
