/* IOX Search — Frontend Styles
   Preserves Whiz Cells black/red/white scheme and .whiz-* class naming. */

@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&display=swap');

/* =========================================================================
   Container
   ========================================================================= */

.whiz-contain {
    border-top: 3px solid #ff0000;
    border-bottom: 3px solid #ff0000;
    width: 100%;
    position: relative;
    -webkit-font-smoothing: antialiased;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    font-family: 'Figtree', sans-serif;
}

.whiz-contain,
.whiz-smartselect {
    min-height: fit-content !important;
}

.whiz-smartselect {
    min-height: 80px;
    position: relative;
    margin-left: auto;
    margin-right: auto;
}

/* Standalone mode (popup / embedded without borders) */
.whiz-contain.whiz-standalone {
    border: none;
    background: transparent;
}

/* =========================================================================
   Step containers (outer wrappers)
   ========================================================================= */

.whiz-outer {
    width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    padding: 40px 20px;
    padding-bottom: 20px;
    height: fit-content !important;
}

.whiz-outer.closed {
    height: 0px !important;
    padding: 0 !important;
    overflow: hidden;
}

/* Step 1: Search bar (white background) */
.whiz-outer.s1 {
    background-color: #ffffff;
    color: #111;
    padding: 56px 24px 40px;
}

/* Step 2: Results (white background) */
.whiz-outer.s2 {
    background-color: #fff;
    color: #ff0000;
    height: auto;
    padding: 40px 20px !important;
    transition: height .4s, padding .4s;
}

.whiz-outer.s2:not(.closed) {
    border-top: 1px solid #f0f0f0;
}

.whiz-outer.s2.closed {
    color: #ffffff;
    height: 0px;
    padding: 0 !important;
}

.whiz-outer.s2 .whiz-step {
    overflow: hidden;
}

/* Popular sellers section */
.whiz-outer.popular.closed {
    display: none;
}

/* =========================================================================
   Step inner
   ========================================================================= */

.whiz-step {
    position: relative;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.whiz-step-header {
    font-size: 28px;
    font-weight: 700;
    padding-bottom: 20px;
    padding-top: 20px;
    opacity: 1;
    text-align: center;
    transition: opacity .2s, padding-bottom .2s;
}

/* =========================================================================
   Header: title + subtitle
   ========================================================================= */

.whiz-search-header {
    max-width: 720px;
    margin: 0 auto;
    padding-bottom: 28px;
}

.whiz-search-title {
    margin: 0 0 10px;
    font-family: 'Figtree', sans-serif;
    font-size: clamp(30px, 4.5vw, 44px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -0.02em;
    color: #ff0000;
    text-transform: none;
}

.whiz-search-subtitle {
    margin: 0;
    font-family: 'Figtree', sans-serif;
    font-size: clamp(15px, 2vw, 18px);
    font-weight: 400;
    line-height: 1.5;
    color: #111;
    text-transform: none;
}

/* =========================================================================
   Search bar
   ========================================================================= */

.whiz-searchbar {
    position: relative;
    max-width: 680px;
    margin: 0 auto;
}

.whiz-search-icon {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #8b8f98;
    pointer-events: none;
}

.whiz-searchbar .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#iox-search-input {
    width: 100%;
    height: 56px;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-family: 'Figtree', sans-serif;
    font-size: 17px;
    font-weight: 400;
    text-transform: none;
    padding: 0 24px 0 54px;
    margin: 0;
    outline: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 8px 24px rgba(0, 0, 0, 0.07);
    transition: border-color .2s, box-shadow .2s;
    appearance: none;
    -webkit-appearance: none;
}

#iox-search-input::placeholder {
    color: #8b8f98;
    opacity: 1;
}

#iox-search-input:focus {
    border-color: #ff0000;
    box-shadow: 0 0 0 4px rgba(255, 0, 0, 0.12), 0 8px 24px rgba(0, 0, 0, 0.07);
}

/* Hide the native clear button inconsistencies on webkit */
#iox-search-input::-webkit-search-decoration {
    display: none;
}

/* =========================================================================
   Quick links (category buttons)
   ========================================================================= */

.whiz-searchtab {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 26px 0 4px;
}

/* High-specificity + !important on the box properties: the parent theme
   (Salient) applies its own global button styling that otherwise collapses
   the padding and typography of these pills. */
.whiz-contain button.whiz-searchtabs {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 12px 28px !important;
    background: #fff !important;
    background-image: none !important;
    border: 1px solid #d1d5db !important;
    border-radius: 999px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    color: #111 !important;
    font-family: 'Figtree', sans-serif !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s, box-shadow .2s, transform .15s;
}

.whiz-contain button.whiz-searchtabs:hover {
    background: #fff !important;
    border-color: #111 !important;
    color: #000 !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-1px);
}

.whiz-contain button.whiz-searchtabs:focus-visible {
    outline: 2px solid #ff0000 !important;
    outline-offset: 2px !important;
}

.whiz-contain button.whiz-searchtabs.active {
    background: #000 !important;
    border-color: #000 !important;
    color: #fff !important;
}

.whiz-contain button.whiz-searchtabs.comingsoonoption {
    opacity: .55;
    cursor: default;
    pointer-events: none;
    color: #9ca3af !important;
    box-shadow: none !important;
}

.whiz-contain span.comingsoontext {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    background: #f3f4f6;
    border-radius: 999px;
    color: #6b7280;
    padding: 3px 7px;
    line-height: 1;
}

/* =========================================================================
   Brand grid (category browse, step 1)
   ========================================================================= */

.whiz-brandgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
    padding: 4px;
}

/* Same theme-proofing as the quick links — Salient's global button CSS
   otherwise collapses the tile padding and typography. */
.whiz-contain button.whiz-brandtile {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px;
    min-height: 164px !important;
    margin: 0 !important;
    padding: 18px 16px 14px !important;
    background: #fff !important;
    background-image: none !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    color: #111 !important;
    font-family: 'Figtree', sans-serif !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .15s;
}

.whiz-contain button.whiz-brandtile:hover {
    border-color: #111 !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-2px);
}

.whiz-contain button.whiz-brandtile:focus-visible {
    outline: 2px solid #ff0000 !important;
    outline-offset: 2px !important;
}

.whiz-brandtile-logo {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.whiz-brandtile-logo img {
    max-height: 104px;
    max-width: 92%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.whiz-brandtile-name-only {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.25;
    color: #111;
    text-transform: capitalize;
}

.whiz-brandtile-count {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    line-height: 1;
}

/* =========================================================================
   Brand products toolbar (category browse, step 2)
   ========================================================================= */

.whiz-results-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 4px 0 18px;
}

.whiz-contain button.whiz-backbtn {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px;
    margin: 0 !important;
    padding: 10px 20px !important;
    background: #fff !important;
    background-image: none !important;
    border: 1px solid #d1d5db !important;
    border-radius: 999px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    color: #111 !important;
    font-family: 'Figtree', sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
}

.whiz-contain button.whiz-backbtn:hover {
    border-color: #111 !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1) !important;
}

.whiz-contain button.whiz-backbtn:focus-visible {
    outline: 2px solid #ff0000 !important;
    outline-offset: 2px !important;
}

.whiz-backbtn-arrow {
    font-size: 15px;
    line-height: 1;
}

.whiz-results-heading {
    font-size: 22px;
    font-weight: 700;
    color: #000;
    text-transform: capitalize;
    text-align: left;
}

/* =========================================================================
   Hits / Device grid
   ========================================================================= */

.whiz-phonespics {
    width: 100%;
    position: relative;
    padding-bottom: 10px;
}

/* Hide scrollbar */
.whiz-phonespics::-webkit-scrollbar {
    display: none;
}

/* Category group */
.sellcat {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    padding-bottom: 60px;
    max-height: none;
    overflow: visible;
    position: relative;
    margin-bottom: 20px;
}

.sellcat.collapsed {
    max-height: 327px;
    overflow: hidden;
}

.sellcat.collapsed .whiz-phonespic:nth-child(n+12) {
    display: none;
}

.sellcat.expanded {
    max-height: none;
}

/* Category header (anchor to the category archive) */
.sellcat-text,
a.sellcat-text {
    grid-column: 1 / -1;
    display: block;
    text-align: left;
    font-size: 22px;
    font-weight: 700;
    color: #000;
    cursor: pointer;
    padding: 10px 0;
    text-transform: capitalize;
    text-decoration: none;
}

.sellcat-text:hover,
a.sellcat-text:hover {
    color: #ff0000;
}

/* Device card (anchor) */
.whiz-phonespic,
a.whiz-phonespic {
    display: block;
    text-align: center;
    cursor: pointer;
    transition: all .3s ease;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
}

.whiz-phonespic:hover {
    background: #f5f5f5;
    transform: translateY(-2px);
}

.whiz-phonespic img {
    width: 100%;
    max-width: 180px;
    height: auto;
    margin: 0 auto;
    display: block;
}

.whiz-phonename {
    position: relative;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    color: #ff0000;
    padding-bottom: 5px;
    margin-top: -5px;
    margin-bottom: -3px;
    text-transform: capitalize;
}

.whiz-upprice {
    background: #ff0000;
    border-radius: 22px;
    color: #fff;
    width: fit-content;
    margin: 5px auto 10px auto;
    padding: 4px 8px;
    line-height: 1;
    font-size: 10px;
}

span.whiz-upprice-actual {
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    line-height: 0.5;
    position: relative;
    top: 1.5px;
}

/* =========================================================================
   Load More / Show Less
   ========================================================================= */

.sellcat .load-more {
    grid-column: 1 / -1;
    text-align: center;
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    margin: 10px auto 0 auto;
}

.load-more button {
    appearance: none;
    -webkit-appearance: none;
    background: #fff;
    color: #111;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 10px 24px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    font-family: 'Figtree', sans-serif;
    transition: border-color .2s, color .2s, background .2s;
}

.load-more button:hover {
    border-color: #111;
    color: #000;
}

.load-more button:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

/* =========================================================================
   Fallback / No results
   ========================================================================= */

.whiz-phonespic.fallback-device,
a.whiz-phonespic.fallback-device {
    border: 1px dashed #ccc;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 180px;
    transition: background-color 0.3s ease;
    grid-column: 1 / -1;
    max-width: 300px;
    margin: 40px auto;
    padding: 20px;
    border-radius: 12px;
    text-decoration: none;
}

.whiz-phonespic.fallback-device:hover {
    background-color: #f0f0f0;
    border-color: #aaa;
    transform: none;
}

.fallback-device .whiz-phoneicon-placeholder {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #ececec;
    color: #9a9a9a;
    font-size: 28px;
    font-weight: 700;
    line-height: 52px;
    text-align: center;
    margin-bottom: 12px;
}

.fallback-device .whiz-phonename {
    color: #555;
    padding: 5px 10px;
    text-align: center;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.3;
}

.fallback-device .whiz-upprice.contact-cta {
    background-color: #ff0000;
    color: #fff;
    font-weight: bold;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
}

/* =========================================================================
   Stats (hidden by default — used only for screen readers)
   ========================================================================= */

#iox-search-stats {
    text-align: center;
    font-size: 12px;
    color: #999;
    padding-bottom: 5px;
}

/* =========================================================================
   Loading indicator
   ========================================================================= */

.search-preloader {
    margin: auto;
    text-align: center;
    padding: 40px;
}

.search-preloader img {
    width: 80px;
    height: 80px;
}

/* =========================================================================
   Popular sellers section (inherits from old plugin)
   ========================================================================= */

.whiz-outer.popular {
    background-color: #fff;
    color: #111;
    border-top: 1px solid #f0f0f0;
}

.whiz-outer.popular .whiz-step-header {
    color: #000;
}

.whiz-outer.popular .whiz-phonespics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 15px;
}

.whiz-outer.popular .whiz-phonename {
    color: #ff0000;
}

.whiz-outer.popular .whiz-phonespics::-webkit-scrollbar-track {
    background-color: #f0f0f0;
}

.whiz-outer.popular .whiz-phonespics::-webkit-scrollbar-thumb {
    background-color: #ff0000;
}

/* =========================================================================
   Responsive: Tablet (≤1024px)
   ========================================================================= */

@media screen and (max-width: 1024px) {
    .sellcat {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =========================================================================
   Responsive: Mobile (≤768px)
   ========================================================================= */

@media screen and (max-width: 768px) {
    .whiz-outer.s1 {
        padding: 40px 16px 28px;
    }

    .sellcat {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 10px;
    }

    .whiz-search-header {
        padding-bottom: 20px;
    }

    /* 16px minimum prevents iOS zoom-on-focus */
    #iox-search-input {
        height: 48px;
        font-size: 16px;
        padding: 0 18px 0 46px;
    }

    .whiz-search-icon {
        left: 18px;
        width: 18px;
        height: 18px;
    }

    .whiz-searchtab {
        gap: 8px;
        padding-top: 18px;
    }

    .whiz-contain button.whiz-searchtabs {
        min-height: 40px !important;
        font-size: 13px !important;
        padding: 9px 18px !important;
    }

    .sellcat-text,
    a.sellcat-text {
        font-size: 18px;
    }

    .whiz-phonename {
        font-size: 12px;
    }

    .whiz-brandgrid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }

    .whiz-contain button.whiz-brandtile {
        min-height: 128px !important;
        padding: 14px 12px 12px !important;
    }

    .whiz-brandtile-logo img {
        max-height: 72px;
        max-width: 90%;
    }

    .whiz-brandtile-name-only {
        font-size: 16px;
    }

    .whiz-results-toolbar {
        flex-wrap: wrap;
        gap: 10px;
    }

    .whiz-results-heading {
        font-size: 18px;
    }
}
