/* ============================================================================
   home-search-v2.css - header search redesign (all masters, all devices)
   Loaded with js/home-search-v2.js. Everything is scoped to .srch2-on, which
   the script puts on <html>, so nothing here applies when it has not run.

   What is re-skinned (markup and server logic untouched):
     department button in the existing grey box (box, Go, country and
     supplier dropdowns keep their original styling)
     .srch2-dep-panel -> tile grid (desktop) / bottom sheet (phone)
     #results         -> two-column suggestion card (desktop), stacked (phone)
     phone            -> html.srch2-fs: the search takes the whole screen
   Fonts / colours are the site's own: Open Sans, teal #277487, orange #f78d1f,
   blue #3b6bb4, ink #292929, hairline #e4e9ef.
   ========================================================================== */

/* ---- 1. department button in the existing grey box ------------------------
   The keyword box, the Go button and the country / supplier dropdowns keep
   their original styling. */
.srch2-on .searchArea .dropBarLeft {
    background: #f3f4f6;
    padding: 0;
    border-right: 1px solid #d9dee4;
}

    .srch2-on .searchArea .dropBarLeft select#ctl00_dropSearch,
    .srch2-on .searchArea .dropBarLeft #width_tmp_select {
        /* keep the select in the DOM (value / postback / onchange) but out of sight */
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        opacity: 0;
        pointer-events: none;
        overflow: hidden;
    }

/* keyword box: only the lane for the spinner / clear button (looks as before) */
.srch2-on .searchArea .searchTypefield .textInput {
    box-sizing: border-box;
    padding-right: 32px !important;
    background-position: right 6px center !important;
    background-size: 20px 20px !important;
}

.srch2-on .searchTypefield input[type="search"]::-webkit-search-cancel-button,
.srch2-on .searchTypefield input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.srch2-dep {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 8px 0 10px;
    border: 0;
    background: transparent;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #292929;
    cursor: pointer;
    white-space: nowrap;
    outline: 0;
}

    .srch2-dep:hover,
    .srch2-dep[aria-expanded="true"] {
        color: #277487;
    }

    .srch2-dep .srch2-ico {
        width: 15px;
        height: 15px;
        color: #277487;
        flex: none;
    }

    .srch2-dep .srch2-dep-txt {
        max-width: 130px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .srch2-dep .srch2-chev {
        width: 10px;
        height: 10px;
        color: #7a8590;
        transition: transform .15s;
        flex: none;
    }

    .srch2-dep[aria-expanded="true"] .srch2-chev {
        transform: rotate(180deg);
    }

/* clear button in the box */
.srch2-clear {
    display: none;
    position: absolute;
    right: 5px;
    top: 50%;
    width: 22px;
    height: 22px;
    margin-top: -11px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #e4e9ef;
    color: #5f6b76;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 2;
    outline: 0;
}

    .srch2-clear svg {
        width: 12px;
        height: 12px;
    }

    .srch2-clear:hover {
        background: #277487;
        color: #fff;
    }

.srch2-on .searchTypefield.srch2-has-text .srch2-clear {
    display: flex;
}

/* ---- 3. department panel: tiles (desktop) -------------------------------- */
.srch2-dep-panel {
    display: none;
    position: absolute;
    left: 0;
    top: 34px;
    z-index: 10000;
    width: 560px;
    max-width: calc(100vw - 20px);
    padding: 8px 10px 12px;
    background: #fff;
    border: 1px solid #e4e9ef;
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(31, 60, 110, .16);
    box-sizing: border-box;
    animation: srch2-in .12s ease-out;
}

    .srch2-dep-panel.open {
        display: block;
    }

.srch2-dep-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 6px 8px;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: #8a939c;
}

    .srch2-dep-head .srch2-dep-close {
        display: none;
        border: 0;
        background: #e4e9ef;
        color: #5f6b76;
        width: 26px;
        height: 26px;
        border-radius: 50%;
        cursor: pointer;
        align-items: center;
        justify-content: center;
    }

        .srch2-dep-head .srch2-dep-close svg {
            width: 13px;
            height: 13px;
        }

.srch2-dep-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.srch2-dep-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 13px 6px 11px;
    border: 0;
    border-radius: 10px;
    background: #f7f9fb;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 12px;
    line-height: 1.25;
    color: #292929;
    text-align: center;
    cursor: pointer;
    outline: 0;
    width: 100%;
    transition: background .12s;
}

    .srch2-dep-item .srch2-ico {
        width: 22px;
        height: 22px;
        color: #277487;
        flex: none;
    }

    .srch2-dep-item:hover,
    .srch2-dep-item:focus,
    .srch2-dep-item.active {
        background: #e9f0f8;
    }

    .srch2-dep-item.current {
        background: #e9f0f8;
        color: #3b6bb4;
        font-weight: 600;
    }

        .srch2-dep-item.current .srch2-ico {
            color: #3b6bb4;
        }

/* overlay behind the phone sheet */
.srch2-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 34, 50, .45);
    z-index: 119990;
}

/* ---- 4. suggestion card ---------------------------------------------------- */
.srch2-on #results {
    background: #fff;
    border: 1px solid #e4e9ef;
    border-radius: 14px;
    box-shadow: 0 14px 36px rgba(31, 60, 110, .16);
    padding: 0;
    overflow: hidden;
    top: 6px;
    animation: srch2-in .12s ease-out;
}

    .srch2-on #results:empty {
        display: none;
    }

    .srch2-on #results > table {
        display: none; /* the original list; kept for the links it holds */
    }

.srch2-sugg {
    font-family: 'Open Sans', Arial, sans-serif;
    display: grid;
    grid-template-columns: 3fr 2fr;
    max-height: 70vh;
    overflow-y: auto;
}

    .srch2-sugg.srch2-one-col {
        grid-template-columns: 1fr;
    }

.srch2-col {
    padding: 4px 0 8px;
    min-width: 0;
}

    .srch2-col + .srch2-col {
        border-left: 1px solid #eef1f4;
    }

.srch2-grp {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: #8a939c;
}

    .srch2-row + .srch2-grp {
        border-top: 1px solid #eef1f4;
        margin-top: 4px;
    }

.srch2-more {
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: #3b6bb4;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
}

    .srch2-more:hover {
        text-decoration: underline;
    }

.srch2-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px;
    font-size: 13px;
    color: #292929;
    cursor: pointer;
}

    .srch2-row.srch2-hidden {
        display: none;
    }

    .srch2-row:hover,
    .srch2-row.active {
        background: #f3f6f9;
    }

    .srch2-row .srch2-ico {
        width: 18px;
        height: 18px;
        color: #9aa5af;
        flex: none;
    }

    .srch2-row:hover .srch2-ico,
    .srch2-row.active .srch2-ico {
        color: #277487;
    }

    /* the anchor is the original one from the table (href, text, highlight) */
    .srch2-row a.AutoList {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 1px;
        font-size: 13px;
        color: #292929;
        text-decoration: none;
    }

        .srch2-row a.AutoList:hover {
            text-decoration: none;
        }

        .srch2-row a.AutoList .srch2-txt {
            min-width: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            line-height: 1.35;
        }

        .srch2-row a.AutoList span {
            color: inherit; /* overrides the old orange on every span */
        }

        .srch2-row a.AutoList span.srch2-hl {
            color: #277487;
            font-weight: 700;
        }

        .srch2-row a.AutoList .srch2-in {
            font-size: 11px;
            color: #8a939c;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

            .srch2-row a.AutoList .srch2-in span {
                color: #3b6bb4;
            }

/* footer: search everything + key hint */
.srch2-foot {
    grid-column: 1 / -1;
    border-top: 1px solid #eef1f4;
}

    .srch2-foot .srch2-all {
        color: #3b6bb4;
        font-weight: 600;
    }

        .srch2-foot .srch2-all .srch2-ico,
        .srch2-foot .srch2-all:hover .srch2-ico {
            color: #3b6bb4;
        }

        .srch2-foot .srch2-all .srch2-txt {
            flex: 1;
        }

        .srch2-foot .srch2-all .srch2-arrow {
            width: 14px;
            height: 14px;
            color: #3b6bb4;
            flex: none;
        }

.srch2-empty {
    grid-column: 1 / -1;
    padding: 16px;
    font-size: 13px;
    color: #5f6b76;
}

    .srch2-empty b {
        font-weight: 600;
        color: #292929;
    }

/* recent searches (shown when the box is focused and empty) */
.srch2-recent .srch2-row .srch2-txt {
    flex: 1;
}

.srch2-recent .srch2-forget {
    border: 0;
    background: transparent;
    color: #9aa5af;
    width: 20px;
    height: 20px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

    .srch2-recent .srch2-forget:hover {
        background: #e4e9ef;
        color: #292929;
    }

    .srch2-recent .srch2-forget svg {
        width: 11px;
        height: 11px;
    }

@keyframes srch2-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: none; }
}

/* ---- 5. phone (and the department chips row used in full-screen mode) ---- */
.srch2-back,
.srch2-chips {
    display: none;
}

@media (max-width: 767px) {
    /* department panel -> bottom sheet */
    .srch2-dep-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        width: auto;
        max-width: none;
        max-height: 72vh;
        overflow-y: auto;
        border-radius: 16px 16px 0 0;
        padding: 6px 10px 18px;
        z-index: 120001;
        animation: srch2-up .18s ease-out;
    }

        .srch2-dep-panel:before {
            content: "";
            display: block;
            width: 36px;
            height: 4px;
            border-radius: 2px;
            background: #d9dee4;
            margin: 4px auto 10px;
        }

    .srch2-dep-head .srch2-dep-close {
        display: flex;
    }

    .srch2-dep-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .srch2-dep-open .srch2-overlay {
        display: block;
    }

    /* suggestions: one column, name on two lines, category under it */
    .srch2-sugg {
        grid-template-columns: 1fr;
    }

    .srch2-col + .srch2-col {
        border-left: 0;
        border-top: 1px solid #eef1f4;
    }

    .srch2-row {
        align-items: flex-start;
    }

        .srch2-row .srch2-ico {
            margin-top: 2px;
        }

        .srch2-row a.AutoList .srch2-txt {
            white-space: normal;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

    .srch2-foot .srch2-all {
        align-items: center;
    }

    /* ---- full-screen search (html.srch2-fs, set on focus) ---- */
    .srch2-fs body {
        overflow: hidden;
    }

    .srch2-fs .wordsearchSec {
        position: fixed;
        inset: 0;
        z-index: 120000;
        width: auto !important;
        height: auto;
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: #fff;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .srch2-fs .searchArea {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px 0;
        height: auto;
        padding: 10px 12px 12px;
    }

        .srch2-fs .searchArea .srch2-back {
            display: flex;
            order: 0;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 36px;
            border: 0;
            background: transparent;
            color: #292929;
            cursor: pointer;
            margin-right: 2px;
        }

            .srch2-fs .searchArea .srch2-back svg {
                width: 20px;
                height: 20px;
            }

        .srch2-fs .searchArea .dropBarLeft {
            display: none;              /* the chips row takes over */
        }

        .srch2-fs .searchArea .contFillSec {
            order: 1;
            flex: 1;
            float: none;
            border: 1px solid #c3c3c3;
            border-right: 0;
        }

        .srch2-fs .searchArea .buttSecright {
            order: 2;
            float: none;
        }

        .srch2-fs .searchArea .srch2-chips {
            display: flex;
            order: 3;
            width: 100%;
            gap: 6px;
            overflow-x: auto;
            padding: 2px 0 6px;
            scrollbar-width: none;
        }

            .srch2-fs .searchArea .srch2-chips::-webkit-scrollbar {
                display: none;
            }

        .srch2-fs .searchArea #results {
            order: 4;
            width: 100%;
            position: static;
            border: 0;
            border-radius: 0;
            box-shadow: none;
            animation: none;
        }

    .srch2-fs .srch2-sugg {
        max-height: none;
        overflow: visible;
    }

    .srch2-fs .srch2-row,
    .srch2-fs .srch2-grp,
    .srch2-fs .srch2-empty {
        padding-left: 4px;
        padding-right: 4px;
    }
}

/* department chips (full-screen phone search) */
.srch2-chip {
    flex: none;
    display: flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 11px;
    border: 1px solid #d9dee4;
    border-radius: 15px;
    background: #fff;
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 12px;
    color: #292929;
    white-space: nowrap;
    cursor: pointer;
    outline: 0;
}

    .srch2-chip .srch2-ico {
        width: 14px;
        height: 14px;
        color: #277487;
    }

    .srch2-chip.current {
        background: #e9f0f8;
        border-color: #b5d4f4;
        color: #3b6bb4;
        font-weight: 600;
    }

        .srch2-chip.current .srch2-ico {
            color: #3b6bb4;
        }

@keyframes srch2-up {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: none; opacity: 1; }
}
