/* OpenSearch autocomplete dropdown */
.opensearch-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    min-width: 260px;
    max-height: 480px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    text-align: left;
}
.opensearch-section-title {
    padding: 8px 12px 4px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    color: #999;
    border-bottom: 1px solid #eee;
}
ul.opensearch-section {
    margin: 0;
    padding: 0;
    list-style: none;
}
.opensearch-item a {
    display: block;
    padding: 7px 12px;
    color: #333;
    text-decoration: none;
    overflow: hidden;
}
.opensearch-item-selected a,
.opensearch-item a:hover {
    background: #f5f5f5;
}
.opensearch-item-image {
    float: left;
    width: 40px;
    height: auto;
    margin-right: 10px;
}
.opensearch-item-info {
    display: block;
    overflow: hidden;
}
.opensearch-item-name {
    display: block;
    line-height: 1.3;
}
.opensearch-item-sku {
    display: block;
    font-size: 11px;
    color: #999;
}
.opensearch-item-price {
    display: block;
    font-weight: bold;
    color: #444;
}
a.opensearch-all {
    display: block;
    padding: 8px 12px;
    text-align: center;
    font-size: 12px;
    border-top: 1px solid #eee;
    text-decoration: none;
}
.opensearch-didyoumean {
    margin: 10px 0;
}
.opensearch-highlight {
    background: #ffff00;
}

/* ---------------------------------------------------------------------- *
 *  Mobile full-screen search overlay (markup injected by autocomplete.js;
 *  desktop dropdown styles above are untouched)
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
    /* 16px stops mobile browsers from zooming if the header input ever
       receives focus before the overlay takes over */
    #search_mini_form .input-text {
        font-size: 16px;
    }
}
.opensearch-mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    /* above every theme element, incl. sticky header and the fixed bottom
       navigation bar on the homepage */
    z-index: 2147483000;
    text-align: left;
}
.opensearch-mobile-overlay.opensearch-mobile-open {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
}
.opensearch-mobile-form {
    display: -webkit-flex;
    display: flex;
    -webkit-align-items: center;
    align-items: center;
    margin: 0;
    padding: 8px;
    border-bottom: 1px solid #eee;
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
}
.opensearch-mobile-back,
.opensearch-mobile-submit {
    -webkit-flex: 0 0 auto;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: #333;
    font-size: 22px;
    line-height: 44px;
    text-align: center;
    cursor: pointer;
}
.opensearch-mobile-inputwrap {
    position: relative;
    -webkit-flex: 1 1 auto;
    flex: 1 1 auto;
    min-width: 0;
}
.opensearch-mobile-input {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    width: 100%;
    height: 44px;
    padding: 0 44px 0 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f7f7f7;
    font-size: 16px; /* >= 16px: prevents mobile browser zoom on focus */
    color: #333;
}
.opensearch-mobile-input:focus {
    outline: none;
    border-color: #999;
    background: #fff;
}
.opensearch-mobile-input::-webkit-search-cancel-button,
.opensearch-mobile-input::-webkit-search-decoration {
    -webkit-appearance: none;
    display: none;
}
.opensearch-mobile-clear {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: #999;
    font-size: 22px;
    line-height: 44px;
    text-align: center;
    cursor: pointer;
}
.opensearch-mobile-body {
    -webkit-flex: 1 1 auto;
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
    padding-bottom: 24px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.opensearch-mobile-title {
    margin: 4px 0 10px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    color: #999;
}
.opensearch-mobile-title + .opensearch-chips + .opensearch-mobile-title {
    margin-top: 20px;
}
/* keyword chips */
.opensearch-chips {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
}
.opensearch-chip {
    box-sizing: border-box;
    max-width: 100%;
    overflow: hidden;
    margin: 0 8px 8px 0;
    padding: 0 14px;
    min-height: 36px;
    line-height: 34px;
    border: 1px solid #ddd;
    border-radius: 18px;
    background: #f7f7f7;
    color: #333;
    font-size: 14px;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
}
.opensearch-chip:active {
    background: #eee;
}
/* popular product cards, 2 columns */
.opensearch-mobile-products {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    margin: 0 -4px;
}
.opensearch-mobile-card {
    display: block;
    box-sizing: border-box;
    width: 50%;
    padding: 4px;
    color: #333;
    text-decoration: none;
}
.opensearch-mobile-card-image {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    background: #fafafa;
}
.opensearch-mobile-card-name {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
}
.opensearch-mobile-card-price {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    font-weight: bold;
    color: #444;
}
/* typed-state result list reuses the .opensearch-item markup */
.opensearch-mobile-results .opensearch-section-title {
    border-bottom: 0;
    padding: 12px 0 4px;
}
.opensearch-mobile-results .opensearch-item a {
    padding: 11px 4px;
    border-bottom: 1px solid #f2f2f2;
}
.opensearch-mobile-results .opensearch-item-image {
    width: 48px;
}
.opensearch-mobile-results a.opensearch-all {
    padding: 14px 12px;
    font-size: 14px;
    color: #333;
}
.opensearch-mobile-none {
    padding: 32px 12px;
    text-align: center;
    color: #999;
    font-size: 14px;
}
/* loading placeholders for the empty state */
.opensearch-skeleton {
    background: #f0f0f0;
    -webkit-animation: opensearch-pulse 1.2s ease-in-out infinite;
    animation: opensearch-pulse 1.2s ease-in-out infinite;
}
.opensearch-chip.opensearch-skeleton {
    width: 84px;
    border-color: #f0f0f0;
}
.opensearch-skeleton-card {
    cursor: default;
}
.opensearch-skeleton-block {
    display: block;
    width: 100%;
    height: 120px;
    border-radius: 4px;
}
@-webkit-keyframes opensearch-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}
@keyframes opensearch-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}
