/* Existing Styles */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Full screen wrapper to handle backdrop clicks */
    background-color: rgba(0, 0, 0, 0.4);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    /* Dimmed backdrop for the rest of the screen */
    z-index: 999999;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease-out, visibility 0s 0.3s;
}

.search-overlay.open {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.3s ease-out;
}

/* The actual white background container */
.search-content-panel {
    background-color: #fff;
    width: 100%;
    height: 78vh;
    /* Adjusted screen height */
    overflow-y: auto;
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.search-overlay.open .search-content-panel {
    transform: translateY(0);
}

.search-header {
    padding: 1.5rem 1rem 0.5rem;
    position: relative;
    max-width: 1440px;
    margin: 0 auto;
    width: 100%;
    display: none;
    /* Hide close button container as requested */
}

/* Make sure close button is hidden just in case */
.close-search {
    display: none !important;
}

.search-container {
    max-width: 800px;
    margin: 0 auto;
    width: 90%;
    position: relative;
    padding-top: 3rem;
    /* Add spacing since header is hidden */
    padding-bottom: 2rem;
}

/* Search Input Area */
.search-input-wrapper {
    position: relative;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
    margin-bottom: 2rem;
}

.search-input-wrapper input {
    width: 100%;
    border: none;
    background: transparent;
    font-size: 2rem;
    font-weight: 700;
    color: #000;
    outline: none;
    padding-right: 3rem;
}

.search-input-wrapper input::placeholder {
    color: #999;
    font-weight: 400;
}

.search-clear-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    display: none;
}

/* Initial State (Popular/Recent) */
.search-initial-state {
    display: block;
}

.search-section-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #666;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.popular-searches-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.popular-tag {
    background: #f4f4f4;
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #000;
    text-decoration: none;
    transition: background 0.2s;
}

.popular-tag:hover {
    background: #e0e0e0;
}

/* Recommended Products Grid */
.recommended-products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.recommended-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
}

.recommended-card:hover {
    transform: translateY(-5px);
}

.rec-image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rec-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.rec-info {
    text-align: left;
}

.rec-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #000;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rec-category {
    font-size: 0.8rem;
    color: #666;
}


/* Results State - Text Only */
.search-results-state {
    display: none;
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    /* No gap, standard list */
}

.result-item-text {
    display: block;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: #000;
    transition: color 0.2s;
}

.result-item-text:last-child {
    border-bottom: none;
}

.result-item-text:hover {
    color: #bf2026;
}

.result-title {
    font-size: 1.1rem;
    font-weight: 500;
}

.result-meta {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.2rem;
}

@media (max-width: 768px) {
    .search-input-wrapper input {
        font-size: 1.5rem;
    }

    .search-content-panel {
        height: 60vh;
        /* Slightly taller on mobile */
    }

    .recommended-products-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 cols on mobile */
        gap: 1rem;
    }
}