/* Main Styles */
.shopee-product-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.3s ease;
    max-width: 300px;
    margin: 0 auto;
}

.shopee-product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Product Preview Container */
.product-preview {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background: #f5f5f5;
    overflow: hidden;
}

/* Video Container */
.video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-container .product-video-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Video Overlay */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.video-container:hover .video-overlay {
    opacity: 0;
}

/* Play Icon */
.play-icon {
    width: 60px;
    height: 60px;
    background: rgba(255, 71, 87, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.video-container:hover .play-icon {
    transform: scale(1.1);
    background: rgba(255, 71, 87, 1);
}

/* Image Container (Fallback) */
.image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.shopee-product-card .discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4757;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    z-index: 3;
}

.video-container .discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4757;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    z-index: 3;
}

.shopee-product-card .product-info {
    padding: 15px;
}

.shopee-product-card .product-title {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    height: 44px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.shopee-product-card .product-price {
    margin-bottom: 15px;
}

.shopee-product-card .current-price {
    color: #ff4757;
    font-size: 18px;
    font-weight: bold;
}

.shopee-product-card .original-price {
    color: #999;
    font-size: 14px;
    text-decoration: line-through;
    margin-left: 8px;
}

.shopee-affiliate-link {
    display: block;
    width: 100%;
    padding: 10px;
    background: #ff4757;
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.shopee-affiliate-link:hover {
    background: #ff3838;
    color: #fff;
}

/* All Products Page - Grid Layout */
.shopee-all-products-page {
    margin: 20px 0;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.shopee-all-products-page .products-grid {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.shopee-all-products-page .products-grid[data-columns="1"] {
    grid-template-columns: repeat(1, 1fr);
}

.shopee-all-products-page .products-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.shopee-all-products-page .products-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.shopee-all-products-page .products-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.shopee-all-products-page .product-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.shopee-all-products-page .product-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.shopee-all-products-page .product-item:hover .video-container .product-video-preview {
    transform: scale(1.05);
}

.shopee-all-products-page .product-item:hover .image-container img {
    transform: scale(1.05);
}

.shopee-all-products-page .product-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.shopee-all-products-page .product-title {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: #333;
}

.shopee-all-products-page .product-price {
    margin-bottom: 15px;
}

.shopee-all-products-page .current-price {
    color: #ff4757;
    font-size: 16px;
    font-weight: bold;
}

.shopee-all-products-page .original-price {
    color: #999;
    font-size: 14px;
    text-decoration: line-through;
    margin-left: 8px;
}

.shopee-all-products-page .shopee-affiliate-link {
    display: block;
    width: 100%;
    padding: 10px;
    background: #ff4757;
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.3s ease;
    margin-top: auto;
}

.shopee-all-products-page .shopee-affiliate-link:hover {
    background: #ff3838;
    color: #fff;
}

.shopee-all-products-page .shopee-no-products {
    text-align: center;
    padding: 40px;
    background: #f9f9f9;
    border-radius: 8px;
    color: #666;
}

.shopee-all-products-page .category-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #ff4757;
}

/* Top Products */
.shopee-top-products {
    margin: 20px 0;
}

.shopee-top-products .top-products-title {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
}

.shopee-top-products .top-products-list {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.shopee-top-products .top-product-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.shopee-top-products .top-product-item:last-child {
    border-bottom: none;
}

.shopee-top-products .rank-number {
    font-size: 24px;
    font-weight: bold;
    color: #ff4757;
    margin-right: 15px;
    min-width: 30px;
}

.shopee-top-products .product-preview {
    position: relative;
    width: 60px;
    height: 60px;
    padding-top: 0;
    border-radius: 4px;
    overflow: hidden;
}

.shopee-top-products .video-container,
.shopee-top-products .image-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.shopee-top-products .play-icon {
    width: 24px;
    height: 24px;
}

.shopee-top-products .play-icon svg {
    width: 16px;
    height: 16px;
}

.shopee-top-products .product-info {
    flex: 1;
}

.shopee-top-products .product-title {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
}

.shopee-top-products .product-stats {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.shopee-top-products .product-price {
    color: #ff4757;
    font-weight: bold;
    margin-bottom: 8px;
}

.shopee-top-products .shopee-affiliate-link {
    display: inline-block;
    padding: 5px 12px;
    font-size: 12px;
}

/* Category Products */
.shopee-category-products {
    margin: 20px 0;
}

.shopee-category-products .category-title {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
}

.shopee-category-products .products-grid {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.shopee-category-products .products-grid[data-columns="1"] {
    grid-template-columns: repeat(1, 1fr);
}

.shopee-category-products .products-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.shopee-category-products .products-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.shopee-category-products .products-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.shopee-category-products .product-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.shopee-category-products .product-item:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.shopee-category-products .product-item:hover .video-container .product-video-preview {
    transform: scale(1.05);
}

.shopee-category-products .product-item:hover .image-container img {
    transform: scale(1.05);
}

.shopee-category-products .product-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.shopee-category-products .product-title {
    margin: 0 0 10px 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: #333;
}

.shopee-category-products .product-price {
    margin-bottom: 15px;
}

.shopee-category-products .current-price {
    color: #ff4757;
    font-size: 16px;
    font-weight: bold;
}

.shopee-category-products .original-price {
    color: #999;
    font-size: 14px;
    text-decoration: line-through;
    margin-left: 8px;
}

.shopee-category-products .shopee-affiliate-link {
    display: block;
    width: 100%;
    padding: 10px;
    background: #ff4757;
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.3s ease;
    margin-top: auto;
}

.shopee-category-products .shopee-affiliate-link:hover {
    background: #ff3838;
    color: #fff;
}

/* Error and No Products Messages */
.shopee-error {
    background: #fff;
    border: 1px solid #dc3232;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

.shopee-error p {
    color: #dc3232;
    margin: 0;
}

.shopee-error a {
    color: #0073aa;
    text-decoration: underline;
}

.shopee-no-products {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 40px;
    margin: 20px 0;
    text-align: center;
}

.shopee-no-products p {
    color: #666;
    margin: 0 0 15px 0;
    font-size: 16px;
}

.shopee-no-products p:last-child {
    margin-bottom: 0;
}

.shopee-no-products a {
    display: inline-block;
    padding: 10px 20px;
    background: #ff4757;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.shopee-no-products a:hover {
    background: #ff3838;
    color: #fff;
}

/* Auto-play video on hover */
.shopee-product-card:hover .product-video-preview,
.shopee-all-products-page .product-item:hover .product-video-preview,
.shopee-category-products .product-item:hover .product-video-preview {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .shopee-all-products-page .products-grid[data-columns="4"],
    .shopee-category-products .products-grid[data-columns="4"] {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .shopee-all-products-page .products-grid[data-columns="3"],
    .shopee-all-products-page .products-grid[data-columns="4"],
    .shopee-category-products .products-grid[data-columns="3"],
    .shopee-category-products .products-grid[data-columns="4"] {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .shopee-all-products-page,
    .shopee-category-products {
        padding: 15px;
    }
    
    .shopee-all-products-page .products-grid,
    .shopee-category-products .products-grid {
        gap: 15px;
    }
    
    .shopee-top-products .top-product-item {
        flex-wrap: wrap;
    }
    
    .shopee-top-products .rank-number {
        order: -1;
        margin-right: 10px;
    }
    
    .shopee-top-products .product-info {
        order: 1;
        flex-basis: calc(100% - 105px);
    }
    
    .play-icon {
        width: 50px;
        height: 50px;
    }
    
    .play-icon svg {
        width: 36px;
        height: 36px;
    }
}

@media (max-width: 480px) {
    .shopee-all-products-page .products-grid[data-columns="2"],
    .shopee-all-products-page .products-grid[data-columns="3"],
    .shopee-all-products-page .products-grid[data-columns="4"],
    .shopee-category-products .products-grid[data-columns="2"],
    .shopee-category-products .products-grid[data-columns="3"],
    .shopee-category-products .products-grid[data-columns="4"] {
        grid-template-columns: 1fr;
    }
    
    .shopee-all-products-page .product-item,
    .shopee-category-products .product-item {
        max-width: 100%;
    }
    
    .shopee-all-products-page,
    .shopee-category-products {
        padding: 10px;
    }
    
    .shopee-all-products-page .products-grid,
    .shopee-category-products .products-grid {
        gap: 10px;
    }
    
    .play-icon {
        width: 40px;
        height: 40px;
    }
    
    .play-icon svg {
        width: 28px;
        height: 28px;
    }
}