/**
 * Search Results Product Widget Styles
 * 搜索结果产品小部件样式 - 用于搜索页面模板
 */

/* Container */
.search-results-widget {
    width: 100%;
}

/* Search Results Header */
.search-results-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.search-results-count {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Search Results Grid */
.search-results-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
}

/* Empty Results */
.search-results-empty {
    text-align: center;
    padding: 80px 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.search-results-empty p {
    font-size: 18px;
    color: #666;
    margin: 0;
}

/* Pagination */
.search-results-pagination {
    margin-top: 40px;
    text-align: center;
}

.search-results-pagination .woocommerce-pagination {
    display: flex;
    justify-content: center;
}

.search-results-pagination .woocommerce-pagination ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.search-results-pagination .woocommerce-pagination li {
    margin: 0;
}

.search-results-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    background: transparent !important;
    border: none !important;
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.search-results-pagination .page-numbers:hover {
    background: transparent !important;
    color: #c62828;
}

.search-results-pagination .page-numbers.current {
    background: #c62828 !important;
    color: #fff;
}

.search-results-pagination .page-numbers.prev,
.search-results-pagination .page-numbers.next {
    font-size: 14px;
    font-weight: 500;
    background: transparent !important;
}

.search-results-pagination .page-numbers.prev::before,
.search-results-pagination .page-numbers.next::before,
.search-results-pagination .page-numbers.prev::after,
.search-results-pagination .page-numbers.next::after {
    display: none !important;
    content: none !important;
}

.search-results-pagination .page-numbers.prev:hover,
.search-results-pagination .page-numbers.next:hover {
    background: transparent !important;
}

.search-results-pagination .page-numbers.dots {
    cursor: default;
    color: #999;
}

.search-results-pagination .page-numbers.dots:hover {
    color: #999;
}

/* Product Card - Same as carousel */
.search-results-widget .product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.search-results-widget .product-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-5px);
}

.search-results-widget .product-card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    padding: 10px;
    background: #fff;
    border-radius: 8px 8px 0 0;
}

.search-results-widget .product-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.search-results-widget .product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    border-radius: 8px;
}

.search-results-widget .primary-image {
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.search-results-widget .secondary-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.search-results-widget .product-card-image.has-gallery .primary-image {
    z-index: 2;
}

.search-results-widget .product-card-image.has-gallery .secondary-image {
    z-index: 1;
}

.search-results-widget .product-card:hover .product-card-image.has-gallery .primary-image {
    opacity: 0;
    z-index: 1;
}

.search-results-widget .product-card:hover .product-card-image.has-gallery .secondary-image {
    opacity: 1;
    z-index: 2;
}

/* Product Badge */
.search-results-widget .product-badge-sale {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #c62828;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    z-index: 10;
}

/* Action Icons */
.search-results-widget .product-action-icons {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.search-results-widget .product-action-icons .action-icon,
.search-results-widget .product-action-icons .wd-compare-btn {
    opacity: 0;
    transform: translateX(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.search-results-widget .product-card:hover .product-action-icons .action-icon,
.search-results-widget .product-card:hover .product-action-icons .wd-compare-btn {
    opacity: 1;
    transform: translateX(0);
}

/* 收藏图标始终显示 */
.search-results-widget .product-action-icons .wishlist-icon {
    opacity: 1;
    transform: translateX(0);
}

.search-results-widget .action-icon {
    width: 36px;
    height: 36px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.search-results-widget .action-icon:hover {
    background: #fff;
}

/* Wishlist hover */
.search-results-widget .wishlist-icon:hover svg {
    fill: #c62828;
}

.search-results-widget .wishlist-icon.active .heart-filled {
    fill: #c62828;
}

/* Quickview hover */
.search-results-widget .quickview-icon:hover {
    background: #fff;
}

.search-results-widget .quickview-icon:hover svg {
    fill: #c62828;
}

/* Compare hover */
.search-results-widget .compare-icon:hover {
    background: #fff !important;
}

.search-results-widget .compare-icon:hover svg {
    fill: #c62828;
}

.search-results-widget .compare-icon.active svg {
    fill: #c62828;
}

.search-results-widget .action-icon:hover svg {
    fill: #c62828;
}

.search-results-widget .action-icon svg {
    width: 18px;
    height: 18px;
    fill: #333;
    transition: fill 0.3s ease;
}

.search-results-widget .action-icon .heart-filled {
    display: none;
}

.search-results-widget .action-icon.active .heart-outline {
    display: none;
}

.search-results-widget .action-icon.active .heart-filled {
    display: block;
    fill: #c62828;
}

/* Product Content */
.search-results-widget .product-card-content {
    padding: 15px;
    text-align: center;
}

.search-results-widget .product-card-title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

.search-results-widget .product-card-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.search-results-widget .product-card-title a:hover {
    color: #c62828;
}

.search-results-widget .product-card-price {
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    color: #c62828;
}

.search-results-widget .product-card-price del {
    color: #999;
    font-weight: 400;
    margin-right: 8px;
    text-decoration: line-through;
}

.search-results-widget .product-card-price del .woocommerce-Price-amount {
    color: #999;
}

.search-results-widget .product-card-price ins {
    text-decoration: none;
}

.search-results-widget .product-card-button {
    margin-top: auto;
}

.search-results-widget .add-to-cart-btn {
    display: block;
    width: 100%;
    padding: 12px 20px;
    background: #c62828;
    color: #fff;
    text-align: center;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.search-results-widget .add-to-cart-btn:hover {
    background: #a52222;
    color: #fff;
}

/* 隐藏加入购物车后的查看购物车提示 */
.search-results-widget .added_to_cart,
.search-results-widget .wc-forward {
    display: none !important;
}

/* Compare Icon - 使用Woodmart主题样式 */
.search-results-widget .wd-compare-btn.compare-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff !important;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
}

.search-results-widget .wd-compare-btn.compare-icon:hover {
    background: #fff !important;
}

.search-results-widget .wd-compare-btn.compare-icon a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* 比较按钮选中状态 */
.search-results-widget .wd-compare-btn.added::before,
.search-results-widget .wd-compare-icon.added::before {
    color: #c62828 !important;
}

/* 比较按钮悬停状态 */
.search-results-widget .wd-compare-btn:hover::before,
.search-results-widget .wd-compare-icon:hover::before {
    color: #c62828 !important;
}

/* Responsive */
@media (max-width: 1024px) {
    .search-results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .search-results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .search-results-header {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .search-results-grid {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .search-results-pagination .page-numbers {
        padding: 8px 12px;
        font-size: 14px;
    }
}
