/*
 * Amoot Hub search — Patch 11: Bootstrap container and five branded filters.
 * Keeps the existing Hub colors/typography and does not change global header,
 * footer, search routing, or any other site component.
 */

.hub-search-page {
    --hs-primary: var(--amoot-color, #2166AE);
    --hs-text: var(--text-color, #333333);
    --hs-muted: #828282;
    --hs-line: #E5E5E5;
    --hs-light: #F6F7FA;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 66vh;
    overflow-x: clip;
    padding: 36px 0 75px;
    background: #FFFFFF;
    color: var(--hs-text);
}

.hub-search-page,
.hub-search-page * {
    box-sizing: border-box;
}

/* Use the same Bootstrap container pattern as Hub pages. The higher
 * specificity protects it from old search CSS loaded from a stale asset. */
.hub-search-page .hub-search-container {
    width: 100%;
    max-width: 1140px;
    min-width: 0;
    margin-inline: auto;
    padding-inline: 15px;
}

/* Plain, centered typography; no card, fixed header, overlay or blur. */
.hub-search-heading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin: 0 0 21px;
    text-align: center;
}

.hub-search-heading h1 {
    margin: 0;
    font-size: clamp(20px, 2.1vw, 27px);
    font-weight: 800;
    line-height: 1.65;
}

.hub-search-heading p {
    margin: 0;
    color: var(--hs-muted);
    font-size: 13px;
    line-height: 1.9;
}

.hub-search-heading-brand {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-width: 42px;
    height: 40px;
    margin-bottom: 3px;
    color: var(--hs-primary);
}

.hub-search-heading-brand img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 3px;
    object-fit: contain;
    object-position: center;
    background: #FFFFFF;
}

.hub-search-brand-fallback {
    color: var(--hs-primary);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* Search stays centered inside the Hub content container. */
.hub-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    width: min(100%, 860px);
    max-width: 860px;
    min-width: 0;
    min-height: 55px;
    margin-inline: auto;
    padding: 5px 7px;
    border: 1px solid var(--hs-line);
    border-radius: 6px;
    background: #FFFFFF;
}

.hub-search-form:focus-within {
    border-color: var(--hs-primary);
}

.hub-search-field-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 23px;
    margin-inline-start: 9px;
    color: #666666;
}

.hub-search-field-icon svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.hub-search-form input[type="search"] {
    flex: 1;
    min-width: 0;
    width: 0;
    height: 43px;
    margin: 0;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--hs-text);
    font-family: inherit;
    font-size: 14px;
}

.hub-search-form input[type="search"]::placeholder {
    color: var(--hs-muted);
    opacity: 1;
}

.hub-search-form button {
    flex: 0 0 auto;
    min-height: 43px;
    padding: 0 22px;
    border: 1px solid var(--hs-primary);
    border-radius: 4px;
    background: var(--hs-primary);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.hub-search-form button:hover {
    border-color: #18568F;
    background: #18568F;
}

.hub-search-form button:focus-visible,
.hub-search-page a:focus-visible,
.hub-search-feedback-actions button:focus-visible {
    outline: 2px solid var(--hs-primary);
    outline-offset: 3px;
}

.hub-search-main {
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 31px auto 0;
}

/* Flat Google-like content tabs: the strip scrolls, never the entire page. */
.hub-search-tabs {
    display: flex;
    align-items: stretch;
    gap: clamp(20px, 2.5vw, 34px);
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 46px;
    overflow-x: auto;
    overflow-y: hidden;
    border-bottom: 1px solid var(--hs-line);
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

.hub-search-tabs::-webkit-scrollbar,
.hub-search-product-list::-webkit-scrollbar {
    display: none;
}

.hub-search-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 0 1px 12px;
    border-bottom: 2px solid transparent;
    color: #777777;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none !important;
    white-space: nowrap;
}

.hub-search-tab svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.hub-search-tab:hover,
.hub-search-tab.is-active {
    color: var(--hs-primary);
}

.hub-search-tab.is-active {
    border-bottom-color: var(--hs-primary);
    font-weight: 700;
}

/* One image plus one text label per brand. The letter in the logo box is
 * visible only if the image URL is empty or the image fails to load. */
.hub-search-products {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 71px;
    padding: 13px 0;
    border-bottom: 1px solid #F0F0F0;
}

.hub-search-products-label {
    flex: 0 0 auto;
    color: #666666;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.hub-search-product-list {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 9px;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
}

.hub-search-product-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 48px;
    min-width: 60px;
    padding: 5px 10px;
    border: 1px solid var(--hs-line);
    border-radius: 6px;
    background: #FFFFFF;
    color: #666666;
    font-size: 12px;
    text-decoration: none !important;
    white-space: nowrap;
}

.hub-search-product-filter:hover {
    border-color: #BFD5EC;
    color: var(--hs-primary);
}

.hub-search-product-filter.is-active {
    border-color: var(--hs-primary);
    background: #F4F9FF;
    color: var(--hs-primary);
    font-weight: 700;
}

/* Product colors are the existing site design tokens from main.css.
 * Koolak has no defined palette token in the supplied styles, so its color
 * can be set centrally with --koolak-primary-color; Hub blue is the fallback. */
.hub-search-product-filter--Avanak,
.hub-search-product-identity--Avanak {
    --hs-brand-color: var(--avanak-primary-color, #42BFB9);
}

.hub-search-product-filter--Payamak,
.hub-search-product-identity--Payamak {
    --hs-brand-color: var(--payamak-primary-color, #FF8A11);
}

.hub-search-product-filter--OwjCloud,
.hub-search-product-identity--OwjCloud {
    --hs-brand-color: var(--owj-primary-color, #582F87);
}

.hub-search-product-filter--Alavan,
.hub-search-product-identity--Alavan {
    --hs-brand-color: var(--alavan-primary-color, #9E0020);
}

.hub-search-product-filter--Koolak,
.hub-search-product-identity--Koolak {
    --hs-brand-color: var(--koolak-primary-color, var(--amoot-color, #2166AE));
}

.hub-search-brand-name {
    color: var(--hs-brand-color, var(--hs-primary));
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}

.hub-search-product-filter[class*="hub-search-product-filter--"] {
    gap: 7px;
    min-width: 0;
    padding-inline: 9px 12px;
}

.hub-search-product-filter[class*="hub-search-product-filter--"].is-active {
    border-color: var(--hs-brand-color, var(--hs-primary));
    background: #FFFFFF;
}

.hub-search-product-filter[class*="hub-search-product-filter--"]:hover {
    border-color: var(--hs-brand-color, var(--hs-primary));
}

/* All brands occupy an identical, non-shrinking visual canvas.
 * The SVG's inherent viewBox can still contain transparent whitespace; never
 * distort the actual logo to disguise that difference. */
.hub-search-filter-brand,
.hub-search-result-brand {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 36px;
    min-width: 36px;
    height: 32px;
    min-height: 32px;
}

.hub-search-filter-brand img,
.hub-search-result-brand img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    padding: 3px;
    object-fit: contain;
    object-position: center;
    background: #FFFFFF;
}

.hub-search-filter-brand .hub-search-brand-fallback,
.hub-search-result-brand .hub-search-brand-fallback {
    max-width: 100%;
    font-size: 10px;
    white-space: normal;
    text-align: center;
    line-height: 1.35;
    overflow-wrap: anywhere;
    color: var(--hs-brand-color, var(--hs-primary));
}

.hub-search-scope-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 0;
    border-bottom: 1px solid #F0F0F0;
    color: #666666;
    font-size: 12px;
}

.hub-search-scope-notice strong {
    color: var(--hs-text);
}

.hub-search-scope-notice svg {
    width: 17px;
    height: 17px;
    color: var(--hs-primary);
}

.hub-search-results-column {
    width: 100%;
    max-width: none;
    min-width: 0;
    padding-top: 25px;
}

.hub-search-results-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 20px;
    margin-bottom: 4px;
}

.hub-search-results-heading h2 {
    margin: 0;
    color: var(--hs-text);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

.hub-search-results-count {
    color: var(--hs-muted);
    font-size: 12px;
    white-space: nowrap;
}

.hub-search-results-list {
    margin-top: 9px;
}

.hub-search-result {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    width: 100%;
    min-width: 0;
    padding: 21px 2px 22px;
    border-bottom: 1px solid #ECECEC;
    background: transparent;
    color: var(--hs-text) !important;
    text-decoration: none !important;
}

.hub-search-result:hover h3 {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.hub-search-result-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 39px;
    width: 39px;
    height: 39px;
    border: 1px solid #ECF0F5;
    border-radius: 4px;
    background: var(--hs-light);
    color: var(--hs-primary);
}

.hub-search-result-icon svg {
    width: 22px;
    height: 22px;
}

.hub-search-result-body {
    flex: 1;
    min-width: 0;
}

.hub-search-result-topline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 13px;
    min-height: 25px;
    margin-bottom: 6px;
}

.hub-search-type-label {
    color: #777777;
    font-size: 12px;
}

.hub-search-product-identity {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    color: #777777;
    font-size: 12px;
}

.hub-search-product-identity::before {
    content: "·";
    margin-left: 3px;
    color: #AAAAAA;
}

.hub-search-product-identity .hub-search-brand-name {
    font-size: 11px;
}

.hub-search-result-brand {
    width: 28px;
    min-width: 28px;
    height: 26px;
    min-height: 26px;
}

.hub-search-result-brand img {
    padding: 2px;
}

.hub-search-result h3 {
    margin: 0 0 7px;
    color: var(--hs-primary);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.9;
    overflow-wrap: anywhere;
}

.hub-search-result-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 10px;
    color: var(--hs-muted);
    font-size: 12px;
    line-height: 1.8;
}

.hub-search-result-meta span:not(:first-child)::before,
.hub-search-result-meta time:not(:first-child)::before {
    content: "·";
    margin-left: 10px;
    color: #AAAAAA;
}

.hub-search-empty {
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 11px;
    padding: 55px 20px;
    border-bottom: 1px solid var(--hs-line);
    text-align: center;
}

.hub-search-empty svg,
.hub-search-intro svg {
    width: 42px;
    height: 42px;
    color: #A5A5A5;
}

.hub-search-empty h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.hub-search-empty p,
.hub-search-intro p {
    margin: 0;
    color: var(--hs-muted);
    font-size: 13px;
}

.hub-search-empty a {
    color: var(--hs-primary);
    font-size: 13px;
}

.hub-search-intro {
    max-width: none;
    display: flex;
    align-items: center;
    flex-direction: column;
    gap: 12px;
    padding: 67px 20px;
    text-align: center;
}

.hub-search-feedback {
    max-width: none;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 33px;
    padding: 23px 0;
    border-top: 1px solid var(--hs-line);
}

.hub-search-feedback strong {
    font-size: 13px;
    font-weight: 700;
}

.hub-search-feedback p {
    margin: 3px 0 0;
    color: var(--hs-muted);
    font-size: 12px;
}

.hub-search-feedback-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
}

.hub-search-feedback-actions button {
    min-width: 55px;
    padding: 7px 12px;
    border: 1px solid var(--hs-line);
    border-radius: 4px;
    background: #FFFFFF;
    color: var(--hs-text);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
}

.hub-search-feedback-actions button:hover {
    border-color: var(--hs-primary);
    color: var(--hs-primary);
}

.hub-search-feedback-status {
    color: #24864D;
    font-size: 12px;
}

@media (max-width: 700px) {
    .hub-search-page {
        padding: 23px 0 54px;
    }

    .hub-search-page .hub-search-container {
        padding-inline: 16px;
    }

    .hub-search-heading {
        gap: 3px;
        margin-bottom: 19px;
    }

    .hub-search-heading h1 {
        font-size: 20px;
    }

    .hub-search-heading p {
        max-width: 340px;
        font-size: 12px;
    }

    .hub-search-main {
        margin-top: 20px;
    }

    /* A soft translucent edge makes additional tabs/logos discoverable. */
    .hub-search-tabs,
    .hub-search-product-list {
        -webkit-mask-image: linear-gradient(to right, transparent 0, #000 20px, #000 100%);
        mask-image: linear-gradient(to right, transparent 0, #000 20px, #000 100%);
        scroll-snap-type: x proximity;
    }

    .hub-search-tab,
    .hub-search-product-filter {
        scroll-snap-align: start;
    }

    .hub-search-tabs {
        gap: 21px;
        min-height: 47px;
    }

    .hub-search-products {
        gap: 9px;
        min-height: 64px;
        padding: 10px 0;
    }

    .hub-search-product-list {
        gap: 7px;
    }

    .hub-search-product-filter {
        min-width: 55px;
        min-height: 44px;
        padding-inline: 8px;
    }

    .hub-search-product-filter[class*="hub-search-product-filter--"] {
        gap: 6px;
        padding-inline: 8px;
    }

    .hub-search-results-column {
        padding-top: 20px;
    }
}

@media (max-width: 440px) {
    .hub-search-page .hub-search-container {
        padding-inline: 13px;
    }

    .hub-search-heading h1 {
        font-size: 19px;
    }

    .hub-search-heading p {
        font-size: 11.5px;
    }

    .hub-search-form {
        gap: 7px;
        min-height: 51px;
        padding: 4px;
    }

    .hub-search-form input[type="search"] {
        height: 41px;
        font-size: 13px;
    }

    .hub-search-field-icon {
        flex-basis: 20px;
        margin-inline-start: 4px;
    }

    .hub-search-field-icon svg {
        width: 19px;
        height: 19px;
    }

    .hub-search-form button {
        min-height: 41px;
        padding: 0 14px;
    }

    .hub-search-tab {
        font-size: 12px;
    }

    .hub-search-products-label {
        font-size: 11px;
    }

    .hub-search-results-heading h2 {
        font-size: 13px;
    }

    .hub-search-result {
        gap: 10px;
        padding: 17px 0;
    }

    .hub-search-result-icon {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
    }

    .hub-search-result-icon svg {
        width: 19px;
        height: 19px;
    }

    .hub-search-result h3 {
        font-size: 14px;
    }

    .hub-search-feedback-actions {
        margin-right: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hub-search-tabs,
    .hub-search-product-list {
        scroll-behavior: auto;
    }
}
