/*
 * Styles are intentionally namespaced to sacs-* so they do not alter supported shop layouts,
 * WooCommerce product cards, sidebar widgets, grids or theme filter controls.
 */
.sacs-auto-mount,
.sacs-shortcode-mount,
.sacs-search,
.sacs-search * {
    box-sizing: border-box;
}

.sacs-auto-mount,
.sacs-shortcode-mount {
    position: relative;
    width: 100%;
    min-width: 0;
    margin: 0 0 16px;
    z-index: 30;
}

.sacs-search {
    position: relative;
    width: 100%;
    min-width: 0;
    margin: 0;
    font-size: 14px;
}

.sacs-label {
    display: block;
    margin: 0;
}

html body .sacs-search > .sacs-category-search-heading,
html body .sacs-search > .sacs-title {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: static !important;
    float: none !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 0 12px !important;
    padding: 0 !important;
    color: #171d24 !important;
    font-family: inherit !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    white-space: normal !important;
    overflow: visible !important;
}

.sacs-label-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.sacs-input-wrap {
    display: block;
    position: relative;
    width: 100%;
}

.sacs-input {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 44px;
    margin: 0 !important;
    padding: 10px 42px 10px 14px !important;
    border: 1px solid #d8dde5 !important;
    border-radius: 7px !important;
    background: #fff !important;
    box-shadow: none !important;
    color: #1b2430 !important;
    font: inherit !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.sacs-input:focus {
    border-color: #1d6fb8 !important;
    box-shadow: 0 0 0 3px rgba(29, 111, 184, .12) !important;
    outline: 0 !important;
}

.sacs-spinner {
    position: absolute;
    right: 14px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border: 2px solid #d8dde5;
    border-top-color: #1d6fb8;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

.sacs-search.is-searching .sacs-spinner {
    opacity: 1;
    animation: sacs-spin .65s linear infinite;
}

@keyframes sacs-spin {
    to { transform: rotate(360deg); }
}

.sacs-search .sacs-suggestions {
    position: absolute !important;
    float: none !important;
    left: 0 !important;
    right: 0 !important;
    top: calc(100% + 6px) !important;
    width: 100% !important;
    height: auto !important;
    max-height: 420px !important;
    min-height: 0 !important;
    margin: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    background: #fff !important;
    border: 1px solid #dfe3e8 !important;
    border-radius: 8px !important;
    box-shadow: 0 12px 34px rgba(20, 32, 48, .16) !important;
    padding: 5px !important;
    z-index: 99999 !important;
}

.sacs-search .sacs-suggestions[hidden] {
    display: none !important;
}

.sacs-search .sacs-option {
    display: flex !important;
    position: static !important;
    float: none !important;
    clear: both !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 10px 11px !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #171d24 !important;
    cursor: pointer !important;
    text-align: left !important;
    text-transform: none !important;
    white-space: normal !important;
    line-height: normal !important;
    overflow: visible !important;
    transform: none !important;
}

.sacs-search .sacs-option + .sacs-option {
    border-top: 1px solid #eef1f4 !important;
}

.sacs-search .sacs-option:hover,
.sacs-search .sacs-option.is-highlighted {
    background: #f2f6fa !important;
}

.sacs-search .sacs-option-text {
    display: block !important;
    position: static !important;
    float: none !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    line-height: normal !important;
}

.sacs-search .sacs-option-text strong {
    display: block !important;
    position: static !important;
    float: none !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    color: #171d24 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    white-space: normal !important;
    word-break: normal !important;
}

.sacs-search .sacs-option-text small {
    display: block !important;
    position: static !important;
    float: none !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 3px 0 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    color: #697483 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    line-height: 1.45 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    white-space: normal !important;
    word-break: normal !important;
}

.sacs-search .sacs-count {
    display: inline-flex !important;
    position: static !important;
    float: none !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: center !important;
    align-self: center !important;
    width: auto !important;
    min-width: 30px !important;
    max-width: none !important;
    height: auto !important;
    min-height: 24px !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 3px 8px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #edf1f5 !important;
    color: #596574 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    text-align: center !important;
    white-space: nowrap !important;
}

.sacs-message {
    padding: 11px 12px;
    color: #66717f;
    font-size: 13px;
}

.sacs-active-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin: 0 0 16px;
    padding: 10px 12px;
    border: 1px solid #dfe5ec;
    border-radius: 7px;
    background: #f7f9fb;
    color: #27313c;
    font-size: 13px;
    box-sizing: border-box;
}

.sacs-active-filter strong {
    font-weight: 650;
}

.sacs-clear-filter {
    display: inline-flex !important;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: #e6ebf0 !important;
    box-shadow: none !important;
    color: #26313d !important;
    font-size: 20px !important;
    line-height: 1 !important;
    cursor: pointer;
}

.sacs-clear-filter:hover {
    background: #dce3ea !important;
}

/* Only present when Enhanced AJAX product refresh is enabled. */
.sacs-results-region {
    position: relative;
}

.sacs-loading .sacs-results-region {
    opacity: .55;
    pointer-events: none;
    transition: opacity .15s ease;
}

@media (max-width: 767px) {
    .sacs-auto-mount,
    .sacs-shortcode-mount {
        margin-bottom: 14px;
    }

    .sacs-input {
        min-height: 42px;
    }

    .sacs-search .sacs-suggestions {
        max-height: 300px !important;
    }
}

/* Selected-category state shown above the sidebar search field. */
.sacs-filter-mode {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    margin: -2px 0 10px;
    padding: 8px 10px;
    border: 1px solid #e1e6ec;
    border-radius: 6px;
    background: #f7f9fb;
    color: #5c6774;
    font-size: 12px;
    line-height: 1.4;
}

.sacs-filter-mode strong {
    color: #202832;
    font-weight: 650;
}

.sacs-inline-clear {
    display: inline-flex !important;
    flex: 0 0 auto !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #1d6fb8 !important;
    font: inherit !important;
    font-weight: 650 !important;
    line-height: inherit !important;
    text-decoration: none !important;
    cursor: pointer !important;
}

.sacs-inline-clear:hover,
.sacs-inline-clear:focus {
    text-decoration: underline !important;
    outline: 0 !important;
}

/* Optional desktop-only header category search. The existing product search keeps
 * approximately two-thirds of the original search area and category search uses one-third. */
.sacs-header-search-group,
.sacs-header-search-group * {
    box-sizing: border-box;
}

.sacs-header-search-group {
    /* Safari is much stricter than Chromium when a flex item has width:100%.
     * The header's native search form is itself a flex item; forcing our replacement
     * wrapper to 100% can make Safari move the account/cart controls onto a new row.
     * Keep the replacement shrinkable and let the native header flex sizing control it. */
    display: flex !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.sacs-header-search-group > .sacs-header-product-search {
    flex: 2 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
}

.sacs-header-search-group > .sacs-header-mount {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 210px !important;
    max-width: none !important;
}

.sacs-header-mount,
.sacs-header-shortcode-mount {
    position: relative;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    z-index: 100;
}

.sacs-header-search {
    width: 100%;
    min-width: 0;
    height: 100%;
    margin: 0;
}

.sacs-header-search .sacs-label,
.sacs-header-search .sacs-input-wrap {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
}

.sacs-header-search .sacs-input {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding-right: 44px !important;
}

/* The native product field can style its placeholder separately from the input itself.
 * JS copies those computed values into these variables so the two header fields match. */
.sacs-header-search .sacs-input::placeholder {
    color: var(--sacs-placeholder-color, inherit) !important;
    font-family: var(--sacs-placeholder-font-family, inherit) !important;
    font-size: var(--sacs-placeholder-font-size, inherit) !important;
    font-weight: var(--sacs-placeholder-font-weight, inherit) !important;
    font-style: var(--sacs-placeholder-font-style, normal) !important;
    line-height: var(--sacs-placeholder-line-height, inherit) !important;
    letter-spacing: var(--sacs-placeholder-letter-spacing, normal) !important;
    opacity: var(--sacs-placeholder-opacity, 1) !important;
}

.sacs-header-search .sacs-input::-webkit-input-placeholder {
    color: var(--sacs-placeholder-color, inherit) !important;
    font-family: var(--sacs-placeholder-font-family, inherit) !important;
    font-size: var(--sacs-placeholder-font-size, inherit) !important;
    font-weight: var(--sacs-placeholder-font-weight, inherit) !important;
    font-style: var(--sacs-placeholder-font-style, normal) !important;
    line-height: var(--sacs-placeholder-line-height, inherit) !important;
    letter-spacing: var(--sacs-placeholder-letter-spacing, normal) !important;
    opacity: var(--sacs-placeholder-opacity, 1) !important;
}

.sacs-header-search .sacs-spinner {
    right: 42px;
}

.sacs-header-icon {
    position: absolute;
    top: 50%;
    right: var(--sacs-icon-right, 15px);
    display: inline-flex;
    width: var(--sacs-icon-width, 22px);
    height: var(--sacs-icon-height, 22px);
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    color: currentColor;
    pointer-events: none;
}

.sacs-header-icon > * {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

.sacs-header-icon svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
}

/* Only the field actually being hovered/focused should show its interactive state. */
.sacs-header-search .sacs-input:hover,
.sacs-header-search .sacs-input:focus {
    isolation: isolate;
}

/* Never allow a browser/theme fallback focus ring to become the thick black border
 * around the category field. JS copies the native product-search focus colours when
 * they have been observed; otherwise the standard plugin blue focus is used. */
.sacs-header-search .sacs-input:focus,
.sacs-header-search .sacs-input:focus-visible {
    background: #ffffff !important;
    border-color: #1d6fb8 !important;
    box-shadow: 0 0 0 1px #1d6fb8 !important;
    outline: 0 !important;
    outline-offset: 0 !important;
}

.sacs-header-search .sacs-suggestions {
    top: calc(100% + 7px) !important;
    z-index: 999999 !important;
    max-height: 390px !important;
}

@media (max-width: 1024px) {
    .sacs-header-search-group {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .sacs-header-mount,
    .sacs-header-shortcode-mount {
        display: none !important;
    }

    .sacs-header-search-group > .sacs-header-product-search {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Power-Hub edition: isolate the standalone category field from the theme's
 * product-selector offsets and dark-mode input/text-fill overrides. */
html body .sacs-power-hub-header > .sacs-label,
html body .sacs-power-hub-header .sacs-input-wrap {
    display: block !important;
    position: relative !important;
    inset: auto !important;
    float: none !important;
    width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    pointer-events: auto !important;
}

html body .sacs-power-hub-header input.sacs-input,
html body .sacs-power-hub-header input.sacs-input:hover,
html body .sacs-power-hub-header input.sacs-input:focus,
html body .sacs-power-hub-header input.sacs-input:focus-visible {
    display: block !important;
    position: relative !important;
    inset: auto !important;
    float: none !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: var(--sacs-ph-height, 48px) !important;
    min-height: 40px !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 52px 0 14px !important;
    text-indent: 0 !important;
    text-align: left !important;
    text-transform: none !important;
    direction: ltr !important;
    line-height: normal !important;
    letter-spacing: normal !important;
    color: var(--sacs-ph-text, #fff) !important;
    -webkit-text-fill-color: var(--sacs-ph-text, #fff) !important;
    caret-color: var(--sacs-ph-text, #fff) !important;
    background: var(--sacs-ph-background, #121423) !important;
    border: 2px solid #ffc400 !important;
    border-radius: 5px !important;
    outline: 0 !important;
    box-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
    cursor: text !important;
}

html body .sacs-power-hub-header input.sacs-input:focus,
html body .sacs-power-hub-header input.sacs-input:focus-visible {
    box-shadow: 0 0 0 1px #ffc400 !important;
}

html body .sacs-power-hub-header input.sacs-input::placeholder {
    color: var(--sacs-ph-placeholder, #79828a) !important;
    -webkit-text-fill-color: var(--sacs-ph-placeholder, #79828a) !important;
    font-family: var(--sacs-ph-placeholder-family, inherit) !important;
    font-size: var(--sacs-ph-placeholder-size, inherit) !important;
    font-weight: var(--sacs-ph-placeholder-weight, inherit) !important;
    opacity: var(--sacs-ph-placeholder-opacity, 1) !important;
}

html body .sacs-power-hub-header .sacs-header-icon {
    position: absolute !important;
    left: auto !important;
    right: 14px !important;
    top: 50% !important;
    width: 24px !important;
    height: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    color: var(--sacs-ph-text, #fff) !important;
    transform: translateY(-50%) !important;
    pointer-events: none !important;
}
html body .sacs-power-hub-header .sacs-header-icon svg {
    fill: none !important;
    stroke: currentColor !important;
}
html body .sacs-power-hub-header .sacs-spinner { pointer-events: none !important; }


/* The magnifier is now a keyboard-accessible search button. Its icon stays
 * decorative so clicking anywhere on the button triggers the same action. */
html body .sacs-header-search button.sacs-header-icon {
    position: absolute !important;
    top: 50% !important;
    left: auto !important;
    right: var(--sacs-icon-right, 15px) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: var(--sacs-icon-width, 24px) !important;
    height: var(--sacs-icon-height, 24px) !important;
    min-width: 24px !important;
    min-height: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 2px !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: translateY(-50%) !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    z-index: 2 !important;
}
html body .sacs-header-search button.sacs-header-icon:focus-visible {
    outline: 2px solid currentColor !important;
    outline-offset: 3px !important;
}
html body .sacs-header-search button.sacs-header-icon > * { pointer-events: none !important; }
.sacs-category-results-page { margin: 32px auto; }
.sacs-category-results-form { display: flex; gap: 10px; margin: 24px 0; max-width: 680px; }
.sacs-category-results-form input { flex: 1; min-width: 0; }
.sacs-category-results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; margin: 24px 0; }
.sacs-category-results-page .sacs-category-result { display: flex; flex-direction: column; gap: 10px; padding: 20px; background: #fff; border: 1px solid #d8dde5; border-radius: 8px; color: #1b2430; text-decoration: none; }
.sacs-category-result:hover, .sacs-category-result:focus-visible { outline: 2px solid #1d6fb8; outline-offset: 2px; }
.sacs-category-result strong { color: #1b2430; font-size: 18px; line-height: 1.4; }
.sacs-category-result small { color: #596574; line-height: 1.5; }
.sacs-category-result span { color: #1d6fb8; font-weight: 600; }
.sacs-category-results-pagination { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.sacs-category-results-pagination .page-numbers { display: inline-block; padding: 8px 12px; border: 1px solid #d8dde5; border-radius: 4px; }

html body .sacs-power-hub-header button.sacs-header-icon { right: 14px !important; width: 24px !important; height: 24px !important; }

/* Keep the wider gap inside the existing, shrinkable header search slot. */
.sacs-header-search-group.sacs-power-hub-search-group { gap: 20px !important; }


/* Blonwe search type 1 renders "All" in this native select. */
html body .sacs-power-hub-search-group > form.search-form.search-type-1 .input-search-addon select.form-select[name="product_cat"] {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

html body .sacs-power-hub-search-group > form.search-form.search-type-1:focus-within .input-search-addon select.form-select[name="product_cat"] {
    color: #30343b !important;
    -webkit-text-fill-color: #30343b !important;
}

html body .sacs-power-hub-search-group > form.search-form.search-type-1 .input-search-addon select.form-select[name="product_cat"] option {
    color: #30343b !important;
    -webkit-text-fill-color: #30343b !important;
}
