/**
 * IzySearch - Front-end InstantSearch styles
 *
 * @author    IzySearch <contact@izysearch.ai>
 * @copyright 2026 IzySearch
 * @license   Academic Free License 3.0 (AFL-3.0)
 */

/* ==========================================================================
   Variables
   ========================================================================== */
:root {
    /* Colors injected via hookDisplayHeader — defaults used if not overridden */
    --izy-color-primary: #222222;
    --izy-color-accent: #222222;
    --izy-color-promo: #dc2626;
    --izy-bg: #ffffff;       /* UI-230: overridden by IZYSEARCH_COLOR_BG via hookDisplayHeader */
    --izy-bg-page: #f8fafc;  /* UI-230: overridden by IZYSEARCH_COLOR_BG_PAGE via hookDisplayHeader */

    /* Mapped from customizable colors */
    --izy-accent: var(--izy-color-accent);
    --izy-accent-light: var(--izy-color-accent);
    --izy-accent-bg: #EEF2FF;
    --izy-text: var(--izy-color-primary);
    --izy-text-muted: #525960; /* UI-035: WCAG AA compliant (was #6b7280, ratio 4.6:1 -> now 7:1) */
    --izy-border: #e8eaed;
    --izy-bg-hover: #f9fafb;

    /* 3-tier radius system */
    --izy-radius-xs: 8px;
    --izy-radius-sm: 12px;
    --izy-radius: 16px;

    /* Multi-layer shadow system */
    --izy-shadow-sm:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 1px 3px rgba(0, 0, 0, 0.02);
    --izy-shadow-md:
        0 2px 4px rgba(0, 0, 0, 0.04),
        0 4px 12px rgba(0, 0, 0, 0.06);
    --izy-shadow-hover:
        0 2px 8px rgba(0, 0, 0, 0.06),
        0 8px 24px rgba(0, 0, 0, 0.08);
    --izy-shadow-lg:
        0 4px 12px rgba(0, 0, 0, 0.05),
        0 12px 40px rgba(0, 0, 0, 0.1);

    /* Unified transition system */
    --izy-transition: 0.2s ease;
    --izy-transition-fast: 180ms cubic-bezier(0.25, 0.1, 0.25, 1);
    --izy-transition-normal: 320ms cubic-bezier(0.25, 0.1, 0.25, 1);
    --izy-transition-slow: 500ms cubic-bezier(0.25, 0.1, 0.25, 1);

    --izy-promo: var(--izy-color-promo);
    --izy-success: #16A34A;
    --izy-highlight: rgba(254, 243, 199, 0.7);
    --izy-out-of-stock: #6b7280;
    --izy-sidebar-width: 280px;
}

/* ==========================================================================
   Our outer wrapper uses `#search_widget.search-widgets.izysearch-header-search-host`
   — the same id/class ps_searchbar would render, with our own marker class so we can
   re-style it without catching leftover ps_searchbar widgets.
   Classic / PS 1.7 / 8 themes use `float: right` positioning (replicated below, since
   ps_searchbar is disabled and its own CSS isn't loaded).
   PS 9 Hummingbird uses flexbox in the header row, so margin-left:auto pushes us
   to the right slot the theme reserved for ps_searchbar.
   Overflow stays visible so the history dropdown can escape the box.
   ========================================================================== */

/* Hide any leftover native search widget that isn't our host (defensive guard
   in case ps_searchbar somehow stays enabled or a second module renders one). */
.search-widget:not(.izysearch-header-search-host),
.search-widgets:not(.izysearch-header-search-host),
#search_widget:not(.izysearch-header-search-host),
.search-widget-wrap,
.ps-searchbar,
[data-widget-name="ps_searchbar"] {
    display: none !important;
}

/* Position our host in the theme's search slot */
#search_widget.izysearch-header-search-host {
    margin-bottom: 0.625rem;
    overflow: visible;
}

@media only screen and (min-width: 768px) {
    #search_widget.izysearch-header-search-host {
        /* Classic / PS 1.6 / 1.7 / 8 themes: float right into the theme's
           reserved search slot. Harmless on flex parents (the margin-auto
           below handles flex layouts). */
        float: right;
        /* PS 9 Hummingbird: the header row is a flex container, so
           margin-left:auto pushes us to the right end of the row. */
        margin-left: auto;
        margin-bottom: 0;
    }
}

@media only screen and (min-width: 992px) {
    #search_widget.izysearch-header-search-host {
        min-width: 16.5rem;
    }
}

/* ==========================================================================
   Search bar wrapper — width & alignment modes
   ========================================================================== */

/* Manual mode: wrap stays full-width so the theme keeps it in the right spot;
   flexbox positions the inner bar according to the chosen alignment */
.izysearch-searchbar-manual {
    width: 100%;
    display: flex;
}

/* Alignment helpers (manual mode only) */
.izysearch-searchbar-manual.izysearch-searchbar-align-left {
    justify-content: flex-start;
}
.izysearch-searchbar-manual.izysearch-searchbar-align-center {
    justify-content: center;
}
.izysearch-searchbar-manual.izysearch-searchbar-align-right {
    justify-content: flex-end;
}

/* Inner search bar takes the custom width */
.izysearch-searchbar-manual .izysearch-header-search {
    width: var(--izy-searchbar-width-desktop, 100%);
    max-width: 100%;
}

/* Tablet breakpoint (<= 1024px) */
@media (max-width: 1024px) {
    .izysearch-searchbar-manual .izysearch-header-search {
        width: var(--izy-searchbar-width-tablet, 100%);
    }
}

/* Mobile breakpoint (<= 767px) */
@media (max-width: 767px) {
    .izysearch-searchbar-manual .izysearch-header-search {
        width: var(--izy-searchbar-width-mobile, 100%);
    }
}

/* ==========================================================================
   Header search bar (hookDisplayTop) — matches native PS search widget layout
   ========================================================================== */
.izysearch-header-search {
    width: 100%;
    margin-bottom: .625rem;
    overflow: visible;
    position: relative;
}

.izysearch-header-search form {
    position: relative;
    display: flex;
    align-items: center;
}

.izysearch-header-icon {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .5rem;
    color: var(--izy-text-muted);
    pointer-events: none;
    z-index: 2;
    transition: color var(--izy-transition-fast);
}

.izysearch-header-input {
    width: 100%;
    padding: 12px 40px 12px 36px;
    background: transparent;
    color: var(--izy-text);
    border: none;
    border-bottom: 1.5px solid #d6d4d4;
    border-radius: 0;
    font-size: 14px;
    letter-spacing: 0.01em;
    transition: border-color var(--izy-transition-fast);
    outline: none;
}

.izysearch-header-search:focus-within .izysearch-header-icon {
    color: var(--izy-text);
}

.izysearch-header-input:focus {
    border-bottom-color: var(--izy-text);
}

.izysearch-header-input::placeholder {
    color: var(--izy-text-muted);
    letter-spacing: 0.01em;
}

.izysearch-header-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--izy-text-muted);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    z-index: 2;
    border-radius: 50%;
    transition: color var(--izy-transition-fast), background-color var(--izy-transition-fast);
}

.izysearch-header-clear:hover {
    color: var(--izy-text);
    background-color: rgba(0, 0, 0, 0.08);
}

.izysearch-header-submit {
    display: none;
}

@media only screen and (min-width: 768px) {
    .izysearch-header-search {
        margin-bottom: 0;
    }
}

/* ==========================================================================
   UI-201: Search history dropdown
   ========================================================================== */
.izysearch-history-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--izy-bg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--izy-radius-sm);
    box-shadow: var(--izy-shadow-lg);
    z-index: 99998;
    overflow: hidden;
    /* Entrance animation: opacity + slight upward slide */
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    visibility: hidden;
    transition:
        opacity var(--izy-transition-fast),
        transform var(--izy-transition-fast),
        visibility var(--izy-transition-fast);
}

.izysearch-history-dropdown.izysearch-history-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    visibility: visible;
}

.izysearch-history-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.izysearch-history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    transition: background-color var(--izy-transition-fast);
    outline: none;
}

.izysearch-history-item:hover,
.izysearch-history-item:focus,
.izysearch-history-item.izysearch-history-item--active {
    background-color: var(--izy-bg-hover);
}

.izysearch-history-icon {
    flex-shrink: 0;
    color: var(--izy-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

.izysearch-history-icon svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.izysearch-history-text {
    flex: 1;
    font-size: 14px;
    color: var(--izy-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.01em;
}

.izysearch-history-footer {
    border-top: 1px solid var(--izy-border);
    padding: 7px 14px;
    display: flex;
    justify-content: flex-end;
}

.izysearch-history-clear-btn {
    background: none;
    border: none;
    padding: 4px 0;
    font-size: 12px;
    color: var(--izy-text-muted);
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: color var(--izy-transition-fast);
    line-height: 1.4;
}

.izysearch-history-clear-btn:hover {
    color: var(--izy-text);
}

/* ==========================================================================
   Full-page search overlay
   ========================================================================== */
.izysearch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--izy-bg-page);
    z-index: 99999;
    display: block;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px) scale(0.98);
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
                transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
                visibility 0.3s;
    color-scheme: light;
}

.izysearch-overlay.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    visibility: visible;
}

/* Overlay header: search bar + close — UI-013: translateZ(0) forces GPU layer for iOS Safari */
.izysearch-overlay-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1.125rem 1.25rem;
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    z-index: 100;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    display: flex;
    align-items: center;
    gap: 1rem;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.izysearch-overlay-searchbox-wrap {
    flex: 1;
    max-width: 800px;
    margin: 0 auto;
}

/* Style the overlay search box to match header */
.izysearch-overlay-searchbox-wrap .ais-SearchBox-form {
    display: flex;
    align-items: center;
    position: relative;
}

.izysearch-overlay-searchbox-wrap .ais-SearchBox-input {
    width: 100%;
    padding: 14px 80px 14px 22px;
    border: 1.5px solid var(--izy-border);
    border-radius: 28px;
    font-size: 16px;
    letter-spacing: 0.01em;
    color: var(--izy-text);
    background: var(--izy-bg);
    outline: none;
    transition: border-color var(--izy-transition-fast), box-shadow var(--izy-transition-fast);
}

.izysearch-overlay-searchbox-wrap .ais-SearchBox-input:focus {
    border-color: rgba(0, 0, 0, 0.18);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.04);
}

.izysearch-overlay-searchbox-wrap .ais-SearchBox-submit {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--izy-text-muted);
}

.izysearch-overlay-searchbox-wrap .ais-SearchBox-submit svg {
    width: 20px;
    height: 20px;
}

.izysearch-overlay-searchbox-wrap .ais-SearchBox-reset {
    position: absolute;
    right: 48px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--izy-text-muted);
}

.izysearch-overlay-searchbox-wrap .ais-SearchBox-reset[hidden] {
    display: none;
}

.izysearch-overlay-searchbox-wrap .ais-SearchBox-reset svg {
    width: 16px;
    height: 16px;
}

.izysearch-overlay-searchbox-wrap .ais-SearchBox-loadingIndicator {
    position: absolute;
    right: 48px;
    top: 50%;
    transform: translateY(-50%);
}

/* Language/currency switchers */
.izysearch-overlay-switchers {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.izysearch-switcher {
    position: relative;
}

.izysearch-switcher-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 12px;
    background: var(--izy-bg-page);
    border: 1px solid var(--izy-border);
    border-radius: var(--izy-radius-xs);
    font-size: 12px;
    font-weight: 600;
    color: var(--izy-text);
    cursor: pointer;
    white-space: nowrap;
    transition: border-color var(--izy-transition-fast), background-color var(--izy-transition-fast);
}

.izysearch-switcher-btn:hover {
    border-color: #9ca3af;
    background: rgba(0, 0, 0, 0.02);
}

.izysearch-switcher-btn svg {
    opacity: 0.5;
}

.izysearch-switcher-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 150px;
    background: var(--izy-bg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--izy-radius-sm);
    box-shadow: var(--izy-shadow-lg);
    z-index: 110;
    overflow: hidden;
    padding: 4px;
}

.izysearch-switcher-dropdown.active {
    display: block;
}

.izysearch-switcher-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    font-size: 13px;
    color: var(--izy-text);
    text-decoration: none;
    border-radius: var(--izy-radius-xs);
    transition: background var(--izy-transition-fast);
}

.izysearch-switcher-option:hover {
    background: var(--izy-bg-hover);
}

.izysearch-switcher-option.active {
    font-weight: 700;
    background: var(--izy-bg-page);
}

.izysearch-switcher-iso {
    font-weight: 700;
    min-width: 28px;
    font-size: 12px;
    color: var(--izy-text-muted);
}

/* Close button */
.izysearch-overlay-close {
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.04);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--izy-text-muted);
    transition: background var(--izy-transition-fast), color var(--izy-transition-fast), transform var(--izy-transition-fast);
}

.izysearch-overlay-close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: var(--izy-text);
}

.izysearch-overlay-close:active {
    transform: scale(0.92);
}

/* Overlay body: scrollable content below header */
.izysearch-overlay-body {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    padding-top: 80px; /* Space for fixed header */
}

/* ==========================================================================
   Shared layout: sidebar + content (used by BOTH overlay and search page)
   ========================================================================== */
.izysearch-layout {
    display: flex;
    width: 100%;
    max-width: 1640px;
    margin: 0 auto;
    padding: 1.5rem;
    gap: 2.5rem;
}

/* ==========================================================================
   Wrapper (search page only)
   ========================================================================== */
#izysearch-wrapper {
    max-width: 1640px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    color-scheme: light;
}

/* Search page product images are taller */
#izysearch-wrapper .izysearch-hit-image {
    aspect-ratio: 1 / 1;
}

/* Prevent PS theme from overriding hit card link colors */
#izysearch-wrapper .izysearch-hit-name a,
#izysearch-wrapper .izysearch-hit-image a {
    color: var(--izy-text) !important;
    text-decoration: none !important;
}

/* Search page searchbox (hidden - header bar used instead) */
#izysearch-searchbox {
    display: none;
}

/* Error */
#izysearch-error {
    padding: 18px 22px;
    margin-bottom: 28px;
    border-radius: var(--izy-radius-sm);
    background: #FEF2F2;
    color: var(--izy-promo);
    border: 1px solid #FECACA;
    font-size: 14px;
    line-height: 1.5;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.izysearch-sidebar {
    width: var(--izy-sidebar-width);
    min-width: var(--izy-sidebar-width);
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    scrollbar-width: thin;
    padding-right: 0.5rem;
    transition: transform var(--izy-transition-normal);
}

/* Inside the overlay, sidebar is not sticky (content scrolls together) */
.izysearch-overlay-body .izysearch-sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
}

.izysearch-sidebar::-webkit-scrollbar {
    width: 4px;
}

.izysearch-sidebar::-webkit-scrollbar-thumb {
    background: var(--izy-border);
    border-radius: 4px;
}

.izysearch-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--izy-border);
}

.izysearch-sidebar-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--izy-text);
    margin: 0;
}

/* Close title (mobile only) */
.izysearch-sidebar-close-title {
    display: none;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    color: var(--izy-text);
    cursor: pointer;
}

.izysearch-sidebar-close-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    position: relative;
}

.izysearch-sidebar-close-icon::before,
.izysearch-sidebar-close-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 2px;
    background: var(--izy-text);
}

.izysearch-sidebar-close-icon::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.izysearch-sidebar-close-icon::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Clear refinements */
.izysearch-sidebar .ais-ClearRefinements-button {
    background: none;
    border: none;
    color: var(--izy-text-muted);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    text-decoration: underline;
}

.izysearch-sidebar .ais-ClearRefinements-button--disabled {
    color: var(--izy-text-muted);
    cursor: default;
    text-decoration: none;
}

/* Current refinements — hidden in sidebar (active filter pills in content area used instead) */
.izysearch-sidebar .ais-CurrentRefinements {
    display: none;
}

/* ==========================================================================
   Filter sections
   ========================================================================== */
.izysearch-filter-section {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--izy-border);
}

.izysearch-filter-section:last-child {
    border-bottom: none;
}

.izysearch-filter-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--izy-text);
    margin: 0 0 14px 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.izysearch-filter-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--izy-text);
    transition: transform var(--izy-transition-fast);
}

.izysearch-filter-chevron svg {
    width: 14px;
    height: 14px;
}

.izysearch-filter-content {
    overflow: hidden;
    transition: max-height var(--izy-transition-normal);
    max-height: 1000px;
}

.izysearch-filter-content.izysearch-collapsed {
    max-height: 0;
}

.izysearch-filter-title.izysearch-collapsed .izysearch-filter-chevron {
    transform: rotate(-90deg);
}

/* Boolean filters */
.izysearch-filter-toggles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ais-ToggleRefinement-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--izy-text);
}

.ais-ToggleRefinement-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--izy-text);
    cursor: pointer;
}

.ais-ToggleRefinement-count {
    color: var(--izy-text-muted);
    font-size: 12px;
}

/* ==========================================================================
   Refinement list (categories, brands)
   ========================================================================== */
.ais-RefinementList-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ais-RefinementList-item {
    margin-bottom: 4px;
}

.ais-RefinementList-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--izy-text);
    padding: 4px 0;
    transition: color var(--izy-transition-fast);
}

.ais-RefinementList-label:hover {
    color: var(--izy-text);
    background: rgba(0, 0, 0, 0.03);
    border-radius: var(--izy-radius-xs);
}

.ais-RefinementList-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1.5px solid rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: border-color var(--izy-transition-fast), background-color var(--izy-transition-fast), box-shadow var(--izy-transition-fast);
}

.ais-RefinementList-checkbox:hover {
    border-color: rgba(0, 0, 0, 0.35);
}

.ais-RefinementList-checkbox:checked {
    background-color: var(--izy-accent);
    border-color: var(--izy-accent);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.ais-RefinementList-checkbox:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 5.5px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.ais-RefinementList-labelText {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ais-RefinementList-count {
    color: var(--izy-text-muted);
    font-size: 12px;
    flex-shrink: 0;
}

.ais-RefinementList-item--selected .ais-RefinementList-label {
    color: var(--izy-text);
    font-weight: 600;
}

/* Search within refinement list */
.ais-RefinementList-searchBox {
    margin-bottom: 8px;
    position: relative;
}

.ais-RefinementList-searchBox .ais-SearchBox-form {
    position: relative;
}

.ais-RefinementList-searchBox .ais-SearchBox-input {
    width: 100%;
    padding: 10px 36px 10px 14px;
    background: var(--izy-bg-page);
    color: var(--izy-text);
    border: 1.5px solid var(--izy-border);
    border-radius: var(--izy-radius-xs);
    font-size: 13px;
    outline: none;
    transition: border-color var(--izy-transition-fast), background-color var(--izy-transition-fast);
}

.ais-RefinementList-searchBox .ais-SearchBox-input::placeholder {
    color: var(--izy-text-muted);
}

.ais-RefinementList-searchBox .ais-SearchBox-input:focus {
    border-color: rgba(0, 0, 0, 0.18);
    background: var(--izy-bg);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.03);
}

.ais-RefinementList-searchBox .ais-SearchBox-submit {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ais-RefinementList-searchBox .ais-SearchBox-submit svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: var(--izy-text-muted);
    stroke-width: 2;
}

.ais-RefinementList-searchBox .ais-SearchBox-reset,
.ais-RefinementList-searchBox .ais-SearchBox-loadingIndicator {
    display: none;
}

/* Show more */
.ais-RefinementList-showMore {
    background: none;
    border: none;
    color: var(--izy-text-muted);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 0;
    margin-top: 4px;
    font-weight: 500;
    text-decoration: underline;
}

.ais-RefinementList-showMore:hover {
    color: var(--izy-text);
    background: rgba(0, 0, 0, 0.04);
    border-radius: var(--izy-radius-xs);
}

.ais-RefinementList-showMore--disabled {
    display: none;
}

/* ==========================================================================
   Price range slider (custom dual-handle)
   ========================================================================== */
.izysearch-range-slider {
    padding: 8px 4px 4px;
}

.izysearch-range-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--izy-text);
}

.izysearch-range-track-wrap {
    position: relative;
    height: 24px;
    display: flex;
    align-items: center;
}

.izysearch-range-track {
    position: absolute;
    width: 100%;
    height: 4px;
    background: var(--izy-border);
    border-radius: 2px;
}

.izysearch-range-fill {
    position: absolute;
    height: 4px;
    background: var(--izy-accent);
    border-radius: 2px;
    pointer-events: none;
}

.izysearch-range-input {
    position: absolute;
    width: 100%;
    height: 24px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

.izysearch-range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--izy-bg);
    border: 2px solid var(--izy-text);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: transform var(--izy-transition-fast), box-shadow var(--izy-transition-fast);
}

.izysearch-range-input::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.izysearch-range-input::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--izy-bg);
    border: 2px solid var(--izy-text);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.izysearch-range-input::-moz-range-track {
    background: transparent;
    border: none;
}

/* Legacy rangeInput fallback (hide if still rendered) */
.ais-RangeInput-form {
    display: none;
}

/* ==========================================================================
   Mobile filter actions (fixed bottom bar)
   ========================================================================== */
.izysearch-filter-actions {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100002;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding: 1rem 1.25rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    gap: 0.75rem;
}

.izysearch-filter-actions.active {
    display: flex;
}

.izysearch-filter-actions-btn {
    flex: 1;
    padding: 0.875rem;
    text-align: center;
    border-radius: var(--izy-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity var(--izy-transition-fast);
}

.izysearch-filter-actions-btn:active {
    opacity: 0.8;
}

.izysearch-filter-actions-reset {
    background: var(--izy-bg-page);
    color: var(--izy-text);
    border: 1px solid var(--izy-border);
}

.izysearch-filter-actions-apply {
    background: var(--izy-accent);
    color: #fff;
    border: none;
}

/* ==========================================================================
   Main content area
   ========================================================================== */
.izysearch-content {
    flex: 1;
    min-width: 0;
}

.izysearch-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--izy-border);
    flex-wrap: wrap;
    gap: 12px;
}

.izysearch-content-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--izy-text);
    margin: 0;
}

.izysearch-hidden-mobile {
    display: block;
}

.izysearch-hidden-desktop {
    display: none;
}

/* Mobile filter toggle */
.izysearch-mobile-filter-toggle {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.125rem;
    border: 1.5px solid var(--izy-border);
    border-radius: var(--izy-radius-sm);
    background: var(--izy-bg);
    color: var(--izy-text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color var(--izy-transition-fast), background-color var(--izy-transition-fast);
}

.izysearch-mobile-filter-toggle:hover {
    border-color: #9ca3af;
    background: var(--izy-bg-hover);
}

/* Sort */
.ais-SortBy-select {
    padding: 10px 36px 10px 14px;
    border: 1.5px solid var(--izy-border);
    border-radius: var(--izy-radius-sm);
    font-size: 14px;
    color: var(--izy-text);
    background: var(--izy-bg);
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    transition: border-color var(--izy-transition-fast);
}

.ais-SortBy-select:focus {
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.03);
}

/* ==========================================================================
   Active filters pills
   ========================================================================== */
.izysearch-active-filters-container {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    min-height: 36px;
}

.izysearch-active-filters-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--izy-text-muted);
    margin-right: 0.75rem;
    white-space: nowrap;
}

.izysearch-no-filters-message {
    font-size: 0.875rem;
    color: var(--izy-text-muted);
    font-style: italic;
    white-space: nowrap;
}

.izysearch-active-filters-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.izysearch-active-filters-wrapper::-webkit-scrollbar {
    display: none;
}

.izysearch-active-filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.75rem;
    align-items: center;
}

.izysearch-filter-pill {
    display: flex;
    align-items: center;
    background-color: var(--izy-accent);
    color: white;
    border-radius: 20px;
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
    height: 30px;
    transition: opacity var(--izy-transition-fast);
}

.izysearch-filter-pill:hover {
    background-color: color-mix(in srgb, var(--izy-accent) 85%, black);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.izysearch-filter-pill-delete {
    background: none;
    border: none;
    color: white;
    margin-left: 0.5rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    transition: background-color var(--izy-transition-fast), transform var(--izy-transition-fast);
}

.izysearch-filter-pill-delete:hover {
    background-color: rgba(255, 255, 255, 0.35);
    transform: scale(1.1);
}

.izysearch-filter-pill-delete::before {
    content: '\00d7';
    font-size: 12px;
    line-height: 1;
}

/* ==========================================================================
   Product grid (hits)
   ========================================================================== */
.ais-Hits-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.ais-Hits-item {
    padding: 0;
}

.ais-Hits--empty {
    text-align: center;
    padding: 80px 24px;
    color: var(--izy-text-muted);
    font-size: 16px;
}

/* Hit card */
.izysearch-hit {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--izy-bg);
    border-radius: var(--izy-radius);
    overflow: hidden;
    box-shadow: var(--izy-shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: transform var(--izy-transition-normal), box-shadow var(--izy-transition-normal), border-color var(--izy-transition-normal);
}

.izysearch-hit:hover {
    transform: translateY(-2px);
    box-shadow: var(--izy-shadow-hover);
    border-color: rgba(0, 0, 0, 0.06);
}

/* Image */
.izysearch-hit-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--izy-bg-page);
}

.izysearch-hit-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.75rem;
    transition: transform var(--izy-transition-slow);
}

.izysearch-hit:hover .izysearch-hit-image img {
    transform: scale(1.04);
}

.izysearch-hit-image a {
    display: block;
    width: 100%;
    height: 100%;
}

/* Badges */
.izysearch-hit-badges {
    position: absolute;
    top: 0.875rem;
    left: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 5px;
    z-index: 2;
}

.izysearch-badge {
    display: inline-block;
    padding: 0.3rem 0.625rem;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.izysearch-badge--promo {
    background: var(--izy-promo);
    color: #fff;
}

.izysearch-badge--new {
    background: var(--izy-accent);
    color: #fff;
}

/* Hit info */
.izysearch-hit-info {
    padding: 1rem 1rem 1.125rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.izysearch-hit-brand {
    text-transform: uppercase;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #525960; /* UI-035: WCAG AA compliant contrast ratio */
    margin-bottom: 0.375rem;
    letter-spacing: 0.06em;
}

.izysearch-hit-name {
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.875rem;
    color: var(--izy-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.45;
    letter-spacing: -0.005em;
    flex: 1;
}

.izysearch-hit-name a {
    color: inherit;
    text-decoration: none;
    transition: color var(--izy-transition-fast);
}

.izysearch-hit-name a:hover {
    color: var(--izy-text-muted);
}

/* Bottom row: price + cart */
.izysearch-hit-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
}

.izysearch-hit-prices {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.izysearch-hit-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--izy-text);
    letter-spacing: -0.02em;
}

.izysearch-hit-price--sale {
    color: var(--izy-promo);
}

.izysearch-hit-price--original {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--izy-text-muted);
    text-decoration: line-through;
}

/* Cart button */
.izysearch-hit-cart {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--izy-border);
    border-radius: 50%;
    background: var(--izy-bg);
    cursor: pointer;
    transition: background-color var(--izy-transition-fast), border-color var(--izy-transition-fast), transform var(--izy-transition-fast);
    padding: 0;
}

.izysearch-hit-cart svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: var(--izy-text-muted);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke var(--izy-transition-fast);
}

.izysearch-hit-cart:hover {
    background: var(--izy-accent);
    border-color: var(--izy-accent);
    transform: scale(1.06);
}

.izysearch-hit-cart:hover svg {
    stroke: #fff;
}

.izysearch-hit-cart:active {
    transform: scale(0.95);
}

.izysearch-hit-cart--loading {
    opacity: 0.5;
    pointer-events: none;
}

.izysearch-hit-cart--success {
    background: var(--izy-success);
    border-color: var(--izy-success);
}

.izysearch-hit-cart--success svg {
    stroke: #fff;
}

/* No results */
.izysearch-no-results {
    padding: 2.5rem 1.25rem;
    text-align: center;
    background: var(--izy-bg);
    border-radius: var(--izy-radius);
    box-shadow: var(--izy-shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.izysearch-no-results p {
    font-size: 1rem;
    color: var(--izy-text-muted);
    margin-bottom: 1rem;
    line-height: 1.6;
}

/* Zero-result recommendations (best sellers fallback) */
.izysearch-recommendations {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    text-align: left;
}

.izysearch-recommendations-title {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 0 0 1.25rem;
    text-align: center;
    color: var(--izy-text, inherit);
}

/* Recommendations grid — fixed responsive columns (max 4 per row).
   Desktop: 4 columns, tablet: 3 columns, mobile: 2 columns.
   Overrides the `.ais-Hits-list` rule because recommendations share that class. */
.izysearch-recommendations-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 1.25rem !important;
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

/* Direct <article> children (no <li> wrapper) — ensure cards fill their grid cell */
.izysearch-recommendations-grid > .izysearch-hit {
    height: 100%;
    margin: 0;
    min-width: 0;
}

.izysearch-recommendations-grid .izysearch-hit-name a,
.izysearch-recommendations-grid .izysearch-hit-image a {
    color: var(--izy-text) !important;
    text-decoration: none !important;
}

@media (max-width: 991px) {
    .izysearch-recommendations-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 575px) {
    .izysearch-recommendations-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.75rem !important;
    }
}

/* Safety net: the view-toggle may add .izysearch-list-view to any .ais-Hits-list
   inside #izysearch-hits (recommendations share that class). Force column layout
   on recommendation cards so they never render as list items. */
.izysearch-recommendations-grid.izysearch-list-view {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}
@media (max-width: 991px) {
    .izysearch-recommendations-grid.izysearch-list-view {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}
@media (max-width: 575px) {
    .izysearch-recommendations-grid.izysearch-list-view {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
.izysearch-recommendations-grid .izysearch-hit {
    flex-direction: column !important;
}
.izysearch-recommendations-grid .izysearch-hit-image {
    width: 100% !important;
    min-width: 0 !important;
}

.izysearch-recommendations-grid:empty {
    min-height: 180px;
    background: linear-gradient(90deg,
        rgba(0, 0, 0, 0.03) 0%,
        rgba(0, 0, 0, 0.06) 50%,
        rgba(0, 0, 0, 0.03) 100%);
    background-size: 200% 100%;
    animation: izy-reco-shimmer 1.2s ease-in-out infinite;
    border-radius: var(--izy-radius, 12px);
}

@keyframes izy-reco-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.ais-Pagination {
    margin-top: 2.5rem;
    display: flex;
    justify-content: center;
}

.ais-Pagination-list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.ais-Pagination-item {
    display: flex;
}

.ais-Pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: var(--izy-radius-xs);
    font-size: 13px;
    font-weight: 500;
    color: var(--izy-text);
    text-decoration: none;
    border: 1px solid transparent;
    background: transparent;
    transition: background-color var(--izy-transition-fast), color var(--izy-transition-fast);
}

.ais-Pagination-link:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--izy-text);
}

.ais-Pagination-item--selected .ais-Pagination-link {
    background: var(--izy-accent);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.ais-Pagination-item--selected .ais-Pagination-link:hover {
    background: color-mix(in srgb, var(--izy-accent) 85%, black);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.ais-Pagination-item--disabled .ais-Pagination-link {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.ais-Pagination-item--firstPage .ais-Pagination-link,
.ais-Pagination-item--lastPage .ais-Pagination-link,
.ais-Pagination-item--previousPage .ais-Pagination-link,
.ais-Pagination-item--nextPage .ais-Pagination-link {
    color: var(--izy-text-muted);
    font-size: 14px;
}

/* Overlay-scoped pagination — prevent PrestaShop theme overrides */
.izysearch-overlay .ais-Pagination-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: var(--izy-radius-xs);
    font-size: 13px;
    font-weight: 500;
    color: var(--izy-text) !important;
    text-decoration: none !important;
    border: 1px solid transparent;
    background: transparent;
}

.izysearch-overlay .ais-Pagination-link:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--izy-text) !important;
}

.izysearch-overlay .ais-Pagination-item--firstPage .ais-Pagination-link,
.izysearch-overlay .ais-Pagination-item--lastPage .ais-Pagination-link,
.izysearch-overlay .ais-Pagination-item--previousPage .ais-Pagination-link,
.izysearch-overlay .ais-Pagination-item--nextPage .ais-Pagination-link {
    color: var(--izy-text-muted) !important;
}

.izysearch-overlay .ais-Pagination-item--selected .ais-Pagination-link {
    background: var(--izy-accent);
    color: #fff !important;
    font-weight: 600;
    border-radius: var(--izy-radius-xs);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.izysearch-overlay .ais-Pagination-item--selected .ais-Pagination-link:hover {
    background: color-mix(in srgb, var(--izy-accent) 85%, black);
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.izysearch-overlay .ais-Pagination-item--disabled .ais-Pagination-link {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

/* ==========================================================================
   Highlight
   ========================================================================== */
.ais-Highlight-highlighted,
.ais-Snippet-highlighted {
    background: rgba(254, 243, 199, 0.7);
    color: var(--izy-text);
    font-style: normal;
    border-radius: 2px;
    padding: 0 1px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1199px) {
    .ais-Hits-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 991px) {
    .izysearch-layout {
        gap: 2rem;
    }

    .izysearch-sidebar {
        width: 240px;
        min-width: 240px;
    }
}

@media (max-width: 767px) {
    .izysearch-layout {
        flex-direction: column;
    }

    /* Sidebar becomes drawer on mobile */
    .izysearch-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 85%;
        max-width: 340px;
        min-width: auto;
        height: 100vh;
        max-height: 100vh;
        background: var(--izy-bg);
        z-index: 100001;
        transform: translateX(-100%);
        transition: transform var(--izy-transition-normal);
        box-shadow: var(--izy-shadow-lg);
        padding: 1.25rem;
        overflow-y: auto;
    }

    .izysearch-sidebar.active {
        transform: translateX(0);
    }

    .izysearch-sidebar .izysearch-sidebar-title {
        display: none;
    }

    .izysearch-sidebar-close-title {
        display: flex;
    }

    .izysearch-mobile-filter-toggle {
        display: flex;
    }

    .izysearch-hidden-mobile {
        display: none;
    }

    .izysearch-hidden-desktop {
        display: block;
        margin-bottom: 1rem;
    }

    .ais-Hits-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .ais-Pagination-list {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Overlay adjustments for mobile */
    .izysearch-overlay-header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .izysearch-overlay-close {
        width: 36px;
        height: 36px;
    }

    .izysearch-overlay-switchers {
        order: 3;
        width: 100%;
        justify-content: flex-end;
    }

    .izysearch-overlay-searchbox-wrap .ais-SearchBox-input {
        padding: 10px 72px 10px 16px;
        font-size: 15px;
    }

    /* Toolbar spacing on mobile */
    .izysearch-toolbar {
        margin-bottom: 16px;
        padding-bottom: 14px;
        gap: 8px;
    }

    .izysearch-content-title {
        font-size: 12px;
    }

    /* Layout breathing room on mobile */
    .izysearch-layout {
        padding: 1rem;
        gap: 1rem;
    }

    /* Override .izysearch-overlay-body .izysearch-sidebar (higher specificity)
       so the sidebar uses the mobile drawer pattern inside the overlay too */
    .izysearch-overlay-body .izysearch-sidebar {
        position: fixed;
        max-height: 100vh;
        overflow-y: auto;
    }

    /* Account for wrapped header (searchbox + switchers on separate lines) */
    .izysearch-overlay-body {
        padding-top: 110px;
    }
}

@media (max-width: 479px) {
    .ais-Hits-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.625rem;
    }

    .izysearch-overlay-header {
        padding: 0.75rem;
    }

    .izysearch-hit-info {
        padding: 0.75rem;
    }

    .izysearch-hit-name {
        font-size: 0.8125rem;
        margin-bottom: 0.625rem;
    }

    .izysearch-hit-price {
        font-size: 0.875rem;
    }

}

/* UI-046: Very small screens — single column */
@media (max-width: 359px) {
    .ais-Hits-list {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* ==========================================================================
   UI-001: Skeleton loading placeholders
   ========================================================================== */
.izysearch-skeleton {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.75rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.izysearch-skeleton-card {
    background: var(--izy-bg);
    border-radius: var(--izy-radius);
    overflow: hidden;
    box-shadow: var(--izy-shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.izysearch-skeleton-image {
    aspect-ratio: 1 / 1;
    background: #ebebeb;
}

.izysearch-skeleton-info {
    padding: 1rem;
}

.izysearch-skeleton-line {
    height: 12px;
    border-radius: 6px;
    background: #ebebeb;
    margin-bottom: 10px;
}

.izysearch-skeleton-line--short {
    width: 40%;
}

.izysearch-skeleton-line--medium {
    width: 70%;
}

.izysearch-skeleton-line--price {
    width: 30%;
    height: 16px;
    margin-top: 12px;
    margin-bottom: 0;
}

@media (max-width: 1199px) {
    .izysearch-skeleton { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 767px) {
    .izysearch-skeleton { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
}
@media (max-width: 359px) {
    .izysearch-skeleton { grid-template-columns: 1fr; }
}

/* ==========================================================================
   UI-002 / UI-003: Overlay closing animation class
   ========================================================================== */
.izysearch-overlay.izysearch-overlay--closing {
    opacity: 0;
    transform: translateY(8px) scale(0.99);
    pointer-events: none;
    visibility: hidden;
}

/* ==========================================================================
   UI-004: Results counter (stats widget)
   ========================================================================== */
.izysearch-stats {
    font-size: 0.8125rem;
    color: var(--izy-text-muted);
    font-weight: 500;
    transition: opacity var(--izy-transition-fast);
    min-height: 1.25em;
}

/* UI-053: Counter transition animation */
.izysearch-stats.izysearch-stats--updating {
    opacity: 0.5;
}

/* ==========================================================================
   UI-005: "See all results" button
   ========================================================================== */
.izysearch-see-all-wrap {
    padding: 1.25rem 1.5rem;
    text-align: center;
    border-top: 1px solid var(--izy-border);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* "See all X results" mirrors the selected pagination item (.ais-Pagination-link
   on a selected item) so the autocomplete footer reads as part of the same
   navigation system: same 36px height, same small radius, same accent bg,
   same white text, same subtle box-shadow, same hover tint.
   The `.izysearch-see-all-wrap` parent selector raises specificity above the
   default PrestaShop theme styles that target `<a>` inside content wrappers. */
.izysearch-see-all-wrap .izysearch-see-all-btn,
a.izysearch-see-all-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    background: var(--izy-accent) !important;
    color: #fff !important;
    border: 1px solid transparent;
    border-radius: var(--izy-radius-xs);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    text-decoration: none !important;
    transition: background-color var(--izy-transition-fast), color var(--izy-transition-fast), box-shadow var(--izy-transition-fast);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.izysearch-see-all-wrap .izysearch-see-all-btn:hover,
a.izysearch-see-all-btn:hover {
    background: color-mix(in srgb, var(--izy-accent) 85%, black) !important;
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.izysearch-see-all-wrap .izysearch-see-all-btn:active,
a.izysearch-see-all-btn:active {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.izysearch-see-all-btn svg,
.izysearch-see-all-wrap .izysearch-see-all-btn svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* Ensure the inner text span, any theme-injected <strong>/<em>, and the
   visited-link variant all inherit the forced white color — some themes
   target `a:visited` or `.content a span` to change link color globally. */
.izysearch-see-all-wrap .izysearch-see-all-btn,
.izysearch-see-all-wrap .izysearch-see-all-btn *,
.izysearch-see-all-wrap .izysearch-see-all-btn:visited,
a.izysearch-see-all-btn:visited {
    color: #fff !important;
}

/* ==========================================================================
   UI-006: Quick view button on hover
   ========================================================================== */
/* Quick view button — accent-colored to match the pagination / see-all family.
   Slightly lighter in rest state (88% accent) so it feels like a secondary
   action floating over the product image, and goes full-accent on hover. */
.izysearch-hit-quickview {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    opacity: 0;
    padding: 0 12px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--izy-accent) 88%, transparent);
    color: #fff !important;
    border: 1px solid transparent;
    border-radius: var(--izy-radius-xs);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    z-index: 3;
    transition: opacity var(--izy-transition-fast), transform var(--izy-transition-fast), background-color var(--izy-transition-fast), box-shadow var(--izy-transition-fast);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.izysearch-hit:hover .izysearch-hit-quickview {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.izysearch-hit-quickview:hover {
    background: var(--izy-accent);
    color: #fff !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

/* Quick view modal */
.izysearch-quickview-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 200000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.izysearch-quickview-modal.active {
    display: flex;
    opacity: 1;
}

.izysearch-quickview-content {
    background: var(--izy-bg);
    border-radius: var(--izy-radius);
    box-shadow: var(--izy-shadow-lg);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    animation: izyFadeIn 0.3s ease;
}

.izysearch-quickview-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    color: var(--izy-text);
    font-size: 1.125rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--izy-transition-fast);
}

.izysearch-quickview-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

.izysearch-quickview-image {
    text-align: center;
    margin-bottom: 1.5rem;
}

.izysearch-quickview-image img {
    max-width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--izy-radius-sm);
}

.izysearch-quickview-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--izy-text);
    margin-bottom: 0.5rem;
}

.izysearch-quickview-brand {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--izy-text-muted);
    margin-bottom: 0.75rem;
}

.izysearch-quickview-desc {
    font-size: 0.875rem;
    color: var(--izy-text-muted);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.izysearch-quickview-prices {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 1.25rem;
}

.izysearch-quickview-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.75rem 1.5rem;
    background: var(--izy-accent);
    color: #fff;
    border-radius: var(--izy-radius-sm);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background var(--izy-transition-fast), transform var(--izy-transition-fast);
}

.izysearch-quickview-link:hover {
    background: color-mix(in srgb, var(--izy-accent) 85%, black);
    transform: translateY(-1px);
}

.izysearch-quickview-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.izysearch-quickview-cart {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    background: var(--izy-accent);
    color: #fff;
    border: none;
    border-radius: var(--izy-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--izy-transition-fast), transform var(--izy-transition-fast);
}

.izysearch-quickview-cart:hover {
    background: color-mix(in srgb, var(--izy-accent) 85%, black);
    transform: translateY(-1px);
}

.izysearch-quickview-cart:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.izysearch-quickview-cart svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ==========================================================================
   UI-007: Image gallery dots on hover
   ========================================================================== */
.izysearch-hit-gallery-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 3;
    opacity: 0;
    transition: opacity var(--izy-transition-fast);
}

.izysearch-hit:hover .izysearch-hit-gallery-dots {
    opacity: 1;
}

.izysearch-hit-gallery-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: background var(--izy-transition-fast), transform var(--izy-transition-fast);
}

.izysearch-hit-gallery-dot.active {
    background: var(--izy-accent);
    transform: scale(1.2);
}

.izysearch-hit-gallery-dot:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   UI-008: Out of stock badge
   ========================================================================== */
.izysearch-badge--outofstock {
    background: #6b7280;
    color: #fff;
}

.izysearch-hit-cart--disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==========================================================================
   UI-009: Toast notification for cart
   ========================================================================== */
.izysearch-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 300000;
    background: var(--izy-success);
    color: #fff;
    padding: 14px 24px;
    border-radius: var(--izy-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: var(--izy-shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateX(120%);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.izysearch-toast.active {
    transform: translateX(0);
}

.izysearch-toast svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* ==========================================================================
   UI-010: Combination name display
   ========================================================================== */
.izysearch-hit-combination {
    font-size: 0.75rem;
    color: var(--izy-text-muted);
    margin-bottom: 0.25rem;
}

/* ==========================================================================
   UI-011: Grid/List view toggle
   ========================================================================== */
.izysearch-view-toggle {
    display: flex;
    gap: 4px;
    align-items: center;
}

.izysearch-view-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--izy-border);
    border-radius: var(--izy-radius-xs);
    background: transparent;
    cursor: pointer;
    color: var(--izy-text-muted);
    transition: border-color var(--izy-transition-fast), color var(--izy-transition-fast), background var(--izy-transition-fast);
}

.izysearch-view-btn.active {
    border-color: var(--izy-text);
    color: var(--izy-text);
    background: rgba(0, 0, 0, 0.03);
}

.izysearch-view-btn:hover:not(.active) {
    border-color: #9ca3af;
}

.izysearch-view-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* List view mode */
.izysearch-hits-grid.izysearch-list-view {
    grid-template-columns: 1fr !important;
    gap: 1rem;
}

.izysearch-list-view .izysearch-hit {
    flex-direction: row;
}

.izysearch-list-view .izysearch-hit-image {
    width: 160px;
    min-width: 160px;
    aspect-ratio: 1/1;
}

.izysearch-list-view .izysearch-hit-info {
    padding: 1.25rem;
}

.izysearch-list-view .izysearch-hit-name {
    -webkit-line-clamp: 1;
}

@media (max-width: 767px) {
    .izysearch-list-view .izysearch-hit-image {
        width: 100px;
        min-width: 100px;
    }
}

/* ==========================================================================
   UI-012: Infinite scroll loader
   ========================================================================== */
.izysearch-infinite-loader {
    text-align: center;
    padding: 2rem;
}

.izysearch-infinite-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--izy-border);
    border-top-color: var(--izy-text);
    border-radius: 50%;
    animation: izyInfiniteSpin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes izyInfiniteSpin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   UI-013: Sticky header in overlay — iOS Safari fix (translateZ forces GPU layer)
   ========================================================================== */

/* ==========================================================================
   UI-014: Empty state for overlay
   ========================================================================== */
.izysearch-empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--izy-text-muted);
}

.izysearch-empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.25rem;
    opacity: 0.3;
}

.izysearch-empty-state-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
}

.izysearch-empty-state-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--izy-text);
    margin-bottom: 0.5rem;
}

.izysearch-empty-state-text {
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ==========================================================================
   UI-030: ARIA live region for results
   ========================================================================== */
.izysearch-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   UI-034: Skip to results link
   ========================================================================== */
.izysearch-skip-link {
    position: absolute;
    top: -100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.75rem 1.5rem;
    background: var(--izy-accent);
    color: #fff;
    border-radius: var(--izy-radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    z-index: 200001;
    transition: top var(--izy-transition-fast);
}

.izysearch-skip-link:focus {
    top: 12px;
}

/* ==========================================================================
   UI-035: Improved contrast (WCAG AA) — #525960 has 7:1 ratio on white
   ========================================================================== */
.izysearch-no-filters-message {
    color: #525960;
}

.ais-RefinementList-count {
    color: #525960;
}

.ais-ToggleRefinement-count {
    color: #525960;
}

/* ==========================================================================
   UI-040: Touch target sizes (min 44x44px)
   ========================================================================== */
.ais-RefinementList-label {
    min-height: 44px;
    padding: 8px 0;
}

.ais-RefinementList-checkbox {
    width: 22px;
    height: 22px;
}

.ais-RefinementList-checkbox:checked::after {
    top: 4px;
    left: 7px;
    width: 5px;
    height: 9px;
}

.ais-ToggleRefinement-checkbox {
    width: 22px;
    height: 22px;
}

.izysearch-hit-cart {
    width: 44px;
    height: 44px;
}

.ais-Pagination-link {
    min-width: 44px;
    height: 44px;
}

.izysearch-overlay .ais-Pagination-link {
    min-width: 44px;
    height: 44px;
}

.izysearch-mobile-filter-toggle {
    min-height: 44px;
}

.izysearch-filter-actions-btn {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   UI-043: Sticky mini search bar on mobile
   ========================================================================== */
@media (max-width: 767px) {
    #izysearch-wrapper .izysearch-header-search-sticky {
        position: sticky;
        top: 0;
        z-index: 100;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        padding: 0.5rem 0;
        margin: -1rem -1rem 1rem -1rem;
        padding-left: 1rem;
        padding-right: 1rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }
}

/* ==========================================================================
   UI-044: iOS Safari overlay fix
   ========================================================================== */
.izysearch-body-locked {
    position: fixed !important;
    width: 100% !important;
    overflow: hidden !important;
}

/* ==========================================================================
   UI-045: Safe area inset support
   ========================================================================== */
.izysearch-overlay-header {
    padding-top: calc(1.125rem + env(safe-area-inset-top, 0px));
    padding-left: calc(1.25rem + env(safe-area-inset-left, 0px));
    padding-right: calc(1.25rem + env(safe-area-inset-right, 0px));
}

.izysearch-overlay-body {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (max-width: 767px) {
    .izysearch-overlay-header {
        padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
        padding-left: calc(1rem + env(safe-area-inset-left, 0px));
        padding-right: calc(1rem + env(safe-area-inset-right, 0px));
    }
}

/* ==========================================================================
   UI-050: Cart fly animation / pulse
   ========================================================================== */
@keyframes izyCartPulse {
    0% { transform: scale(1); }
    30% { transform: scale(1.25); }
    60% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.izysearch-cart-pulse {
    animation: izyCartPulse 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ==========================================================================
   UI-051: Filter pill removal animation
   ========================================================================== */
.izysearch-filter-pill.izysearch-pill-removing {
    animation: izyPillSlideOut 0.25s ease forwards;
}

@keyframes izyPillSlideOut {
    to {
        opacity: 0;
        transform: translateX(-10px) scale(0.9);
    }
}

/* ==========================================================================
   UI-052: Ripple effect on buttons
   ========================================================================== */
.izysearch-ripple {
    position: relative;
    overflow: hidden;
}

.izysearch-ripple-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0);
    animation: izyRipple 0.6s ease-out;
    pointer-events: none;
}

@keyframes izyRipple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ==========================================================================
   UI-054: Advanced hover state on cards
   ========================================================================== */
.izysearch-hit:hover {
    transform: translateY(-3px);
    box-shadow: var(--izy-shadow-hover);
    border-color: rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   UI-055: Loading indicator in overlay search bar
   ========================================================================== */
.izysearch-searchbar-progress {
    position: absolute;
    bottom: 0;
    left: 5%;
    right: 5%;
    height: 2px;
    border-radius: 1px;
    background: var(--izy-border);
    overflow: hidden;
    opacity: 0;
    transition: opacity var(--izy-transition-fast);
}

.izysearch-searchbar-progress.active {
    opacity: 1;
}

.izysearch-searchbar-progress-bar {
    height: 100%;
    width: 30%;
    background: var(--izy-accent);
    border-radius: 1px;
    animation: izySearchProgress 1.2s ease-in-out infinite;
}

@keyframes izySearchProgress {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(400%); }
}

/* ==========================================================================
   UI-056: Debounce feedback
   ========================================================================== */
.izysearch-header-input.izysearch-debouncing {
    opacity: 0.65;
    transition: opacity 0.1s ease;
}

/* ==========================================================================
   UI-037: aria-busy loading state
   ========================================================================== */
[aria-busy="true"] {
    opacity: 0.6;
    transition: opacity var(--izy-transition-fast);
    pointer-events: none;
}

/* ==========================================================================
   UI-060: Discount percentage badge
   ========================================================================== */
.izysearch-badge--discount {
    background: var(--izy-promo);
    color: #fff;
}

/* ==========================================================================
   UI-062: Inline "Clear all" button next to active filter pills
   ========================================================================== */
.izysearch-clear-all-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--izy-text-muted);
    background: none;
    border: 1.5px solid var(--izy-border);
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    height: 30px;
    transition: border-color var(--izy-transition-fast), color var(--izy-transition-fast), background var(--izy-transition-fast);
}

.izysearch-clear-all-inline:hover {
    border-color: var(--izy-promo);
    color: var(--izy-promo);
    background: rgba(220, 38, 38, 0.04);
}

/* ==========================================================================
   UI-063: Placeholder for missing product images
   ========================================================================== */
.izysearch-hit-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--izy-bg-page);
    color: var(--izy-border);
}

.izysearch-hit-image-placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.4;
}

/* ==========================================================================
   UI-064: Hits list — no animation (IS.js re-renders DOM on each query,
   which causes visible "vibration" if animated)
   ========================================================================== */

/* ==========================================================================
   UI-065: Filter count badge on mobile toggle
   ========================================================================== */
.izysearch-filter-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    background: var(--izy-accent);
    color: #fff;
    border-radius: 10px;
    margin-left: 6px;
}

/* ==========================================================================
   UI-068: Filter applied highlight feedback
   ========================================================================== */
@keyframes izyFilterFlash {
    0% { background: transparent; }
    30% { background: rgba(0, 0, 0, 0.03); }
    100% { background: transparent; }
}

.izysearch-filter-section--highlight {
    animation: izyFilterFlash 0.6s ease;
}

/* ==========================================================================
   UI-070: Back to top button
   ========================================================================== */
.izysearch-back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--izy-accent);
    color: #fff;
    border: none;
    box-shadow: var(--izy-shadow-md);
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity var(--izy-transition-fast), visibility var(--izy-transition-fast), transform var(--izy-transition-fast), background var(--izy-transition-fast);
}

.izysearch-back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.izysearch-back-to-top:hover {
    background: color-mix(in srgb, var(--izy-accent) 82%, black);
    box-shadow: var(--izy-shadow-hover);
}

.izysearch-back-to-top:active {
    transform: scale(0.92);
}

.izysearch-back-to-top svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ==========================================================================
   UI-071: Smooth pagination transition
   ========================================================================== */
@keyframes izyPageTransition {
    0% { opacity: 0.4; }
    100% { opacity: 1; }
}

.izysearch-page-transitioning .ais-Hits-list {
    animation: izyPageTransition 0.3s ease;
}

/* ==========================================================================
   UI-073: Short description in list view
   ========================================================================== */
.izysearch-hit-description-short {
    display: none;
    font-size: 0.8125rem;
    color: var(--izy-text-muted);
    line-height: 1.5;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.izysearch-list-view .izysearch-hit-description-short {
    display: -webkit-box;
}

/* ==========================================================================
   UI-075: Card items — no stagger animation (IS.js re-creates DOM on each
   render event, causing repeated "vibration" effect)
   ========================================================================== */

/* UI-076: Dark mode removed — widget always uses defined theme colors */

/* ==========================================================================
   UI-090: Error announcement for screen readers
   ========================================================================== */
.izysearch-error-announcement {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   UI-094: Reduced motion support
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .izysearch-overlay {
        transition: none;
    }

    .izysearch-overlay.izysearch-overlay--closing {
        transition: none;
    }

    .izysearch-hit {
        transition: none;
    }

    .izysearch-hit:hover {
        transform: none;
    }

    .izysearch-skeleton-image,
    .izysearch-skeleton-line {
        animation: none;
        background: #e5e5e5;
    }

    .izysearch-searchbar-progress-bar {
        animation: none;
    }
}

/* ==========================================================================
   UI-095: Quick view button contrast on dark images
   ========================================================================== */
.izysearch-hit-quickview {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

/* ==========================================================================
   UI-100: Sidebar backdrop for mobile filter drawer
   ========================================================================== */
.izysearch-sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 100000;
    opacity: 0;
    transition: opacity var(--izy-transition-normal);
}

.izysearch-sidebar-backdrop.active {
    display: block;
    opacity: 1;
}

/* ==========================================================================
   UI-102: iOS Safari auto-zoom fix on search input
   ========================================================================== */
@media (max-width: 767px) {
    .izysearch-overlay-searchbox-wrap .ais-SearchBox-input {
        font-size: 16px;
    }
}

/* ==========================================================================
   UI-103: Bottom sheet filter on small screens
   ========================================================================== */
@media (max-width: 479px) {
    .izysearch-sidebar {
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        width: 100%;
        max-width: 100%;
        height: 85vh;
        max-height: 85vh;
        transform: translateY(100%);
        border-radius: var(--izy-radius) var(--izy-radius) 0 0;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    }

    .izysearch-sidebar.active {
        transform: translateY(0);
    }

    .izysearch-overlay-body .izysearch-sidebar {
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        width: 100%;
        max-width: 100%;
        height: 85vh;
        max-height: 85vh;
        transform: translateY(100%);
        border-radius: var(--izy-radius) var(--izy-radius) 0 0;
    }

    .izysearch-overlay-body .izysearch-sidebar.active {
        transform: translateY(0);
    }

    /* Bottom sheet drag indicator */
    .izysearch-sidebar::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: var(--izy-border);
        border-radius: 2px;
        margin: 8px auto 12px;
    }
}

/* ==========================================================================
   UI-105: Landscape mode grid adaptation
   ========================================================================== */
@media (orientation: landscape) and (max-height: 500px) {
    .ais-Hits-list {
        grid-template-columns: repeat(3, 1fr);
    }

    .izysearch-overlay-header {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .izysearch-overlay-body {
        padding-top: 60px;
    }
}

/* ==========================================================================
   UI-110: Type-ahead placeholder animation
   ========================================================================== */
@keyframes izyPlaceholderBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.izysearch-header-input.izysearch-placeholder-animating::placeholder {
    transition: opacity 0.3s ease;
}

/* ==========================================================================
   UI-111: Add-to-cart error shake animation
   ========================================================================== */
@keyframes izyShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.izysearch-hit-cart--error {
    animation: izyShake 0.4s ease;
    border-color: var(--izy-promo) !important;
}

.izysearch-toast--error {
    background: var(--izy-promo) !important;
}

/* ==========================================================================
   UI-112: Grid/List view transition
   ========================================================================== */
.izysearch-hits-grid {
    transition: opacity 0.2s ease;
}

.izysearch-view-transitioning {
    opacity: 0.5;
}

/* ==========================================================================
   UI-113: Filter pill entry animation (one-shot, not on every render)
   ========================================================================== */
@keyframes izyPillSlideIn {
    from {
        opacity: 0;
        transform: translateX(10px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.izysearch-filter-pill.izysearch-pill-entering {
    animation: izyPillSlideIn 0.25s ease;
}

/* ==========================================================================
   UI-114: Hover glow on cart button
   ========================================================================== */
.izysearch-hit-cart:hover {
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   UI-115: Stackable toast notifications
   ========================================================================== */
.izysearch-toast {
    right: 20px;
}

.izysearch-toast:nth-child(1) { top: 20px; }
.izysearch-toast:nth-child(2) { top: 76px; }
.izysearch-toast:nth-child(3) { top: 132px; }

/* ==========================================================================
   Highlight: Use CSS variable (UI-060+ dark mode support)
   ========================================================================== */
.ais-Highlight-highlighted,
.ais-Snippet-highlighted {
    background: var(--izy-highlight);
}

/* ==========================================================================
   Out of stock badge: Use CSS variable
   ========================================================================== */
.izysearch-badge--outofstock {
    background: var(--izy-out-of-stock);
}

/* ==========================================================================
   UI-130: Overlay header semi-transparent adapted to theme
   Use color-mix with --izy-bg instead of hardcoded rgba(255,255,255,...)
   ========================================================================== */
/* (Applied inline below via overrides on overlay-header, see-all-wrap, filter-actions) */

/* ==========================================================================
   UI-131: Toggle checkbox accent color to use --izy-accent
   ========================================================================== */
.ais-ToggleRefinement-checkbox {
    accent-color: var(--izy-accent);
}

/* ==========================================================================
   UI-132: Focus ring adapted to accent color
   ========================================================================== */
.izysearch-overlay-searchbox-wrap .ais-SearchBox-input:focus {
    border-color: var(--izy-accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--izy-accent) 15%, transparent);
}

.ais-RefinementList-searchBox .ais-SearchBox-input:focus {
    border-color: var(--izy-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--izy-accent) 10%, transparent);
}

.ais-SortBy-select:focus {
    border-color: var(--izy-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--izy-accent) 10%, transparent);
}

/* ==========================================================================
   UI-133: Replace hardcoded borders with var(--izy-border)
   ========================================================================== */
.izysearch-header-input {
    border-bottom-color: var(--izy-border);
}

.ais-RefinementList-checkbox {
    border-color: var(--izy-border);
}

.ais-RefinementList-checkbox:hover {
    border-color: color-mix(in srgb, var(--izy-border) 70%, var(--izy-text) 30%);
}

.izysearch-switcher-btn:hover {
    border-color: color-mix(in srgb, var(--izy-border) 50%, var(--izy-text) 50%);
}

.izysearch-mobile-filter-toggle:hover {
    border-color: color-mix(in srgb, var(--izy-border) 50%, var(--izy-text) 50%);
}

.izysearch-view-btn:hover:not(.active) {
    border-color: color-mix(in srgb, var(--izy-border) 50%, var(--izy-text) 50%);
}

.izysearch-overlay-header {
    border-bottom-color: var(--izy-border);
}

/* ==========================================================================
   UI-134: Shadow color variable for theme adaptability
   ========================================================================== */
:root {
    --izy-shadow-color: 0, 0, 0;
}


/* ==========================================================================
   UI-135: Quick view backdrop adapted to theme
   ========================================================================== */
.izysearch-quickview-modal {
    background: color-mix(in srgb, var(--izy-text) 50%, transparent);
}

/* ==========================================================================
   UI-130 (continued): Replace hardcoded rgba white backgrounds with
   color-mix using --izy-bg for theme adaptability
   ========================================================================== */
.izysearch-overlay-header {
    background-color: color-mix(in srgb, var(--izy-bg) 92%, transparent);
}

.izysearch-see-all-wrap {
    background: color-mix(in srgb, var(--izy-bg) 92%, transparent);
}

.izysearch-filter-actions {
    background: color-mix(in srgb, var(--izy-bg) 95%, transparent);
}

@media (max-width: 767px) {
    #izysearch-wrapper .izysearch-header-search-sticky {
        background: color-mix(in srgb, var(--izy-bg) 95%, transparent);
    }
}

/* ==========================================================================
   UI-066: Star ratings on product cards (if rating data available)
   ========================================================================== */
.izysearch-hit-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 0.375rem;
}

.izysearch-hit-stars {
    display: flex;
    gap: 1px;
}

.izysearch-hit-star {
    width: 12px;
    height: 12px;
    color: #e5e7eb;
}

.izysearch-hit-star--filled {
    color: #f59e0b;
}

.izysearch-hit-star--half {
    color: #f59e0b;
}

.izysearch-hit-rating-count {
    font-size: 0.6875rem;
    color: var(--izy-text-muted);
}

/* ==========================================================================
   UI-061: Active filter pill with result count
   ========================================================================== */
.izysearch-filter-pill-count {
    font-size: 0.6875rem;
    font-weight: 400;
    opacity: 0.8;
    margin-left: 2px;
}
