﻿.mive-product-search {
    position: relative;
    z-index: 80;
}

.mive-product-search .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mive-product-search input[type="search"] {
    -webkit-appearance: none;
    appearance: none;
    background: var(--store-surface);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mive-product-search input[type="search"]:focus {
    outline: none;
    border-color: var(--mive-primary, var(--store-primary));
    box-shadow: 0 0 0 3px color-mix(in srgb,var(--store-primary) 10%,transparent);
}

.mive-product-search__panel {
    position: absolute;
    top: calc(100% + 7px);
    right: 0;
    left: 0;
    max-height: min(480px, calc(100vh - 150px));
    overflow-y: auto;
    padding: 8px;
    border: 1px solid var(--store-border);
    border-radius: 16px;
    background: var(--store-surface);
    box-shadow: 0 12px 30px color-mix(in srgb,var(--store-text) 14%,transparent);
}

.mive-product-search__panel[hidden] {
    display: none;
}

.mive-product-search .added_to_cart,
.mive-product-search .wc-forward {
    display: none !important;
}

.mive-product-search__message {
    margin: 0;
    padding: 20px 12px;
    color: var(--store-muted);
    font-size: 13px;
    text-align: center;
}

.mive-product-search__message.is-loading {
    color: var(--mive-primary, var(--store-primary));
}

.mive-product-search__message.is-error {
    color: var(--store-primary-dark);
}

.mive-search-result {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 9px;
    border-radius: 12px;
    background: var(--store-surface);
}

.mive-search-result + .mive-search-result {
    border-top: 1px solid var(--store-border);
}

.mive-search-result__image {
    grid-row: 1 / span 2;
    align-self: stretch;
}

.mive-search-result__image img {
    display: block;
    width: 62px;
    height: 62px;
    border-radius: 9px;
    object-fit: cover;
}

.mive-search-result__content {
    min-width: 0;
}

.mive-search-result__title {
    display: block;
    overflow: hidden;
    color: var(--store-text);
    font-size: 13px;
    font-weight: bold;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mive-search-result__price {
    color: var(--mive-primary, var(--store-primary));
    font-size: 12px;
    font-weight: bold;
}

.mive-search-result__action {
    grid-column: 2;
    justify-self: start;
}

.mive-search-result__action .add-btn {
    min-width: 82px;
    text-align: center;
}

@media (min-width: 390px) {
    .mive-search-result {
        grid-template-columns: 66px minmax(0, 1fr) auto;
    }

    .mive-search-result__image {
        grid-row: auto;
    }

    .mive-search-result__action {
        grid-column: auto;
        justify-self: end;
    }
}
