/**
 * Nivo AJAX Search for WooCommerce - Styles
 * 
 * Professional CSS with scalable architecture and customization support
 * 
 * @package NivoSearch
 * @since 1.0.0
 */

/* CSS Custom Properties for easy customization */
:root {
    --nivo-search-primary-color: #0073aa;
    --nivo-search-border-color: #ddd;
    --nivo-search-border-radius: 4px;
    --nivo-search-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --nivo-search-transition: all 0.3s ease;
    --nivo-search-font-size-base: 15px;
    --nivo-search-spacing-xs: 5px;
    --nivo-search-spacing-sm: 10px;
    --nivo-search-spacing-md: 15px;
    --nivo-search-spacing-lg: 20px;
    --nivo-search-z-index-dropdown: 1000;

    /* Theme inheritance - can be overridden by settings */
    --nivo-search-font-family: inherit;
    --nivo-search-text-color: inherit;
    --nivo-search-hover-color: inherit;
    --nivo-search-hover-bg: rgba(0, 0, 0, 0.05);
}

/* Main Container */
.nivo-ajax-search-container {
    position: relative;
}

.nivo-search-form-wrapper,
.nivo-search-results {
    max-width: 600px;
    margin: 0 auto;
}

.nivo-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.nivo-search-form {
    margin: 0;
    width: 100%;
}

.nivo-search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
    z-index: 5;
}

.nivo-search-clear-search {
    position: absolute;
    right: 15px;
    top: 47%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 22px;
    color: #999;
    line-height: 1;
    padding: 5px;
    z-index: 10;
    background: none;
    border: none;
    transition: color 0.2s;
}

.nivo-search-clear-search:hover {
    color: #333;
}

button.nivosearch-search-submit {
    overflow: visible;
    position: absolute;
    border: 0;
    padding: 0 15px;
    margin: 0;
    cursor: pointer;
    height: 40px;
    min-width: 50px;
    width: auto;
    line-height: 100%;
    min-height: 100%;
    right: 0;
    left: auto;
    top: 0;
    bottom: auto;
    -webkit-transition: 250ms ease-in-out;
    -moz-transition: 251ms ease-in-out;
    -ms-transition: 250ms ease-in-out;
    -o-transition: 250ms ease-in-out;
    transition: 250ms ease-in-out;
    text-transform: uppercase;
    background-color: transparent;
    -webkit-appearance: none;
}

.nivo-search-loader-icons {
    position: absolute;
    right: 50px;
    top: auto;
    width: 30px;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    height: 100%;
}

.nivo-search-loader-icons.nivo-search-close {
    display: flex;
}








/* Search layout */
.nivo-search-search-icon-wrap {
    width: 50px;
    text-align: center;
    position: absolute;
    height: 100%;
    top: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    left: auto;
    right: 0;
}

/* Search Input */
.nivo-search-wrapper input[type=search].nivo-search-product-search {
    height: 50px;
    width: 100%;
    padding: 0 50px 0 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
    transition: var(--nivo-search-transition);
    box-sizing: border-box;
    outline: none;
}

.nivo-search-form .nivo-search-wrapper input[type=search].nivo-search-product-search:focus {
    outline: 0;
    box-shadow: 0 0 9px 1px rgba(0, 0, 0, .06);
    transition: var(--nivo-search-transition);
}

.nivo-search-wrapper .nivo-search-product-search::placeholder {
    color: #999;
}

/* Hide the browser's native clear (×) button on type="search" inputs.
   The plugin renders its own close icon via .nivo-search-close-icon. */
.nivo-search-product-search::-webkit-search-cancel-button,
.nivo-search-product-search::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.nivo-search-form .nivo-search-wrapper {
    margin: 0;
    padding: 0;
}

input.nivo-search-product-search.form-control {
    margin-bottom: 0;
}

/* Loading State */
.nivo-ajax-search-container.nivo-search-loading .nivo-search-wrapper::after {
    content: '';
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #e0e0e0;
    border-top-color: var(--nivo-search-primary-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Results Container — flex column so view-all sticks to bottom */
.nivo-search-results {
    padding: 0;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 450px;
    overflow: hidden;
    z-index: var(--nivo-search-z-index-dropdown);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
    flex-direction: column;
}

.nivo-ajax-search-container.nivo-search-has-results .nivo-search-results,
.nivo-ajax-search-container.nivo-search-no-results .nivo-search-results {
    display: flex;
}

/* Scrollable results area — grows to fill panel, scrolls when results overflow */
.nivo-search-scrollable {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding: 5px;
}

/* Results List */
ul.nivo-search-results-list {
    list-style: none;
    margin: 0 !important;
    padding: 0 !important;
}

.nivo-search-result-item {
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.nivo-search-result-item:last-child {
    border-bottom: none;
}

.nivo-search-result-item:hover {
    background-color: var(--nivo-search-hover-bg);
}

/* Product Link */
.nivo-search-result-item a.nivo-search-product-link {
    display: flex;
    align-items: center;
    text-decoration: none !important;
    color: var(--nivo-search-text-color);
    transition: all 0.2s ease;
    gap: 10px;
    padding: 5px;
    border-radius: 4px;
}

.nivo-search-product-link .amount {
    color: var(--nivo-search-text-color);
}

/* Product Image */
.nivo-search-product-image {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0;
    background: #f0f0f0;
    display: block;
}

/* Product Info */
.nivo-search-product-info {
    flex: 1;
    min-width: 0;
}


.nivo-search-product-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    color: inherit;
    white-space: normal;
    overflow-wrap: anywhere;
    transition: color 0.2s ease;
    min-width: 0;
}

.nivo-search-product-title strong {
    color: #999;
    font-size: 13px;
    font-weight: 600;
    margin-left: 4px;
}

.nivo-search-product-description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    color: inherit;
    opacity: 0.65;
    font-size: 12px;
    line-height: 1.4;
}

.nivo-search-product-categories,
.nivo-search-product-tags {
    display: inline-block;
    color: inherit;
    opacity: 0.6;
    font-size: 12px;
    margin-top: 4px;
}

/* Keyword Highlighting */
.nivo-search-highlight {
    background-color: #fff3cd;
    color: #856404;
    font-weight: 600;
    padding: 1px 2px;
    border-radius: 2px;
}

/* Category Results */
.nivo-search-categories-section,
.nivo-search-tags-section,
.nivo-search-products-section {
    margin-bottom: 10px;
}

.nivo-search-categories-section:last-child,
.nivo-search-tags-section:last-child,
.nivo-search-products-section:last-child {
    margin-bottom: 0;
}

.nivo-search-section-title {
    margin: 0 0 8px 0;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

ul.nivo-search-categories-list,
ul.nivo-search-tags-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nivo-search-category-item,
.nivo-search-tag-item {
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.nivo-search-category-item:last-child,
.nivo-search-tag-item:last-child {
    border-bottom: none;
}

.nivo-search-category-item:hover,
.nivo-search-tag-item:hover {
    background-color: var(--nivo-search-hover-bg);
}

.nivo-search-category-link,
.nivo-search-tag-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none !important;
    color: var(--nivo-search-text-color);
    transition: all 0.2s ease;
    padding: 5px;
    border-radius: 4px;
}

.nivo-search-category-title,
.nivo-search-tag-title {
    font-size: 14px;
    line-height: 1.4;
    color: inherit;
    flex: 1;
}

.nivo-search-category-count,
.nivo-search-tag-count {
    color: #999;
    font-size: 12px;
    font-weight: 500;
}

/* "Did you mean?" suggestion banner */
.nivo-did-you-mean {
    padding: 8px 14px;
    font-size: 13px;
    color: #50575e;
    background: #f0f6fb;
    border-bottom: 1px solid #dde8f0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.nivo-did-you-mean--hiding {
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
}

.nivo-did-you-mean-link {
    color: #0073aa;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.nivo-did-you-mean-link:hover {
    color: #004d80;
}

/* Messages */
.nivo-search-no-results-message,
.nivo-search-error-message {
    padding: 20px;
    margin: 0;
    text-align: center;
    color: #646970;
    font-size: 15px;
}

.nivo-search-no-results-message {
    background: #f8f9fa;
    border-radius: 4px;
}

.nivo-search-error-message {
    color: #d63638;
    background-color: #fef7f7;
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nivo-ajax-search-container {
        max-width: 100%;
    }

    .nivo-search-results {
        max-height: 300px;
    }

    .nivo-search-product-image {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .nivo-search-product-link {
        padding: var(--nivo-search-spacing-xs);
    }

    .nivo-search-product-image,
    .nivo-search-no-image {
        width: 44px;
        height: 44px;
    }

    .nivo-search-product-title {
        font-size: 0.9em;
    }

    .nivo-search-product-price {
        font-size: 0.8em;
    }
}

/* =============================================================
   Phase 2 — Display Layer (Compact)
   ============================================================= */

/* Product item: thumbnail | info column | actions column */
.nivo-search-result-item {
    display: flex;
    align-items: flex-start;
    padding: 8px 10px;
    gap: 9px;
    border-bottom: 1px solid #f0f0f0;
}

.nivo-search-result-item:last-child {
    border-bottom: none;
}

.nivo-search-result-item a.nivo-search-product-link {
    flex-shrink: 0;
    display: block;
    padding: 0;
    line-height: 0;
}

/* Left info column: title → desc → badges stacked tightly */
.nivo-search-product-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Title link — the title wraps to two lines at most and is never squeezed by the
   SKU, which follows it inline and drops to the next line when it does not fit. */
.nivo-search-product-title-link {
    text-decoration: none !important;
    color: inherit;
    min-width: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    line-height: 1.35;
}
.nivo-search-product-title-link:hover .nivo-search-product-title {
    color: var(--nivo-search-primary-color);
}

/* SKU — small and muted, after the title; readable contrast (the old #bbb was too faint) */
.nivo-search-product-sku {
    /* inline-block gives the browser a place to break: the whole SKU drops to the next
       line when it does not fit, instead of the title being split in the middle. */
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: bottom;
    margin-left: 6px;
    font-size: 12px;
    color: #6b6b6b;
    opacity: 0.85;
    white-space: nowrap;
    letter-spacing: 0.2px;
    font-weight: 400;
}

/* Right-side group: price on top, qty + cart below — two stacked rows */
.nivo-search-product-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
}

/* Price inside actions group */
.nivo-search-product-price {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    color: inherit;
    flex-shrink: 0;
}

.nivo-search-product-price .amount {
    color: inherit;
}

/* ---- Stock Status Badge ---- */
.nivo-stock-badge {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.6;
}

.nivo-stock-instock {
    background: #d4edda;
    color: #155724;
}

.nivo-stock-outofstock {
    background: #f8d7da;
    color: #721c24;
}

.nivo-stock-onbackorder {
    background: #fff3cd;
    color: #856404;
}

/* ---- Category Badges ---- */
.nivo-search-category-badges {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
}

.nivo-cat-badge {
    display: inline-block;
    padding: 1px 6px;
    background: #f0f0f0;
    color: #666 !important;
    border-radius: 2px;
    font-size: 12px;
    text-decoration: none !important;
    transition: background 0.15s;
}

.nivo-cat-badge:hover {
    background: #e0e0e0;
    color: #333 !important;
}

/* Chips row: stock · category · ratings on one line */
.nivo-search-meta-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

/* ---- Add to Cart ---- */
.nivo-add-to-cart-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* Icon-only cart button */
.nivo-add-to-cart-btn.nivo-atc-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: var(--nivo-search-primary-color, #0073aa);
    color: #fff !important;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.18s, transform 0.12s;
    flex-shrink: 0;
    line-height: 1;
}

.nivo-add-to-cart-btn.nivo-atc-icon svg {
    display: block;
    pointer-events: none;
}

.nivo-add-to-cart-btn.nivo-atc-icon:hover {
    background: #005d8f;
    transform: scale(1.08);
}

.nivo-add-to-cart-btn.nivo-atc-loading {
    opacity: 0.7;
    cursor: wait;
    transform: none !important;
}

.nivo-add-to-cart-btn.nivo-atc-loading svg {
    animation: nivo-spin 0.7s linear infinite;
}

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

.nivo-add-to-cart-btn.nivo-atc-added {
    background: #4caf50 !important;
    transform: none !important;
}

.nivo-add-to-cart-btn.nivo-atc-variable {
    background: #888;
}

.nivo-add-to-cart-btn.nivo-atc-variable:hover {
    background: #555;
}

.nivo-out-of-stock-label {
    font-size: 10px;
    color: #bbb;
    flex-shrink: 0;
}

/* ---- Quantity Selector (compact) ---- */
.nivo-qty-wrapper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 3px;
    overflow: hidden;
    height: 22px;
}

.nivo-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 22px;
    background: #f5f5f5;
    border: none;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 0;
    color: #555;
    transition: background 0.15s;
    flex-shrink: 0;
}

.nivo-qty-btn:hover {
    background: #e5e5e5;
}

.nivo-qty-input {
    width: 28px;
    height: 22px;
    text-align: center;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    font-size: 11px;
    padding: 0;
    -moz-appearance: textfield;
    background: #fff;
}

.nivo-qty-input::-webkit-inner-spin-button,
.nivo-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ---- View All Results — sticky footer of the results panel ---- */
.nivo-search-view-all {
    flex-shrink: 0;
    border-top: 1px solid #eee;
    padding: 5px 12px;
    text-align: center;
    background: #fafafa;
    line-height: 1.4;
}

.nivo-search-view-all-link {
    font-size: 12px;
    font-weight: 600;
    color: var(--nivo-search-primary-color, #0073aa) !important;
    text-decoration: none !important;
    transition: color 0.2s;
    display: block;
    padding: 4px 8px;
}

.nivo-search-view-all-link:hover {
    text-decoration: underline !important;
}

/* ---- Phase 2 responsive ---- */
@media (max-width: 480px) {
    .nivo-add-to-cart-btn {
        padding: 4px 8px;
        font-size: 11px;
    }
    .nivo-search-product-meta {
        gap: 4px;
    }
    .nivo-qty-wrapper {
        display: none; /* hide qty on very small screens */
    }
}

/* =============================================================
   Search History
   ============================================================= */
.nivo-search-history {
    padding: 8px 0 4px;
}

.nivo-search-history__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 6px;
    border-bottom: 1px solid var(--nivo-search-results-border-color, #e5e7eb);
}

.nivo-search-history__title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #9ca3af;
}

.nivo-search-history__clear {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 11px;
    color: #6b7280;
    padding: 0;
    line-height: 1;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.nivo-search-history__clear:hover {
    color: #111;
}

.nivo-search-history__list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
}

.nivo-search-history__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
}

.nivo-search-history__item:hover {
    background: #f9fafb;
}

.nivo-search-history__query {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    padding: 7px 0;
    text-align: left;
    line-height: 1.3;
}

.nivo-search-history__query svg {
    flex-shrink: 0;
    color: #9ca3af;
}

.nivo-search-history__query:hover {
    color: var(--nivo-search-primary-color, #0073aa);
}

.nivo-search-history__remove {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    line-height: 1;
    border-radius: 3px;
    margin-left: 4px;
}

.nivo-search-history__remove:hover {
    background: #f3f4f6;
    color: #374151;
}

/* =============================================================
   Mobile Search Mode — fullscreen overlay on ≤768px
   ============================================================= */

/* Overlay backdrop */
.nivo-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 99998;
    animation: nivo-fade-in .15s ease;
}

@keyframes nivo-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Fullscreen search wrapper (injected into overlay).
   Total height = 12px padding-top + 44px input + 12px padding-bottom = 68px.
   .nivo-mobile-results top must match this value. */
.nivo-mobile-search-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--nivo-search-bg-color, #fff);
    z-index: 99999;
    padding: 12px 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,.18);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: nivo-slide-down .18s ease;
}

@keyframes nivo-slide-down {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

/* Mobile results panel — full width below the bar.
   Overrides display:none and position:absolute from .nivo-search-results. */
.nivo-mobile-results {
    display: flex;              /* always visible — element only exists when overlay is open */
    flex-direction: column;
    position: fixed;
    top: 68px;                  /* 12px top padding + 44px input height + 12px bottom padding */
    left: 0;
    right: 0;
    bottom: 0;
    max-height: none;           /* override 450px cap from .nivo-search-results */
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--nivo-search-results-bg-color, #fff);
    z-index: 99999;
    border-top: 1px solid var(--nivo-search-results-border-color, #e5e7eb);
    box-shadow: none;           /* override desktop dropdown shadow */
    -webkit-overflow-scrolling: touch;
}

/* Close button inside the mobile bar */
.nivo-mobile-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #374151;
    line-height: 1;
    border-radius: 6px;
    flex-shrink: 0;
}

.nivo-mobile-close-btn:hover {
    background: #f3f4f6;
}

/* Mobile input inside the bar */
.nivo-mobile-input-wrap {
    flex: 1;
    position: relative;
}

.nivo-mobile-input-wrap .nivo-search-product-search {
    width: 100%;
    box-sizing: border-box;
    height: 44px;
    padding: 0 16px;
    font-size: 16px;            /* 16px prevents iOS Safari auto-zoom on focus */
    line-height: 44px;
    border: 1px solid var(--nivo-search-border-color, #ddd);
    border-radius: 8px;
    background: var(--nivo-search-bg-color, #fff);
    color: var(--nivo-search-text-color, #333);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.nivo-mobile-input-wrap .nivo-search-product-search:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

@media (max-width: 768px) {
    /* When mobile overlay is open, prevent body scroll */
    body.nivo-mobile-open {
        overflow: hidden;
    }
}
/* Keyboard navigation: visible highlight for the active result (WCAG 2.4.7). */
.nivo-search-results .nivo-search-option-active,
.nivo-search-results [role="option"].nivo-search-option-active {
    background-color: #eef4ff;
    outline: 2px solid #2271b1;
    outline-offset: -2px;
}

@media (forced-colors: active) {
    .nivo-search-results .nivo-search-option-active {
        outline: 2px solid Highlight;
    }
}

/* =============================================================
   Layouts (2.0.8): search bar styles and result layouts
   Chosen per preset; applied through a class on the search
   wrapper (.nivo-search-bar-*) and on the container
   (.nivo-results-layout-*). "standard" and "list" are the
   defaults and need no extra rules.
   ============================================================= */

/* ---- Search bar: rounded pill ---- */
.nivo-search-bar-pill input[type=search].nivo-search-product-search {
    border-radius: 999px;
    padding-left: 24px;
}

/* ---- Search bar: icon on the left ---- */
.nivo-search-bar-icon-left input[type=search].nivo-search-product-search {
    padding: 0 44px 0 48px;
}
.nivo-search-bar-icon-left .nivo-search-search-icon-wrap {
    left: 0;
    right: auto;
    width: 48px;
}
.nivo-search-bar-icon-left button.nivosearch-search-submit {
    left: 0;
    right: auto;
}
.nivo-search-bar-icon-left .nivo-search-loader-icons {
    right: 6px;
}
.nivo-ajax-search-container.nivo-search-loading .nivo-search-bar-icon-left::after {
    right: 40px;
}

/* ---- Search bar: with a search button ---- */
.nivo-search-bar-button input[type=search].nivo-search-product-search {
    border-radius: 5px 0 0 5px;
    padding-right: 80px;
}
.nivo-search-bar-button .nivo-search-search-icon-wrap {
    width: 56px;
    background: var(--nivo-search-primary-color, #2271b1);
    border-radius: 0 5px 5px 0;
    color: #fff;
}
.nivo-search-bar-button .nivo-search-search-icon-wrap svg,
.nivo-search-bar-button .nivo-search-search-icon-wrap svg path {
    fill: #fff;
}
.nivo-search-bar-button .nivo-search-search-icon-wrap svg circle,
.nivo-search-bar-button .nivo-search-search-icon-wrap svg line {
    stroke: #fff;
}
.nivo-search-bar-button button.nivosearch-search-submit {
    width: 56px;
    min-width: 56px;
}
.nivo-search-bar-button .nivo-search-loader-icons {
    right: 56px;
}
.nivo-ajax-search-container.nivo-search-loading .nivo-search-bar-button::after {
    right: 76px;
}

/* ---- Search bar: minimal underline ---- */
.nivo-search-bar-minimal input[type=search].nivo-search-product-search {
    border-width: 0 0 2px 0;
    border-radius: 0;
    background: transparent !important;
    padding-left: 4px;
    box-shadow: none;
}
.nivo-search-form .nivo-search-bar-minimal input[type=search].nivo-search-product-search:focus {
    box-shadow: none;
    border-bottom-color: var(--nivo-search-primary-color, #2271b1);
}

/* ---- Results: compact (one tight line per product) ---- */
.nivo-results-layout-compact .nivo-search-result-item {
    align-items: center;
    padding: 5px 10px;
    gap: 8px;
}
.nivo-results-layout-compact .nivo-search-result-item > a.nivo-search-product-link,
.nivo-results-layout-compact .nivo-search-product-description,
.nivo-results-layout-compact .nivo-search-meta-chips {
    display: none;
}
.nivo-results-layout-compact .nivo-search-product-actions {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

/* ---- Results: grid of cards ---- */
.nivo-results-layout-grid .nivo-search-results-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    padding: 10px;
}
.nivo-results-layout-grid .nivo-search-result-item,
.nivo-results-layout-grid .nivo-search-result-item:last-child {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 8px;
}
.nivo-results-layout-grid .nivo-search-result-item > a.nivo-search-product-link {
    width: 100%;
}
.nivo-results-layout-grid .nivo-search-product-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
}
.nivo-results-layout-grid .nivo-search-product-title-link {
    flex-wrap: wrap;
    gap: 2px 5px;
}
.nivo-results-layout-grid .nivo-search-product-actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-left: 0;
}
.nivo-results-layout-grid .nivo-qty-wrapper {
    display: none; /* cards are too narrow for a quantity stepper */
}

/* =============================================================
   Search bar style "Icon only": the search box opens when the
   icon is clicked (2.0.8). The box and results float under the
   icon, aligned to its right edge, so it suits headers.
   ============================================================= */
.nivo-search-toggle {
    display: none; /* only the icon-only layout shows it */
}
.nivo-bar-icon {
    display: inline-block;
}
.nivo-bar-icon .nivo-search-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: inherit;
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color .15s;
}
.nivo-bar-icon .nivo-search-toggle:hover,
.nivo-bar-icon.nivo-search-open .nivo-search-toggle {
    background-color: rgba(0, 0, 0, .07);
}
.nivo-bar-icon .nivo-search-toggle:focus-visible {
    outline: 2px solid var(--nivo-search-primary-color, #2271b1);
    outline-offset: 2px;
}
.nivo-bar-icon .nivo-search-form-wrapper {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 99990;
    width: 92vw;
    max-width: 600px;
    margin: 0;
    background: var(--nivo-search-bg-color, #fff);
    border-radius: 6px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .16);
}
.nivo-bar-icon.nivo-search-open .nivo-search-form-wrapper {
    display: block;
}
/* The results panel sits under the box: icon (44px) + gap + bar height + gap. */
.nivo-bar-icon .nivo-search-results {
    left: auto;
    right: 0;
    width: 92vw;
    max-width: 600px;
    margin: 0;
    top: calc(100% + 6px + var(--nivo-bar-h, 50px) + 6px);
}
.nivo-bar-icon.nivo-open-start .nivo-search-form-wrapper,
.nivo-bar-icon.nivo-open-start .nivo-search-results {
    left: 0;
    right: auto;
}
/* Editor preview: show the icon above an already-open box, in normal flow. */
.nivo-preset-preview .nivo-bar-icon {
    display: block;
}
.nivo-preset-preview .nivo-bar-icon .nivo-search-form-wrapper {
    position: static;
    width: 100%;
    max-width: none;
    box-shadow: none;
}
.nivo-preset-preview .nivo-bar-icon .nivo-search-toggle {
    margin-bottom: 6px;
    pointer-events: none;
}
/* A closed icon-only search must not leave its results on screen. */
.nivo-bar-icon:not(.nivo-search-open) .nivo-search-results {
    display: none !important;
}
.nivo-preset-preview .nivo-bar-icon .nivo-search-results {
    display: flex !important;
}

/* =============================================================
   Result design polish (2.0.8)
   ============================================================= */

/* Never inherit odd alignment (centered / right) from the theme or a wrapper. */
.nivo-search-results {
    text-align: start;
}

/* Product without a picture: a neutral square so every row lines up. */
.nivo-search-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    margin: 5px;
    color: #b4b4b4;
    background: #f0f0f0;
    border-radius: 3px;
}
.nivo-search-no-image svg {
    width: 45%;
    height: 45%;
}

/* Price: struck-through old price above the current one; "From" for variable products. */
.nivo-search-product-price {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.2;
}
.nivo-search-price-old {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.6;
    text-decoration: line-through;
}
.nivo-search-price-from {
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    opacity: 0.6;
}
.nivo-search-product-price.nivo-search-price-sale .nivo-search-price-now {
    color: #c0392b;
}

/* ---- Compact: the title keeps its room, the SKU gives way ---- */
.nivo-results-layout-compact .nivo-search-product-title-link {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 6px;
    -webkit-line-clamp: unset;
    line-clamp: unset;
}
.nivo-results-layout-compact .nivo-search-product-title {
    flex: 0 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nivo-results-layout-compact .nivo-search-product-sku {
    flex: 1 1 0;
    min-width: 0;
    margin-left: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nivo-results-layout-compact .nivo-search-result-item > .nivo-search-no-image {
    display: none;
}

/* ---- Grid: title, then SKU on its own line, so every card lines up ---- */
.nivo-results-layout-grid .nivo-search-product-title-link {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
}
.nivo-results-layout-grid .nivo-search-product-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}
.nivo-results-layout-grid .nivo-search-product-sku {
    display: block;
    margin: 2px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nivo-results-layout-grid .nivo-search-no-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    margin: 0;
    border-radius: 6px;
}
.nivo-results-layout-grid .nivo-search-product-price {
    align-items: flex-start;
}
