/* Search Overlay & Glassmorphism 🔍 */

.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    display: none;
    pointer-events: none;
}

.search-overlay.active {
    display: flex !important;
    flex-direction: column;
    justify-content: flex-start;
    pointer-events: auto;
    animation: searchFadeIn 0.4s ease forwards;
}

.search-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.9); /* Darker for better contrast */
    backdrop-filter: blur(30px); /* Heavier blur */
    -webkit-backdrop-filter: blur(30px);
    z-index: 1;
}

.btn-close-large {
    position: absolute;
    top: 40px;
    right: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001 !important;
    pointer-events: auto !important;
    color: white;
}

.btn-close-large:hover {
    background: white;
    color: var(--accent-color) !important;
    transform: rotate(90deg) scale(1.1);
}

.search-input-wrapper {
    z-index: 10;
}

.search-field {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    padding: 1.5rem 1.5rem 1.5rem 4rem !important;
    font-size: 1.5rem !important;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease !important;
    border-radius: 50px !important;
}

.search-field::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.search-field:focus {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 0 4px rgba(255, 105, 180, 0.2) !important; /* Accent glow */
    outline: none !important;
}

.search-input-icon {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: #ffffff; /* Bright white icon */
    font-size: 1.5rem;
    z-index: 11;
    opacity: 0.8;
}

.search-submit-btn {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--accent-color);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 12;
    cursor: pointer;
}

.search-submit-btn:hover {
    transform: translateY(-50%) scale(1.1);
    background: white;
    color: var(--accent-color);
}

.search-loader {
    position: absolute;
    right: 5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 11;
}

.trending-tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.trending-tag:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

.product-card-glass {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.product-card-glass:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.product-quick-view {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card-glass:hover .product-quick-view {
    opacity: 1;
}

/* Animations */
@keyframes searchFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes searchScaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.search-overlay.active .container {
    animation: searchScaleIn 0.5s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

@media (max-width: 768px) {
    .btn-close-large {
        position: absolute;
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    .search-overlay .container {
        padding-top: 90px !important; /* Increased to give room for the close button above the search bar */
        margin-top: 0 !important;
    }
    .search-content-area {
        display: none;
    }
    .search-field {
        font-size: 1.1rem !important;
        padding: 1rem 4rem 1rem 3.5rem !important;
    }
    .search-input-icon {
        font-size: 1.2rem;
        left: 1.2rem;
    }
}
