/* ── Global Search — expanding input ─────────────────── */
.gs-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: auto;
}

.gs-inner {
    position: relative;
    display: flex;
    align-items: center;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 4px 10px 4px 30px;
    width: 34px;
    height: 28px;
    transition: width 0.28s cubic-bezier(0.4,0,0.2,1), background 0.18s, border-color 0.18s, box-shadow 0.18s;
    cursor: text;
}

.gs-inner::before {
    content: '\f002';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
    font-size: 12px;
    pointer-events: none;
}

.gs-wrap.gs-expanded .gs-inner,
.gs-inner:focus-within {
    width: 280px;
    background: #fff;
    border-color: #e8620a;
    box-shadow: 0 0 0 3px rgba(232, 98, 10, 0.1);
}

.gs-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: #1f2937;
    width: 0;
    min-width: 0;
    opacity: 0;
    transition: opacity 0.2s, width 0.28s;
    pointer-events: none;
}

.gs-wrap.gs-expanded .gs-input,
.gs-inner:focus-within .gs-input {
    width: 100%;
    opacity: 1;
    pointer-events: auto;
}

.gs-input::placeholder {
    color: #9ca3af;
}

/* Results dropdown */
.gs-results {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 320px;
    max-width: 90vw;
    max-height: 420px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.06);
    z-index: 3000;
    padding: 6px 0;
}

.gs-group-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    padding: 8px 14px 4px;
}

.gs-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.12s;
}

.gs-result:hover {
    background: #fff8f5;
}

.gs-result-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
    border-radius: 50%;
    font-size: 12px;
}

.gs-result-body {
    flex: 1;
    min-width: 0;
}

.gs-result-label {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gs-result-sub {
    font-size: 11px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.gs-empty {
    padding: 16px;
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
}

/* Desktop 3rd menu: make search sit on the right */
.secondary-menu-list {
    overflow: visible !important;
    height: auto !important;
}
.secondary-menu-list .gs-wrap {
    margin-left: auto;
    padding: 2px 8px;
}
.secondary-menu-list .gs-inner {
    background: transparent;
    border-color: transparent;
}
.secondary-menu-list .gs-wrap.gs-expanded .gs-inner,
.secondary-menu-list .gs-inner:focus-within {
    background: #fff;
    border-color: #e8620a;
}

/* Mobile — full-width search inside burger menu */
@media (max-width: 768px) {
    .gs-wrap.gs-mobile {
        display: flex !important;
        flex-direction: column;
        width: 100%;
        margin: 0;
        padding: 12px 16px;
        border-bottom: 1px solid #f3f4f6;
        position: relative;
        z-index: 1005;
    }
    .gs-wrap.gs-mobile .gs-inner {
        width: 100% !important;
        height: 40px;
        background: #fff;
        border: 1px solid #d1d5db;
        border-radius: 6px;
        padding: 6px 12px 6px 36px;
    }
    .gs-wrap.gs-mobile .gs-inner::before {
        left: 12px;
    }
    .gs-wrap.gs-mobile .gs-input {
        font-size: 14px;
    }
    .gs-wrap.gs-mobile .gs-results {
        position: static;
        width: 100%;
        max-width: 100%;
        box-shadow: none;
        border: none;
        border-top: 1px solid #f3f4f6;
        border-radius: 0;
        margin-top: 0;
        max-height: 60vh;
    }
    /* hide desktop search on mobile */
    .gs-wrap.gs-desktop { display: none !important; }
}

@media (min-width: 769px) {
    .gs-wrap.gs-mobile { display: none !important; }
}
