/* ===== SEARCH OVERLAY ===== */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: white;
    z-index: 1001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.search-overlay.active {
    transform: translateX(0);
}

.search-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Search Header */
.search-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #f0f0f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    gap: 12px;
}

.search-back {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-back:hover {
    background: #e0e0e0;
}

.search-back i {
    font-size: 14px;
    color: #333;
}

.search-input-container {
    flex: 1;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 25px;
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 16px;
    color: #333;
    padding: 4px 0;
}

.search-input::placeholder {
    color: #999;
    font-weight: 400;
}

.search-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-camera {
    color: #666;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.3s ease;
}

.search-camera:hover {
    color: #007c85;
}

.search-btn {
    background: #333;
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: #007c85;
    transform: scale(1.05);
}

.search-btn i {
    font-size: 14px;
}

/* Search Content */
.search-content {
    flex: 1;
    padding: 20px 16px;
    overflow-y: auto;
}

.search-section {
    margin-bottom: 30px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    margin-top: 0;
}

.section-title.trending {
    color: #e91e63;
}

/* Search Tags */
.search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-tag {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    color: #666;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
    gap: 4px;
}

.search-tag:hover {
    background: #e0e0e0;
    color: #333;
}

.search-tag.hot {
    background: #fff5f5;
    color: #e91e63;
    border-color: #f8bbd9;
}

.search-tag.hot i {
    color: #007c85;
    font-size: 11px;
}

.search-tag.hot:hover {
    background: #ffe8e8;
}

/* Trending Section */
.trending-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.trending-icon {
    color: #ffd700;
    font-size: 18px;
}

.trending-items {
    background: linear-gradient(135deg, #fff0f5, #fef7ff);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #f8bbd9;
}

.trending-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(233, 30, 99, 0.1);
}

.trending-item:last-child {
    border-bottom: none;
}

.trending-text {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

.trending-arrow {
    color: #4CAF50;
    font-size: 12px;
}

/* Responsive */
@media (max-width: 375px) {
    .search-header {
        padding: 10px 12px;
        gap: 8px;
    }
    
    .search-input-container {
        padding: 6px 12px;
    }
    
    .search-input {
        font-size: 14px;
    }
    
    .search-content {
        padding: 16px 12px;
    }
    
    .search-tag {
        font-size: 12px;
        padding: 6px 10px;
    }
}

/* Animation for search tags */
.search-tag {
    animation: fadeInUp 0.4s ease-out forwards;
    opacity: 0;
}

.search-tag:nth-child(1) { animation-delay: 0.1s; }
.search-tag:nth-child(2) { animation-delay: 0.2s; }
.search-tag:nth-child(3) { animation-delay: 0.3s; }
.search-tag:nth-child(4) { animation-delay: 0.4s; }
.search-tag:nth-child(5) { animation-delay: 0.5s; }
.search-tag:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search Results Styles */
.search-results {
    flex: 1;
}

.search-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.search-product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    cursor: pointer;
}

.search-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.search-product-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f0f0f0;
}

.search-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-product-info {
    padding: 12px;
}

.search-product-title {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.3;
}

.search-product-price .current {
    font-size: 14px;
    font-weight: 700;
    color: #333;
}

/* Loading */
.search-loading {
    text-align: center;
    padding: 40px 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007c85;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.search-loading p {
    color: #666;
    font-size: 14px;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 60px 20px;
}

.no-results i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.no-results h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 8px;
}

.no-results p {
    color: #666;
    font-size: 14px;
}

/* Update search results to fit within overlay */
.search-results {
    flex: 1;
    height: 100%;
    overflow-y: auto;
    padding: 16px 16px 60px;
}

.search-products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
    padding: 0;
}

/* Fix search content padding */
.search-content {
    flex: 1;
    padding: 20px 20px 60px;
    overflow-y: auto;
}

#searchDefault {
    padding: 0 16px;
}

.search-content, .search-results {
    margin-bottom: 30px;
}

.search-product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.search-product-card:hover,
.search-product-card:focus {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    text-decoration: none;
    color: inherit;
}

.search-product-card:active {
    transform: scale(0.98);
}