/* MME live search — SEO-friendly markup, mobile-first panel (scoped) */

.mme-search-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mme-search-noscript {
    margin: 0.5rem 0 0;
    font-size: 12px;
    color: var(--mme-search-muted, #6b7280);
}

html.mme-search-scroll-lock {
    overflow: hidden;
}

.mme-search-form-host {
    --mme-search-primary: var(--wd-primary-color, #83b735);
    --mme-search-secondary: var(--wd-secondary-color, #36454f);
    --mme-search-hover-bg: var(--mme-search-primary);
    --mme-search-hover-fg: #ffffff;
    --mme-search-hover-fg-muted: rgba(255, 255, 255, 0.82);
    --mme-search-text: #1f2937;
    --mme-search-muted: #6b7280;
    --mme-search-border: #e5e7eb;
    --mme-search-surface: #f9fafb;
    --mme-search-radius: 8px;
    --mme-search-input-h: 42px;
    position: relative;
    z-index: 400;
    max-width: 100%;
}

/* Hide Woodmart native dropdown */
.wd-search-form.mme-search-enabled .wd-search-results,
.wd-search-form.mme-search-enabled .wd-scroll-content {
    display: none !important;
}

/* —— Input (shortcode + enhanced Woodmart forms) —— */
.mme-search-shortcode,
.mme-search-form-host form.searchform,
.mme-search-form-host form.mme-header-search-form {
    width: 100%;
    max-width: 100%;
}

.mme-search-shortcode-inner {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    border: 1.5px solid var(--mme-search-border);
    border-radius: var(--mme-search-radius);
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    gap: 0;
}

.mme-search-form-host:focus-within .mme-search-bar,
.mme-search-form-host.mme-search-is-open .mme-search-bar,
.mme-search-form-host:focus-within .mme-search-shortcode-inner,
.mme-search-form-host.mme-search-is-open .mme-search-shortcode-inner {
    border-color: var(--mme-search-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--mme-search-primary) 14%, transparent);
}

.mme-search-shortcode-inner .search-field {
    flex: 1 1 auto;
    min-width: 0;
    height: var(--mme-search-input-h);
    border: 0;
    background: transparent;
    padding: 0 14px;
    font-size: 14px;
    line-height: 1.4;
    color: var(--mme-search-text);
}

.mme-search-shortcode-inner .search-field:focus {
    outline: none;
}

.mme-search-shortcode .mme-search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 var(--mme-search-input-h);
    width: var(--mme-search-input-h);
    min-width: var(--mme-search-input-h);
    height: var(--mme-search-input-h);
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: var(--mme-search-primary);
    color: #fff;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.mme-search-shortcode .mme-search-submit:hover {
    filter: brightness(1.08);
}

.mme-search-shortcode .mme-search-submit svg {
    width: 18px;
    height: 18px;
}

/* Woodmart header: expand whichever column contains the search */
.whb-header .whb-col-center,
.whb-header .whb-column.whb-col-center,
.whb-general-header .whb-col-center,
.wd-header-search {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-width: 0;
}

/* Hide bottom-nav duplicate search on desktop (primary search is in .whb-general-header) */
.wd-search-form.mme-search-suppressed,
.whb-column.mme-search-suppressed,
.whb-col.mme-search-suppressed,
.whb-sticky-header .wd-search-form,
.whb-sticky-header .wd-header-search {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
}

@media (min-width: 992px) {
    .whb-header .whb-header-bottom .wd-search-form,
    .whb-header .whb-header-bottom .wd-header-search,
    .whb-header .whb-header-bottom form.searchform,
    .whb-header .whb-header-bottom .wd-header-search-form-mobile,
    .whb-header .whb-header-bottom .wd-header-mobile-nav {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        max-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        pointer-events: none !important;
        opacity: 0 !important;
    }

    .whb-general-header .whb-col-center .whb-space-element {
        display: none !important;
    }

    .whb-general-header .whb-col-center .wd-header-text {
        display: flex;
        justify-content: center;
        width: 100%;
        max-width: min(42rem, 58vw);
        margin-inline: auto;
    }

    .whb-general-header .mme-search-shortcode,
    .whb-general-header .mme-search-shortcode-inner {
        width: 100%;
        min-width: 0;
        max-width: min(42rem, 58vw);
    }
}

.whb-column.mme-search-whb-column,
.whb-col.mme-search-whb-column,
.wd-header-search.mme-search-whb-column {
    display: flex;
    align-items: center;
    justify-content: stretch;
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
}

.whb-header .mme-search-form-host,
.wd-header-search .mme-search-form-host,
.mme-search-whb-column .mme-search-form-host {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    margin-inline: auto;
}

.mme-search-form-host.wd-search-form:not(.mme-search-shortcode) {
    width: 100%;
    max-width: none;
}

.mme-search-form-host.wd-search-form:not(.mme-search-shortcode) input[type="search"],
.mme-search-form-host.wd-search-form:not(.mme-search-shortcode) input[type="text"] {
    max-width: 100%;
}

/* Stay visible while typing (override Woodmart collapse / fullscreen) */
.whb-header .mme-search-form-host.mme-search-enabled,
.whb-header .mme-search-form-host.mme-search-has-focus,
.whb-header .mme-search-form-host.mme-search-is-open,
.whb-header .mme-search-form-host:focus-within {
    display: block;
    visibility: visible;
    opacity: 1;
    position: relative;
    inset: auto;
    transform: none;
    height: auto;
    overflow: visible;
}

.mme-search-form-host.mme-search--enhanced form.searchform,
.mme-search-form-host.mme-search--enhanced > form {
    display: block;
    visibility: visible;
    width: 100%;
}

.mme-search-form-host .mme-search-bar {
    display: flex;
    visibility: visible;
    width: 100%;
    min-height: var(--mme-search-input-h);
}

.mme-search-form-host .mme-search-bar input[type="search"],
.mme-search-form-host .mme-search-bar input[type="text"] {
    display: block;
    visibility: visible;
    opacity: 1;
    color: var(--mme-search-text);
    -webkit-text-fill-color: var(--mme-search-text);
    caret-color: var(--mme-search-text);
    background: transparent;
}

.mme-search-form-host .mme-search-bar input::placeholder {
    color: var(--mme-search-muted);
    opacity: 1;
}

/* Woodmart header search: single-row (no ghost / Tab accept) */
.mme-search-form-host.mme-search--enhanced > form,
.mme-search-form-host.mme-search--enhanced form.searchform {
    display: block;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.mme-search-bar {
    display: flex;
    align-items: stretch;
    width: 100%;
    gap: 0;
    border: 1px solid var(--mme-search-border);
    border-radius: var(--mme-search-radius);
    background: #fff;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.mme-search-form-host.mme-search--enhanced .mme-search-bar input[type="search"],
.mme-search-form-host.mme-search--enhanced .mme-search-bar input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    max-width: none;
}

.mme-search-shortcode form.mme-header-search-form {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
    max-width: 300px;
}

.mme-search-form-host.mme-search--enhanced .mme-search-bar input[type="search"],
.mme-search-form-host.mme-search--enhanced .mme-search-bar input[type="text"],
.mme-search-form-host.mme-search--enhanced input[type="search"],
.mme-search-form-host.mme-search--enhanced input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
    height: var(--mme-search-input-h);
    margin: 0;
    padding: 0 12px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 14px;
    line-height: 1.4;
}

.mme-search-form-host.mme-search--enhanced .mme-search-bar button[type="submit"],
.mme-search-form-host.mme-search--enhanced .mme-search-bar .searchsubmit,
.mme-search-form-host.mme-search--enhanced button[type="submit"],
.mme-search-form-host.mme-search--enhanced .searchsubmit,
.mme-search-shortcode .mme-search-submit {
    position: relative;
    flex: 0 0 var(--mme-search-input-h);
    width: var(--mme-search-input-h);
    min-width: var(--mme-search-input-h);
    height: var(--mme-search-input-h);
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--mme-search-primary);
    color: #fff;
    transition: filter 0.15s ease, opacity 0.15s ease;
}

.mme-search-form-host.mme-search-is-loading .mme-search-submit svg,
.mme-search-form-host.mme-search-is-loading button[type="submit"] svg,
.mme-search-form-host.mme-search-is-loading .searchsubmit svg {
    opacity: 0;
}

.mme-search-form-host.mme-search-is-loading .mme-search-submit::after,
.mme-search-form-host.mme-search-is-loading button[type="submit"]::after,
.mme-search-form-host.mme-search-is-loading .searchsubmit::after {
    content: "";
    position: absolute;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mme-search-spin 0.65s linear infinite;
}

.mme-search-form-host.mme-search-is-loading .mme-search-shortcode-inner,
.mme-search-form-host.mme-search-is-loading .mme-search-bar,
.mme-search-form-host.mme-search-is-loading.mme-search--enhanced > form,
.mme-search-form-host.mme-search-is-loading.mme-search--enhanced form.searchform {
    border-color: color-mix(in srgb, var(--mme-search-primary) 55%, var(--mme-search-border));
}

.mme-search-form-host.mme-search--enhanced .wd-search-results,
.mme-search-form-host.mme-search--enhanced .wd-scroll-content,
.mme-search-form-host.mme-search--enhanced .wd-search-area,
.mme-search-form-host.mme-search--enhanced .search-by-category,
.mme-search-form-host.mme-search--enhanced .wd-search-cat,
.mme-search-form-host.mme-search--enhanced .wd-search-cat-wrap {
    display: none;
}

.mme-search-form-host.mme-search--enhanced .wd-search-inner:empty {
    display: none;
}

.mme-search-ghost,
.mme-search-accept,
.mme-search-input-wrap {
    display: none !important;
}

/* —— Overlay (mobile only) —— */
.mme-header-search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 100040;
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.mme-header-search-overlay.is-open {
    display: block;
    opacity: 1;
}

@media (min-width: 768px) {
    .mme-header-search-overlay {
        display: none !important;
    }
}

/* —— Suggestions panel (width/position set by JS from search bar) —— */
.mme-header-search-panel {
    position: fixed;
    z-index: 100050;
    display: none;
    flex-direction: column;
    width: auto;
    max-height: min(28rem, calc(100vh - 6rem));
    background: #fff;
    border: 1px solid color-mix(in srgb, var(--mme-search-border) 70%, transparent);
    border-radius: 12px;
    box-shadow:
        0 4px 6px rgba(15, 23, 42, 0.04),
        0 12px 32px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.mme-header-search-panel.is-open {
    display: flex;
    animation: mme-search-panel-in 0.18s ease-out;
}

@media (min-width: 992px) {
    .mme-header-search-panel.is-open {
        max-width: calc(100vw - 1.5rem);
    }

    .mme-search-layout {
        grid-template-columns: 14.5rem minmax(0, 1fr);
        column-gap: 0;
        padding-inline: 0;
        max-height: min(24rem, calc(100dvh - 10rem));
    }

    .mme-search-category-scroll {
        max-height: 9rem;
    }

    .mme-search-right {
        padding: 0.75rem 0.75rem 0.75rem 1rem;
    }
}

@keyframes mme-search-panel-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes mme-search-shimmer {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

@keyframes mme-search-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes mme-search-progress {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(250%);
    }
}

.mme-search-panel-scroll {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: contain;
}

.mme-header-search-panel:not(.is-loading) .mme-search-panel-scroll {
    animation: mme-search-content-in 0.2s ease-out;
}

.mme-search-right.mme-search-right--updating {
    animation: none;
}

@keyframes mme-search-content-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.mme-search-layout {
    display: grid;
    grid-template-columns: 14.5rem minmax(0, 1fr);
    column-gap: 0;
    padding: 0;
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(22rem, calc(100dvh - 10rem));
    overflow: hidden;
}

.mme-search-left {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-inline-end: 1px solid var(--mme-search-border);
    padding: 0.75rem 0.75rem 0.75rem 0.75rem;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--mme-search-muted) 30%, transparent) transparent;
    background: var(--mme-search-surface);
}

.mme-search-right {
    padding: 0.625rem 0.5rem 0.625rem 0.75rem;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--mme-search-muted) 30%, transparent) transparent;
}

.mme-search-categories-desktop {
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.mme-search-category-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding-inline-end: 0.25rem;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--mme-search-muted) 30%, transparent) transparent;
}

.mme-search-brands,
.mme-search-articles-block {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
}

.mme-search-brands {
    flex: 0 0 auto;
    padding-top: 0.625rem;
    margin-top: 0.5rem;
    border-top: 1px solid color-mix(in srgb, var(--mme-search-border) 60%, transparent);
}

.mme-search-articles-block {
    margin-bottom: 0;
    padding-bottom: 0;
}

.mme-search-section-title {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    margin: 0 0 0.5rem;
    font-size: 10px;
    line-height: 1.35;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    gap: 0.5rem;
}

.mme-search-section-title::after {
    content: "";
    flex: 1 1 auto;
    height: 1px;
    background: color-mix(in srgb, var(--mme-search-border) 60%, transparent);
}

.mme-search-section-title--categories,
.mme-search-section-title--brands {
    padding: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--mme-search-primary);
    background: none;
    border: 0;
    border-radius: 0;
}

.mme-search-section-title--articles {
    padding: 0;
    font-weight: 700;
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--mme-search-secondary);
    background: none;
    border: 0;
    border-radius: 0;
}

.mme-search-section-title--mobile {
    margin: 0 0 0.5rem;
    padding-inline: 0;
}

.mme-search-section-title--mobile::after {
    display: none;
}

.mme-header-search-panel .mme-search-section-title--categories,
.mme-header-search-panel .mme-search-section-title--brands {
    color: var(--mme-search-primary);
}

.mme-header-search-panel .mme-search-section-title--articles {
    color: var(--mme-search-secondary);
}

.mme-search-category-list,
.mme-search-product-list,
.mme-search-blog-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mme-search-category-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mme-search-category-list .mme-search-item {
    border: 0;
    border-radius: 6px;
    background: transparent;
    overflow: hidden;
    transition: background 0.12s ease;
}

.mme-search-category-list .mme-search-item:hover {
    background: #fff;
}

.mme-search-category-list .mme-search-item.is-active {
    background: var(--mme-search-hover-bg, var(--mme-search-primary));
}

.mme-search-category-list .mme-search-item a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    padding: 6px 8px;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--mme-search-text);
    text-decoration: none;
    border-radius: 6px;
}

.mme-search-category-list .count {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--mme-search-muted);
    font-weight: 500;
}

.mme-search-product-list .mme-search-item a,
.mme-search-blog-list .mme-search-item a {
    border-radius: 8px;
    transition: background 0.12s ease, color 0.12s ease;
}

.mme-search-category-list .mme-search-item a {
    transition: background 0.12s ease, color 0.12s ease;
}

.mme-search-category-list .mme-search-item a:hover,
.mme-search-category-list .mme-search-item.is-active a {
    background: var(--mme-search-hover-bg, var(--mme-search-primary));
    color: var(--mme-search-hover-fg, #ffffff);
}

.mme-search-category-list .mme-search-item a:hover .count,
.mme-search-category-list .mme-search-item.is-active a .count {
    color: var(--mme-search-hover-fg-muted, rgba(255, 255, 255, 0.82));
}

.mme-search-product-list .mme-search-item a:hover,
.mme-search-product-list .mme-search-item.is-active a {
    background: var(--mme-search-hover-bg, var(--mme-search-primary));
    color: var(--mme-search-hover-fg, #ffffff);
}

.mme-search-product-list .mme-search-item a:hover img,
.mme-search-product-list .mme-search-item.is-active a img {
    border-color: transparent;
}

.mme-search-product-list .mme-search-item.is-active a .mme-search-product-name,
.mme-search-product-list .mme-search-item a:hover .mme-search-product-name {
    color: var(--mme-search-hover-fg, #ffffff);
}

.mme-search-product-list .mme-search-item.is-active a .mme-search-match-value,
.mme-search-product-list .mme-search-item a:hover .mme-search-match-value {
    color: var(--mme-search-hover-fg-muted, rgba(255, 255, 255, 0.82));
}

.mme-search-product-list .mme-search-item.is-active a .mme-search-match-line.is-hit .mme-search-match-label,
.mme-search-product-list .mme-search-item a:hover .mme-search-match-line.is-hit .mme-search-match-label {
    color: var(--mme-search-hover-fg, #ffffff);
}

.mme-search-product-list .mme-search-item.is-active a .mme-search-meta span,
.mme-search-product-list .mme-search-item a:hover .mme-search-meta span {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--mme-search-hover-fg-muted, rgba(255, 255, 255, 0.82));
}

.mme-search-blog-list .mme-search-item a:hover,
.mme-search-blog-list .mme-search-item.is-active a {
    background: var(--mme-search-hover-bg, var(--mme-search-primary));
    color: var(--mme-search-hover-fg, #ffffff);
}

.mme-search-blog-list .mme-search-item a:hover .mme-search-product-name,
.mme-search-blog-list .mme-search-item.is-active a .mme-search-product-name {
    color: var(--mme-search-hover-fg, #ffffff);
}

.mme-search-blog-list .mme-search-item a:hover .mme-search-meta span,
.mme-search-blog-list .mme-search-item.is-active a .mme-search-meta span {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--mme-search-hover-fg-muted, rgba(255, 255, 255, 0.82));
}

/* Brands: two-column grid (left column) */
.mme-search-brand-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    padding: 0 0 0.25rem;
}

.mme-search-brand-grid a {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 9;
    padding: 0.375rem;
    border-radius: 6px;
    border: 1px solid #fff;
    background-color: #fff;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mme-search-brand-grid a.is-active,
.mme-search-brand-grid a:hover {
    border-color: var(--mme-search-hover-bg, var(--mme-search-primary));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--mme-search-primary) 25%, transparent);
}

.mme-search-brand-grid a.mme-search-brand-link--has-logo.is-active,
.mme-search-brand-grid a.mme-search-brand-link--has-logo:hover {
    background-color: #fff;
}

.mme-header-search-panel .mme-search-brand-grid a,
.mme-header-search-panel .mme-search-brand-link {
    color: inherit;
}

.mme-header-search-panel .mme-search-brand-logo {
    display: block;
    width: 100%;
    min-height: 2.75rem;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.mme-search-brand-link--has-logo,
.mme-search-mobile-brand.mme-search-brand-link--has-logo {
    background-color: #fff;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    min-height: 2.75rem;
}

.mme-search-brand-fallback {
    font-size: 10px;
    font-weight: 700;
    color: var(--mme-search-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    line-height: 1.3;
}

/* Products */
.mme-search-product-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mme-search-product-list .mme-search-item a {
    display: block;
    padding: 8px 10px;
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
}

.mme-search-product-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.mme-search-product-row img {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    background: var(--mme-search-surface);
    border: 1px solid var(--mme-search-border);
    transition: border-color 0.12s ease;
}

.mme-search-product-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.mme-search-product-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--mme-search-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mme-search-product-name em,
.mme-search-match-value em {
    font-style: normal;
    font-weight: 700;
    background: color-mix(in srgb, var(--mme-search-primary) 14%, #fff);
    color: var(--mme-search-primary);
    border-radius: 3px;
    padding: 1px 3px;
}

.mme-search-match-lines {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}

.mme-search-match-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 11px;
    line-height: 1.35;
    min-width: 0;
}

.mme-search-match-line.is-hit .mme-search-match-label {
    color: var(--mme-search-primary);
    font-weight: 600;
}

.mme-search-product-list .mme-search-item.is-active a .mme-search-match-value em,
.mme-search-product-list .mme-search-item a:hover .mme-search-match-value em,
.mme-search-product-list .mme-search-item.is-active a .mme-search-product-name em,
.mme-search-product-list .mme-search-item a:hover .mme-search-product-name em {
    background: color-mix(in srgb, var(--mme-search-hover-fg, #ffffff) 24%, transparent);
    color: inherit;
}

.mme-search-match-label {
    flex: 0 0 auto;
    color: var(--mme-search-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 10px;
}

.mme-search-match-value {
    flex: 1 1 auto;
    min-width: 0;
    color: var(--mme-search-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mme-search-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.mme-search-meta span {
    font-size: 10px;
    line-height: 1.3;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--mme-search-surface);
    color: var(--mme-search-muted);
    border: 1px solid var(--mme-search-border);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.mme-search-meta .brand {
    color: #1e40af;
    background: #eff6ff;
    border-color: #dbeafe;
}

.mme-search-meta .category {
    color: #166534;
    background: #f0fdf4;
    border-color: #dcfce7;
}

/* Blog */
.mme-search-blog-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mme-search-blog-list .mme-search-item a {
    display: block;
    padding: 8px 10px;
    text-decoration: none;
    border-radius: 8px;
}

.mme-search-blog-list .mme-search-product-name {
    -webkit-line-clamp: 2;
}

.mme-search-articles-block {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid color-mix(in srgb, var(--mme-search-border) 60%, transparent);
}

/* Loading skeleton */
.mme-search-loading-wrap {
    display: flex;
    flex-direction: column;
    min-height: 10rem;
}

.mme-search-loading-bar {
    flex-shrink: 0;
    height: 2px;
    background: var(--mme-search-surface);
    overflow: hidden;
}

.mme-search-loading-bar-fill {
    display: block;
    width: 40%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        var(--mme-search-primary),
        transparent
    );
    animation: mme-search-progress 1s ease-in-out infinite;
}

.mme-search-loading-text {
    margin: 0;
    padding: 10px 16px 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--mme-search-muted);
    text-align: center;
    letter-spacing: 0.02em;
}

.mme-search-skeleton {
    display: block;
    border-radius: 6px;
    background: linear-gradient(
        90deg,
        #eef1f5 0%,
        #f8f9fb 45%,
        #eef1f5 90%
    );
    background-size: 200% 100%;
    animation: mme-search-shimmer 1.4s ease-in-out infinite;
}

.mme-search-skeleton-title {
    height: 12px;
    width: 5rem;
    margin: 8px 12px 10px;
}

.mme-search-skeleton-line--lg {
    height: 12px;
    width: 85%;
}

.mme-search-skeleton-line--md {
    height: 10px;
    width: 70%;
}

.mme-search-skeleton-line--sm {
    height: 8px;
    width: 45%;
    margin-top: 6px;
}

.mme-search-skeleton-list {
    list-style: none;
    margin: 0;
    padding: 0 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mme-search-skeleton-brands {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0 12px 12px;
}

.mme-search-skeleton-brand {
    aspect-ratio: 16 / 9;
    border-radius: 8px;
}

.mme-search-skeleton-products {
    list-style: none;
    margin: 0;
    padding: 0 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mme-search-skeleton-product {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.mme-search-skeleton-thumb {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 8px;
}

.mme-search-skeleton-lines {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 4px;
}

/* Empty state */
.mme-search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 32px 24px;
    text-align: center;
}

.mme-search-empty-icon {
    width: 48px;
    height: 48px;
    border: 2px solid var(--mme-search-border);
    border-radius: 50%;
    position: relative;
    opacity: 0.6;
}

.mme-search-empty-icon::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 2px;
    background: var(--mme-search-muted);
    border-radius: 1px;
    transform: rotate(-45deg);
    inset: auto 10px 12px auto;
}

.mme-search-empty-title {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--mme-search-text);
}

.mme-search-empty-title strong {
    color: var(--mme-search-primary);
}

.mme-search-empty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border-radius: 8px;
    background: var(--mme-search-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: filter 0.15s ease, box-shadow 0.15s ease;
}

.mme-search-empty-btn:hover {
    filter: brightness(1.08);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--mme-search-primary) 30%, transparent);
    color: #fff;
}

.mme-search-more {
    flex-shrink: 0;
    border-top: 1px solid var(--mme-search-border);
    background: var(--mme-search-surface);
    padding: 8px 12px 10px;
}

.mme-search-more a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    background: var(--mme-search-primary);
    border: 1px solid var(--mme-search-primary);
    transition: filter 0.15s ease, box-shadow 0.15s ease;
}

.mme-search-more a:hover {
    filter: brightness(1.08);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--mme-search-primary) 30%, transparent);
    color: #fff;
}

.mme-search-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5em;
    height: 1.5em;
    padding: 0 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    font-size: 11px;
    font-family: inherit;
    font-weight: 600;
    line-height: 1;
    color: inherit;
    margin-inline-start: 4px;
}

.mme-search-sidebar-empty {
    margin: 8px 12px;
    font-size: 12px;
    color: var(--mme-search-muted);
}

.mme-search-mobile-filters {
    display: none;
    flex-shrink: 0;
    flex-direction: column;
    gap: 0;
    border-bottom: 1px solid var(--mme-search-border);
    background: var(--mme-search-surface);
}

.mme-search-mobile-brands {
    padding: 10px 12px 0;
}

.mme-search-mobile-brands .mme-search-section-title--mobile,
.mme-search-mobile-chips .mme-search-section-title--mobile {
    padding-inline: 0;
}

.mme-search-mobile-brands-inner {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.mme-search-mobile-brands-inner::-webkit-scrollbar {
    display: none;
}

.mme-search-mobile-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 4.5rem;
    height: 2.5rem;
    padding: 4px;
    border: 1px solid var(--mme-search-border);
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.mme-search-mobile-brand.is-active,
.mme-search-mobile-brand:hover {
    border-color: var(--mme-search-hover-bg, var(--mme-search-primary));
    background-color: #fff;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--mme-search-primary) 25%, transparent);
}

.mme-search-mobile-brand .mme-search-brand-logo {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.mme-search-mobile-brand img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Mobile category chips */
.mme-search-mobile-chips {
    flex-shrink: 0;
    padding: 8px 12px 10px;
    background: #fff;
}

.mme-search-mobile-chips-inner {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.mme-search-mobile-chips-inner::-webkit-scrollbar {
    display: none;
}

.mme-search-chip {
    flex: 0 0 auto;
    border: 1px solid var(--mme-search-border);
    border-radius: 999px;
    background: #fff;
    color: var(--mme-search-text);
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.mme-search-chip.is-active,
.mme-search-chip:hover {
    border-color: var(--mme-search-hover-bg, var(--mme-search-primary));
    background: var(--mme-search-hover-bg, var(--mme-search-primary));
    color: var(--mme-search-hover-fg, #ffffff);
}

/* Mobile */
@media (max-width: 767px) {
    .mme-search-panel-scroll {
        overflow-y: auto;
        overflow-x: hidden;
    }

    .mme-search-layout {
        max-height: none;
        overflow: visible;
    }

    .mme-search-left {
        overflow: visible;
    }

    .mme-search-right {
        overflow: visible;
    }

    .mme-search-form-host {
        --mme-search-input-h: 44px;
    }

    .mme-header-search-panel {
        --mme-search-panel-w: calc(100vw - 1rem);
        max-height: calc(100dvh - 5rem - env(safe-area-inset-bottom, 0px));
        border-radius: 14px 14px 0 0;
        box-shadow:
            0 -4px 12px rgba(15, 23, 42, 0.08),
            0 -16px 40px rgba(15, 23, 42, 0.12);
    }

    .mme-search-form-host.mme-search--enhanced .mme-search-bar,
    .mme-search-form-host.mme-search--enhanced > form,
    .mme-search-form-host.mme-search--enhanced form.searchform,
    .mme-search-shortcode-inner {
        max-width: 100%;
    }

    .mme-search-layout {
        grid-template-columns: minmax(7rem, 9rem) minmax(0, 1fr);
        column-gap: 0.5rem;
        padding-inline: 0.5rem;
    }

    .mme-search-left .mme-search-categories-desktop {
        display: none;
    }

    .mme-search-mobile-filters {
        display: flex;
    }

    .mme-search-mobile-chips {
        padding: 8px 12px 10px;
    }

    .mme-search-chip {
        min-height: 44px;
        padding: 10px 14px;
        font-size: 13px;
    }

    .mme-search-product-list .mme-search-item a,
    .mme-search-category-list .mme-search-item a,
    .mme-search-blog-list .mme-search-item a {
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .mme-search-more a {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .mme-search-brand-grid a {
        min-height: 44px;
    }

    .mme-search-product-name {
        font-size: 14px;
    }

    .mme-search-match-value {
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
}

@media (max-width: 479px) {
    .mme-search-layout {
        grid-template-columns: 1fr;
    }

    .mme-search-left {
        border-inline-end: 0;
        border-bottom: 1px solid var(--mme-search-border);
        padding-bottom: 0.5rem;
    }

    .mme-search-brand-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .whb-general-header .whb-col-center,
    .whb-general-header .mme-search-whb-column {
        display: flex !important;
        justify-content: center;
        flex: 1 1 auto !important;
    }

    .whb-general-header .mme-search-shortcode,
    .whb-general-header .mme-search-shortcode-inner,
    .whb-general-header .mme-search-form-host--primary {
        width: min(42rem, 58vw) !important;
        min-width: min(42rem, 58vw) !important;
        max-width: min(42rem, 58vw) !important;
    }

    .mme-search-left {
        border-radius: 0 0 0 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mme-header-search-overlay,
    .mme-search-shortcode-inner,
    .mme-search-category-list .mme-search-item a,
    .mme-search-product-list .mme-search-item a {
        transition: none;
    }

    .mme-header-search-panel.is-open,
    .mme-search-skeleton,
    .mme-search-loading-bar-fill,
    .mme-search-form-host.mme-search-is-loading .mme-search-submit::after,
    .mme-search-form-host.mme-search-is-loading button[type="submit"]::after {
        animation: none;
    }
}
