/* Search History & Trending Searches Styles */

.search-history-section,
.search-trending-section {
    padding: 12px 0;
}

.search-history-section:not(:last-child),
.search-trending-section:not(:last-child) {
    border-bottom: 1px solid #e5e7eb;
}

.search-history-header,
.search-trending-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6b7280;
    letter-spacing: 0.05em;
}

.clear-history-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.clear-history-btn:hover {
    background-color: #fef2f2;
}

.search-history-list,
.search-trending-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.search-history-item,
.search-trending-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    color: #374151;
}

.search-history-item:hover,
.search-trending-item:hover {
    background-color: #f9fafb;
}

.search-history-item svg,
.search-trending-item svg {
    flex-shrink: 0;
    color: #9ca3af;
}

.search-history-item span,
.search-trending-item span {
    font-size: 14px;
    flex: 1;
}

.icon-clock,
.icon-trending {
    width: 16px;
    height: 16px;
}

/* Recently Viewed Products Widget */
.recently-viewed-widget {
    margin: 40px 0;
    padding: 20px 0;
}

.recently-viewed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.recently-viewed-title {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.recently-viewed-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.recently-viewed-product {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.recently-viewed-product:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.recently-viewed-product-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 12px;
}

.recently-viewed-product-name {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recently-viewed-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #059669;
}

.recently-viewed-product-category {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

.recently-viewed-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.recently-viewed-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.recently-viewed-empty-text {
    font-size: 16px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .recently-viewed-products {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .recently-viewed-product {
        padding: 8px;
    }

    .recently-viewed-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .search-history-item,
    .search-trending-item {
        padding: 8px 12px;
        font-size: 13px;
    }

    .search-history-header,
    .search-trending-header {
        font-size: 11px;
        padding: 6px 12px;
    }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    .search-history-section,
    .search-trending-section {
        border-bottom-color: #374151;
    }

    .search-history-header,
    .search-trending-header {
        color: #9ca3af;
    }

    .search-history-item,
    .search-trending-item {
        color: #e5e7eb;
    }

    .search-history-item:hover,
    .search-trending-item:hover {
        background-color: #1f2937;
    }

    .clear-history-btn:hover {
        background-color: #7f1d1d;
    }

    .recently-viewed-product {
        border-color: #374151;
        background-color: #1f2937;
    }

    .recently-viewed-product-name {
        color: #f3f4f6;
    }

    .recently-viewed-title {
        color: #f3f4f6;
    }
}
