/* SEARCH STYLES - HEADER CONTAINED VERSION */

/* Ensure Header is positioned for absolute child */
/* Rel positioning removed to allow sticky header */

/* Overlay covering the Header Content only */
/* Overlay covering the Header Content only */
.search-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffff;
    z-index: 100;
    /* Ensure it covers everything in header */
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
    padding: 0 1rem;
    box-shadow: none;
}

.search-container {
    width: 100%;
    max-width: 900px;
    position: relative;
    /* Reset padding/styles from previous versions */
    padding: 0;
    margin: 0 auto;
}

/* The Search Bar Itself */
.search-form-wrap {
    display: flex;
    align-items: center;
    background: #f3f4f6;
    /* Light gray background */
    border-radius: 0.5rem;
    /* Soft corners */
    padding: 0 0.75rem;
    height: 50px;
    border: 2px solid transparent;
    transition: all 0.2s;
}

/* Focus State */
.search-form-wrap:focus-within {
    border-color: #1A7A3D;
    /* Primary Green */
    background: white;
    box-shadow: 0 0 0 3px rgba(26, 122, 61, 0.1);
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    height: 100%;
    padding: 0 1rem;
    font-size: 1rem;
    color: #1f2937;
    outline: none;
    width: 100%;
}

.search-icon-btn {
    border: none;
    background: none;
    color: #6b7280;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
}

.search-icon-btn:hover {
    color: #1A7A3D;
}

/* Integrated Close Button */
/* Standalone Close Button */
.close-search-btn {
    /* Reset conflicting styles from style.css */
    position: static !important;
    top: auto !important;
    right: auto !important;

    border: 2px solid #ef4444 !important;
    background: transparent !important;
    color: #ef4444 !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 4px;
    /* Slight rounded square */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 1rem;
    /* Ensure spacing if gap fails */
}

.close-search-btn:hover {
    background: #ef4444;
    color: white;
}

/* Results Dropdown */
.search-results-box {
    position: absolute;
    top: 100%;
    /* Drops right below the bar */
    left: 0;
    width: 100%;
    background: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 0 0 0.5rem 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-top: none;
    display: none;
    z-index: 200;
}

.search-results-box:not(:empty) {
    display: block;
    /* Show if has results */
}

/* Result Items */
.search-results-header {
    padding: 0.75rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f9fafb;
    border-bottom: 1px solid #f3f4f6;
}

.search-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    transition: background 0.1s;
}

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

.search-item:hover {
    background: #f8fafc;
}

.search-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #eee;
    margin-right: 1rem;
}

.search-item-info {
    flex: 1;
}

.search-item-title {
    font-size: 0.95rem;
    color: #1f2937;
    font-weight: 500;
    margin-bottom: 0.1rem;
    line-height: 1.3;
}

.search-item-price {
    font-size: 0.9rem;
    color: #1A7A3D;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 600px) {
    .search-overlay {
        padding: 0 0.5rem;
    }
}