.smart-search-form {
    position: relative;
    z-index: 1040;
}

.smart-search-shell {
    position: relative;
}

.smart-search-input::-webkit-search-cancel-button {
    cursor: pointer;
}

.smart-search-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 1080;
    width: min(760px, calc(100vw - 32px));
    max-height: min(620px, calc(100vh - 150px));
    overflow-x: hidden;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(25, 31, 36, .16);
    color: #1f2937;
}

.smart-search-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 18px 10px;
    font-size: 14px;
    font-weight: 700;
}

.smart-search-query {
    color: #6b7280;
    font-size: 12px;
    font-weight: 500;
}

.smart-search-categories {
    display: flex;
    gap: 8px;
    padding: 0 18px 13px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.smart-search-category {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 8px;
    max-width: 260px;
    padding: 8px 11px;
    color: #263238;
    background: #f5f8f2;
    border: 1px solid #dceacb;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .18s ease, background-color .18s ease;
}

.smart-search-category:hover,
.smart-search-category:focus {
    color: #263238;
    background: #edf7e3;
    border-color: #76b82a;
}

.smart-search-category img {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.smart-search-products {
    border-top: 1px solid #edf0f2;
}

.smart-search-product {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 13px;
    align-items: center;
    min-height: 92px;
    padding: 10px 18px;
    color: inherit;
    border-bottom: 1px solid #edf0f2;
    text-decoration: none;
    transition: background-color .15s ease;
}

.smart-search-product:hover,
.smart-search-product:focus,
.smart-search-product.is-active {
    color: inherit;
    background: #f8fbf5;
}

.smart-search-product-image {
    width: 72px;
    height: 72px;
    padding: 4px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #edf0f2;
    border-radius: 9px;
}

.smart-search-product-title {
    display: -webkit-box;
    overflow: hidden;
    margin-bottom: 5px;
    color: #17211b;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.smart-search-product-title mark {
    padding: 0 2px;
    background: #dff5bd;
    color: inherit;
    border-radius: 3px;
}

.smart-search-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    color: #7b8490;
    font-size: 11px;
}

.smart-search-stock {
    color: #2f9e35;
}

.smart-search-stock.is-out {
    color: #d9485f;
}

.smart-search-price {
    min-width: 96px;
    text-align: right;
    white-space: nowrap;
}

.smart-search-old-price {
    display: block;
    margin-bottom: 2px;
    color: #89919b;
    font-size: 11px;
    text-decoration: line-through;
}

.smart-search-current-price {
    color: #17211b;
    font-size: 16px;
    font-weight: 800;
}

.smart-search-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 10px;
    padding: 11px 16px;
    color: #24410f;
    background: linear-gradient(90deg, #def5c4, #bde98e);
    border-radius: 9px;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.smart-search-all:hover,
.smart-search-all:focus {
    color: #162c08;
    background: linear-gradient(90deg, #d3f1b0, #afe377);
}

.smart-search-empty,
.smart-search-loading {
    padding: 28px 20px;
    color: #6b7280;
    text-align: center;
    font-size: 13px;
}

.smart-search-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: -4px;
    border: 2px solid #dbe7ce;
    border-top-color: #67a727;
    border-radius: 50%;
    animation: smart-search-spin .75s linear infinite;
}

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

@media (max-width: 991.98px) {
    .smart-search-form {
        z-index: 1060;
    }

    .smart-search-panel {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        left: 0;
        width: 100%;
        max-height: calc(100vh - 250px);
        border-radius: 12px;
    }

    .smart-search-input {
        position: relative;
        z-index: 2;
    }
}

@media (max-width: 575.98px) {
    .smart-search-heading {
        padding: 13px 12px 9px;
    }

    .smart-search-categories {
        padding: 0 12px 11px;
    }

    .smart-search-product {
        grid-template-columns: 58px minmax(0, 1fr) auto;
        gap: 9px;
        min-height: 78px;
        padding: 9px 12px;
    }

    .smart-search-product-image {
        width: 58px;
        height: 58px;
    }

    .smart-search-product-title {
        font-size: 12px;
    }

    .smart-search-meta {
        display: block;
        font-size: 10px;
    }

    .smart-search-meta span {
        display: block;
        margin-top: 2px;
    }

    .smart-search-price {
        min-width: 68px;
    }

    .smart-search-current-price {
        font-size: 13px;
    }

    .smart-search-old-price {
        font-size: 9px;
    }
}
