/*
 * Site search panel (DEV-58). Behaviour follows apple.com's search; the look is ilikevents.
 * Only logical properties (inline-start/end), so RTL and LTR mirror from the page dir.
 */

/* Triggers: header pill (desktop), header icon (mobile), homepage hero box */
.ils-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #dfe3e6;
    background: #f7f9fa;
    color: #6b7680;
    border-radius: 999px;
    height: 36px;
    margin-top: 6px;
    padding: 0 16px;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .15s, background-color .15s, color .15s;
    -webkit-tap-highlight-color: transparent;
}
.ils-trigger .fa { font-size: 16px; color: #2F3A44; }
.ils-trigger:hover, .ils-trigger:focus-visible { border-color: #8DC63F; background: #fff; color: #2F3A44; }
.ils-trigger:focus-visible { outline: 2px solid #8DC63F; outline-offset: 2px; }
.wsmenu-list > li.ils-menu-item { padding: 0 8px; }
.ils-trigger-mobile {
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    justify-content: center;
    border: 0;
    background: transparent;
}
.ils-trigger-mobile .fa { font-size: 20px; }
.base-search .ils-trigger-mobile { margin-top: 4px; }

.sercher_warper[data-ils-open], .sercher_warper[data-ils-open] input { cursor: text; }

/* Panel */
.ils {
    position: fixed;
    inset: 0;
    /* Above the header, the mobile menu and the cookie notice (#eu-cookie-notify-wrap is 9999999). */
    z-index: 10000000;
    visibility: hidden;
    pointer-events: none;
}
.ils.ils-open { visibility: visible; pointer-events: auto; }
.ils-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(47, 58, 68, .45);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity .2s ease;
}
.ils-panel {
    position: absolute;
    inset-inline: 0;
    top: 0;
    background: #fff;
    color: #2F3A44;
    border-radius: 0 0 14px 14px;
    box-shadow: 0 12px 32px rgba(47, 58, 68, .18);
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(-12px);
    transition: opacity .2s ease, transform .2s ease;
}
.ils.ils-open .ils-backdrop { opacity: 1; }
.ils.ils-open .ils-panel { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .ils-backdrop, .ils-panel { transition: none; }
}

.ils-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 18px 20px 12px;
}
.ils-form {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    margin: 0;
    background: #f7f9fa;
    border: 1px solid #dfe3e6;
    border-radius: 8px;
    transition: border-color .15s, box-shadow .15s;
}
.ils-form:focus-within { border-color: #8DC63F; box-shadow: 0 0 0 3px rgba(141, 198, 63, .2); background: #fff; }
.ils-form .ils-icon {
    flex: 0 0 auto;
    padding-inline: 14px 4px;
    font-size: 18px;
    color: #8DC63F;
}
.ils-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 48px;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none !important;
    background: transparent !important;
    margin: 0;
    padding: 0 8px;
    font: inherit;
    font-size: 18px;
    color: #2F3A44;
    text-align: start;
    -webkit-appearance: none;
    appearance: none;
}
.ils-input:focus { outline: none; }
.ils-input::-webkit-search-cancel-button, .ils-input::-webkit-search-decoration { -webkit-appearance: none; }
.ils-input::placeholder { color: #9aa3ab; }
.ils-clear {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    margin-inline-end: 4px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #9aa3ab;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}
.ils-clear:hover { color: #2F3A44; }
.ils-clear[hidden] { display: none; }
.ils-cancel {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: #2F3A44;
    font: inherit;
    font-weight: bold;
    font-size: 14px;
    padding: 10px 4px;
    cursor: pointer;
}
.ils-cancel:hover { color: #8DC63F; }

.ils-body {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
.ils-list {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 20px 18px;
}
.ils-group { padding-top: 10px; }
.ils-group + .ils-group { border-top: 1px solid #eef0f2; margin-top: 6px; }
.ils-h {
    margin: 4px 0 4px;
    padding-inline: 12px;
    font-size: 12px;
    font-weight: bold;
    line-height: 1.6;
    color: #8a949c;
    text-transform: uppercase;
    letter-spacing: .02em;
}
.ils-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 8px 12px;
    border-radius: 8px;
    border-inline-start: 3px solid transparent;
    color: #2F3A44;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.ils-item:hover, .ils-item:focus, .ils-item.ils-active {
    background: #f6fbef;
    border-inline-start-color: #8DC63F;
    color: #2F3A44;
    text-decoration: none;
}
.ils-ico {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f1f4f6;
    color: #6b7680;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}
.ils-item.ils-active .ils-ico, .ils-item:hover .ils-ico { background: #8DC63F; color: #fff; }
.ils-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ils-t {
    font-size: 15px;
    line-height: 1.45;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ils-t mark { background: rgba(141, 198, 63, .2); color: inherit; font-weight: bold; padding: 0 1px; border-radius: 3px; }
.ils-s {
    font-size: 12px;
    line-height: 1.5;
    color: #8a949c;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ils-past {
    display: inline-block;
    margin-inline-start: 6px;
    padding: 0 6px;
    border-radius: 4px;
    background: #eef0f2;
    color: #6b7680;
    font-size: 11px;
}
.ils-go { flex: 0 0 auto; color: #c3cad0; font-size: 18px; }
[dir="rtl"] .ils-go { transform: scaleX(-1); }
.ils-item.ils-active .ils-go, .ils-item:hover .ils-go { color: #8DC63F; }
.ils-all .ils-t { font-weight: bold; }
.ils-empty, .ils-error { padding: 18px 12px 6px; color: #6b7680; font-size: 14px; }
.ils-loading .ils-form .ils-icon { animation: ils-pulse 1s ease-in-out infinite; }
@keyframes ils-pulse { 50% { opacity: .35; } }

html.ils-lock, html.ils-lock body { overflow: hidden; }

/* Mobile: full screen, sticky search bar, large tap targets */
@media (max-width: 767px) {
    .ils-panel {
        bottom: 0;
        max-height: none;
        height: 100%;
        border-radius: 0;
        box-shadow: none;
        transform: translateY(16px);
    }
    .ils-bar {
        padding: 10px 12px;
        padding-top: max(10px, env(safe-area-inset-top));
        gap: 8px;
        border-bottom: 1px solid #eef0f2;
    }
    .ils-input { height: 44px; font-size: 16px; }
    .ils-body { flex: 1 1 auto; }
    .ils-list { padding: 0 8px calc(24px + env(safe-area-inset-bottom)); }
    .ils-item { min-height: 56px; }
    .ils-t { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}

/* The homepage box was hidden on phones while it ran the old dropdown; it opens this panel now. */
@media (max-width: 768px) {
    .sercher_warper[data-ils-open] { display: flex; align-items: center; width: calc(100% - 32px); max-width: 520px; margin: 0 auto; background: #fff; }
    .sercher_warper[data-ils-open] input { flex: 1 1 auto; min-width: 0; font-size: 14px; }
}
