/* Search Bar Styles */
.navbar .form-control {
    border-radius: 20px 0 0 20px;
    border-right: none;
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
    height: 36px;
}

.navbar .input-group .btn {
    border-radius: 0 20px 20px 0;
    padding: 0 1rem;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    margin-top: 4px;
}

.autocomplete-item {
    padding: 8px 12px;
    transition: background-color 0.2s;
}

.autocomplete-item:hover {
    background-color: #f8f9fa;
    text-decoration: none;
}

/* Make search bar responsive */
@media (max-width: 991.98px) {
    .navbar .input-group {
        margin: 10px 0;
        width: 100%;
        max-width: 100%;
    }
    
    .autocomplete-dropdown {
        left: 15px;
        right: 15px;
    }
}

/* Adjust navbar items spacing */
.navbar-nav {
    align-items: center;
}

/* Ensure search form takes available space on larger screens */
@media (min-width: 992px) {
    .navbar .search-form {
        flex: 1;
        max-width: 500px;
        margin: 0 1rem;
    }
}

/* Search Modal Styles */
.search-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
}

.search-modal-overlay.active {
    opacity: 1;
}

.search-modal-container {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 700px;
    margin-top: 5vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.search-modal-overlay.active .search-modal-container {
    transform: translateY(0);
}

.search-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

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

.search-icon {
    position: absolute;
    left: 1rem;
    color: #6b7280;
    z-index: 1;
}

.search-modal-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}

.search-modal-input:focus {
    border-color: #3a5a40;
}

.btn-close-search {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.btn-close-search:hover {
    color: #1f2937;
}

.search-modal-body {
    padding: 1rem 1.5rem;
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
}

.search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6b7280;
}

.search-results-container {
    max-height: 400px;
    overflow-y: auto;
}

.search-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.search-result-item {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;
    display: block;
    color: #1f2937;
}

.search-result-item:hover,
.search-result-item.selected {
    background-color: #f9fafb;
    text-decoration: none;
}

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

.search-result-content {
    flex: 1;
}

.search-result-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.search-result-price {
    font-size: 0.875rem;
    color: #3a5a40;
    font-weight: 600;
}

.search-results-footer {
    padding: 1rem 0;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    margin-top: 1rem;
}

.search-empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-modal-overlay {
        padding: 0;
        align-items: flex-start;
    }
    
    .search-modal-container {
        border-radius: 0;
        margin-top: 0;
        max-height: 100vh;
        height: 100vh;
    }
    
    .search-modal-header {
        padding: 1rem;
    }
    
    .search-modal-body {
        padding: 1rem;
    }
}

/* Autocomplete item styling (for navbar dropdown) */
.autocomplete-item {
    cursor: pointer;
}

.autocomplete-item:hover {
    background-color: #f8f9fa;
}
