/**
 * Copyright © Morvica. All rights reserved.
 * See COPYING.txt for license details.
 */

.recently-sold-container {
    margin: 60px 0 40px;
    padding: 0;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.recently-sold-title h2 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 40px;
    color: #333;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.recently-sold-title h2:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: #333;
}

/* Grid Layout Styles */
.recently-sold-products.grid-layout .products-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.recently-sold-products.grid-layout.items-1 .products-grid {
    grid-template-columns: 1fr;
}

.recently-sold-products.grid-layout.items-2 .products-grid {
    grid-template-columns: repeat(2, 1fr);
}

/* Product Item Hover Effects */
.recently-sold-products .product-item-info {
    position: relative;
    overflow: hidden;
}

.recently-sold-products .product-top {
    position: relative;
    overflow: hidden;
}

.recently-sold-products .product-item-photo {
    display: block;
    position: relative;
}

.recently-sold-products .product-item-photo.has-hover-image .img-hover-show {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.recently-sold-products .product-item-info:hover .img-hover-show {
    opacity: 1;
}

/* Actions Link Styling - Vertical Stack on Left Side - COMPLETELY HIDDEN */
.recently-sold-products .actions-link {
    position: absolute;
    top: 10px;
    left: 10px;
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
    transition: all 0.3s ease;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-direction: column;
    gap: 5px;
}

.recently-sold-products .product-item-info:hover .actions-link {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

.recently-sold-products .actions-link li {
    list-style: none;
}

.recently-sold-products .actions-link button,
.recently-sold-products .actions-link a {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 4px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    font-size: 14px;
}

.recently-sold-products .actions-link button:hover,
.recently-sold-products .actions-link a:hover {
    background: #333;
    color: #fff;
}

/* Bottom Actions - Add to Cart & Buy Now - COMPLETELY HIDDEN */
.recently-sold-products .actions-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
    transition: all 0.3s ease;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
}

.recently-sold-products .product-item-info:hover .actions-bottom {
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
    z-index: 111;
    width: 80%;
    margin: 0 auto;
}
.recently-sold-products .product-item-info:hover .actions-bottom button {
    border-radius: 50px;
}
.recently-sold-products .actions-bottom .tocart {
    background: #cf9683;
    color: #333;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
}

.recently-sold-products .actions-bottom .tocart:hover {
    background: #333;
    color: #fff;
}

.recently-sold-products .actions-bottom .buynow {
    background: #000000;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    width: 100%;
}

.recently-sold-products .actions-bottom .buynow:hover {
    background: #cf9683;
}

.recently-sold-products.grid-layout.items-3 .products-grid {
    grid-template-columns: repeat(3, 1fr);
}

.recently-sold-products.grid-layout.items-4 .products-grid {
    grid-template-columns: repeat(4, 1fr);
}

.recently-sold-products.grid-layout.items-5 .products-grid {
    grid-template-columns: repeat(5, 1fr);
}

.recently-sold-products.grid-layout.items-6 .products-grid {
    grid-template-columns: repeat(6, 1fr);
}

/* Responsive Grid */
@media (max-width: 1200px) {
    .recently-sold-products.grid-layout.items-5 .products-grid,
    .recently-sold-products.grid-layout.items-6 .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .recently-sold-products.grid-layout .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .recently-sold-products.grid-layout .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 400px) {
    .recently-sold-products.grid-layout .products-grid {
        grid-template-columns: 1fr;
    }
}

/* Product Item Styles */
.recently-sold-item {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.recently-sold-item:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.recently-sold-item .product-item-info {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.recently-sold-item .product-item-photo {
    display: block;
    overflow: hidden;
    text-align: center;
    background: #f8f8f8;
}

.recently-sold-item .product-image-photo {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.recently-sold-item:hover .product-image-photo {
    transform: scale(1.05);
}

.recently-sold-item .product-item-details {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.recently-sold-item .product-item-name {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.4;
    flex: 1;
}

.recently-sold-item .product-item-name a {
    color: #333;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recently-sold-item .product-item-name a:hover {
    color: #007bff;
}

.recently-sold-item .product-reviews-summary {
    margin: 8px 0;
}

.recently-sold-item .rating-summary {
    display: inline-block;
}

.recently-sold-item .rating-result {
    display: inline-block;
    width: 65px;
    height: 13px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ddd"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>') repeat-x;
    background-size: 13px 13px;
    position: relative;
}

.recently-sold-item .rating-result span {
    display: block;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ffc107"><path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/></svg>') repeat-x;
    background-size: 13px 13px;
    overflow: hidden;
}

.recently-sold-item .rating-result span span {
    position: absolute;
    left: -9999px;
}

.recently-sold-item .price-box {
    margin: 10px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.recently-sold-item .price-from {
    font-size: 12px;
    font-weight: normal;
    color: #666;
    margin-right: 5px;
}

.recently-sold-item .product-item-actions {
    margin-top: auto;
}

.recently-sold-item .actions-primary {
    margin-bottom: 10px;
}

.recently-sold-item .action.tocart {
    background: #007bff;
    color: #fff;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
    width: 100%;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.recently-sold-item .action.tocart:hover {
    background: #0056b3;
    color: #fff;
}

.recently-sold-item .actions-secondary {
    display: flex;
    gap: 10px;
}

.recently-sold-item .actions-secondary .action {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ddd;
    background: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.recently-sold-item .actions-secondary .action:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
}

/* Slider Layout Styles */
.recently-sold-products.slider-layout {
    position: relative;
}

.recently-sold-products.slider-layout .owl-carousel {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.recently-sold-products.slider-layout .owl-carousel.owl-loaded {
    opacity: 1;
}

.recently-sold-products.slider-layout .owl-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    pointer-events: none;
}

.recently-sold-products.slider-layout .owl-nav button {
    position: absolute;
    background: rgba(0, 0, 0, 0.5) !important;
    color: #fff !important;
    border: none !important;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: all;
    display: flex;
    align-items: center;
    justify-content: center;
}

.recently-sold-products.slider-layout .owl-nav button:hover {
    background: rgba(0, 0, 0, 0.8) !important;
}

.recently-sold-products.slider-layout .owl-nav .owl-prev {
    left: -20px;
}

.recently-sold-products.slider-layout .owl-nav .owl-next {
    right: -20px;
}

.recently-sold-products.slider-layout .owl-dots {
    text-align: center;
    margin-top: 20px;
}

.recently-sold-products.slider-layout .owl-dots .owl-dot {
    display: inline-block;
    margin: 0 5px;
}

.recently-sold-products.slider-layout .owl-dots .owl-dot span {
    display: block;
    width: 10px;
    height: 10px;
    background: #ddd;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.recently-sold-products.slider-layout .owl-dots .owl-dot.active span,
.recently-sold-products.slider-layout .owl-dots .owl-dot:hover span {
    background: #007bff;
}

/* Loading State */
.recently-sold-products.loading::before {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    margin: 50px auto;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
