/* Search Popup Overlay */
.search-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000c;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.search-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.search-popup-inner {
    position: relative;
    width: 100%;
    max-width: 896px;
    padding: 0 20px;
    transform: translateY(-80px);
    transition: transform 0.3s ease;
}

.search-popup-close {
    position: absolute;
    top: -50px;
    right: 20px;
    background: #304B3B;
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10000;
    transition: background 0.3s;
}

.search-popup-close:hover {
    background: #1f3327;
}

.search-input-group {
    display: flex;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid #304b3b;
}

/* Custom Select */
.search-category-wrapper {
    position: relative;
    border-right: 1px solid #304b3b;
    background: #e7f2df;
    border-radius: 6px 0 0 6px;
    flex-shrink: 0;
}

.custom-select {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.select-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 10px 12px;
    font-size: 14px;
    color: #111;
    font-weight: 500;
    gap: 10px;
}

.select-selected .arrow {
    font-size: 10px;
    color: #333;
}

.select-items {
    position: absolute;
    background-color: #fff;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    z-index: 99;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
    min-width: 100px;
}

.select-hide {
    display: none;
}

.select-items div {
    padding: 12px 15px;
    font-size: 14px;
    cursor: pointer;
    color: #333;
    transition: background 0.2s;
}

.select-items div:hover, .same-as-selected {
    background-color: #eaf1ec;
}

/* Input */
#live-search-input {
    flex-grow: 1;
    border: none;
    padding: 10px 12px;
    font-size: 15px;
    outline: none;
    color: #333;
    width: 100%;
}

/* Button */
.search-submit-btn {
    background: #304B3B;
    color: #fff;
    border: none;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    flex-shrink: 0;
    padding: 10px 12px;
}

.search-submit-btn:hover {
    background: #1f3327;
}

/* Results */
.live-search-results {
    background: #fff;
    margin-top: 10px;
    border-radius: 6px;
    max-height: 350px;
    overflow-y: auto;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.live-search-results:empty {
    display: none;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

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

.search-result-item:hover {
    background: #fafafa;
}

.search-result-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 15px;
    flex-shrink: 0;
}

.search-result-info {
    flex-grow: 1;
}

.search-result-info h4 {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #111;
    line-height: 1.3;
}

.search-result-price {
    font-size: 14px;
    color: #304B3B;
    font-weight: 600;
}

.search-no-results, .search-loading {
    padding: 30px 20px;
    text-align: center;
    color: #666;
    font-size: 15px;
}

/* Loader animation */
.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #304B3B;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    .search-popup-inner {
        padding: 0 15px;
    }
    .search-popup-close {
        top: -45px;
        right: 15px;
    }
    .select-selected {
        padding: 0 10px;
    }
}
