
/* =========================================================
   GR ELECTRICAL - LIVE SEARCH
========================================================= */

.gr-live-search {
    position: relative;
    width: 100%;
    max-width: 480px;
    font-family: inherit;
    z-index: 100;
}

.gr-live-search *,
.gr-live-search *::before,
.gr-live-search *::after {
    box-sizing: border-box;
}

.gr-live-search-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* SEARCH FORM */

.gr-live-search-form {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    margin: 0;
    background: #fff;
    border: 1px solid #e3e7ed;
    border-radius: 6px;
    transition: border-color .2s, box-shadow .2s;
}

.gr-live-search-form:focus-within {
    border-color: #0070b9;
    box-shadow: 0 0 0 3px rgba(0,112,185,.1);
}

.gr-live-search-input,
.gr-live-search input[type="search"] {
    flex: 1;
    min-width: 0;
    width: 100%;
    height: 46px;
    margin: 0;
    padding: 0 14px !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #202633;
    font-family: inherit;
    font-size: 14px;
    border-radius: 6px;
}

.gr-live-search-input::placeholder {
    color: #89919c;
}

.gr-live-search-submit {
    display: flex;
    flex: 0 0 46px;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 0 5px 5px 0;
    background: transparent;
    color: #0070b9;
    cursor: pointer;
    transition: background .2s;
}

.gr-live-search-submit:hover,
.gr-live-search-submit:focus {
    background: #eef6fc;
    color: #005c99;
}

/* =========================================================
   DROPDOWN
========================================================= */

.gr-live-search-dropdown {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    width: 100%;
    min-width: min(350px, 90vw);
    max-height: 420px;
    overflow-y: auto;
    padding: 7px 0;
    background: #fff;
    border: 1px solid #e6eaf0;
    border-radius: 7px;
    box-shadow: 0 12px 35px rgba(0,0,0,.13);
    z-index: 99999;
}

.gr-live-search-dropdown[hidden] {
    display: none !important;
}

/* PRODUCT ITEM */

.gr-live-search-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 11px 15px;
    color: #222;
    text-decoration: none !important;
    border-bottom: 1px solid #f0f0f0;
    transition: background .2s;
}

.gr-live-search-item:hover,
.gr-live-search-item:focus {
    background: #f1f7fc;
}

.gr-live-search-image {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    object-fit: contain;
    background: #f7f8fa;
    border-radius: 4px;
}

.gr-live-search-image-empty {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    background: #f7f8fa;
    border-radius: 4px;
}

.gr-live-search-details {
    flex: 1;
    min-width: 0;
}

.gr-live-search-title {
    display: block;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    color: #202633;
}

.gr-live-search-sku {
    display: block;
    margin-top: 5px;
    color: #818b99;
    font-size: 11px;
}

.gr-live-search-arrow {
    color: #0070b9;
    font-size: 19px;
}

/* STATES */

.gr-live-search-message {
    padding: 17px;
    font-size: 13px;
    text-align: center;
    color: #777;
}

.gr-live-search-all {
    display: block;
    padding: 14px;
    background: #f6f9fc;
    color: #006cb7 !important;
    text-align: center;
    text-decoration: none !important;
    font-size: 13px;
    font-weight: 700;
}

.gr-live-search-all:hover {
    background: #eaf4fc;
}

/* RESPONSIVE */

@media (max-width: 767px) {

    .gr-live-search {
        max-width: 100%;
    }

    .gr-live-search-input {
        font-size: 16px !important;
    }

    .gr-live-search-dropdown {
        min-width: 0;
        max-height: 65vh;
    }

}


/* =========================================================
   HEADER ICON-ONLY EXPANDABLE SEARCH
========================================================= */

.gr-header-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SEARCH ICON */

.gr-header-search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    background: transparent !important;
    border: 0 !important;
    color: #ffffff !important;
    cursor: pointer;
    transition: opacity .2s ease;
}

.gr-header-search-toggle:hover {
    opacity: .7;
}

.gr-header-search-toggle svg {
    width: 23px;
    height: 23px;
}

/* SEARCH PANEL */

.gr-header-search-panel {
    display: none;
    position: absolute;
    top: calc(100% + 17px);
    right: 0;
    width: 380px;
    max-width: calc(100vw - 30px);
    padding: 12px;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: 0 10px 35px rgba(0,0,0,.16);
    z-index: 99999;
}

.gr-header-search-panel.gr-search-open {
    display: block;
}

/* PANEL SEARCH FIELD */

.gr-header-search-panel .gr-live-search-form {
    width: 100%;
    border: 1px solid #e1e5eb;
}

.gr-header-search-panel .gr-live-search-input {
    height: 46px !important;
    font-size: 14px !important;
}

.gr-header-search-panel .gr-live-search-submit {
    height: 46px;
}

/* SUGGESTIONS */

.gr-header-search-panel .gr-live-search-dropdown {
    left: 0;
    right: 0;
    min-width: 0;
    width: 100%;
}

/* MOBILE */

@media (max-width: 767px) {

    .gr-header-search-panel {
        width: min(350px, calc(100vw - 30px));
        right: -10px;
    }

    .gr-header-search-toggle {
        width: 40px;
        height: 40px;
    }

}
