/* Products Page Styles */
:root {
    --primary-color: #ff9933;
    --dark-bg: #121212;
    --card-bg: #1e1e1e;
    --light-text: #ffffff;
    --gray-text: #a0a0a0;
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* Products Section */
.products-section {
    padding: 40px 0 60px;
}

.section-title {
    text-align: center;
    color: var(--light-text);
    font-size: 32px;
    margin-bottom: 40px;
    position: relative;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    transform: translateX(-50%);
}

/* Products Filters */
.products-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px 20px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    flex-wrap: wrap;
    gap: 15px;
}

@media (max-width: 768px) {
    .products-filters {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-group {
        width: 100%;
        justify-content: space-between;
    }
    
    .filter-select {
        flex-grow: 1;
    }
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    color: var(--light-text);
    font-weight: 500;
    white-space: nowrap;
}

.filter-select {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--gray-text);
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    font-size: 14px;
    min-width: 160px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a0a0a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.filter-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 153, 51, 0.3);
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .product-card {
        max-width: 100%;
    }
    
    .product-image {
        height: 280px;
    }
}

/* Product Card - Using styles from product.css for consistency */
.product-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.product-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1/1;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: var(--transition);
    padding: 10px;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1/1;
}

.product-tag {
    position: absolute;
    background-color: white;
    color: #333;
    padding: 2px 6px;
    font-size: 9px;
    font-weight: bold;
    border-radius: 3px;
    text-transform: uppercase;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 10;
    /* Ensure visibility */
    opacity: 1 !important;
    visibility: visible !important;
}

/* Position the first tag (NEW) */
.tag-new, .product-tag.new, .product-tag.sale {
    top: 7px;
    left: 7px;
}

/* Position the second tag (Best Seller) */
.tag-bestseller, .product-tag.bestseller {
    top: 29px; /* Positioned below the first tag */
    left: 7px;
}

/* RTL support */
html[dir="rtl"] .product-tag {
    left: auto;
    right: 5px;
}

.product-tag.sale {
    background-color: #ffebee;
    color: #e53935;
}

.product-tag.new {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.product-tag.bestseller {
    background-color: #fff8e1;
    color: #ff8f00;
}

.product-tag.stock {
    background-color: #f5f5f5;
    color: #333;
}

.product-tag.official {
    background-color: #e8eaf6;
    color: #3949ab;
}

.product-details {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-details h3 {
    color: var(--light-text);
    font-size: 18px;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 2.8em;
}

.product-price {
    margin-bottom: 15px;
    font-weight: 600;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.current-price {
    color: var(--primary-color);
    font-size: 25px;
    font-weight: 700;
}

.old-price {
    color: var(--gray-text);
    text-decoration: line-through;
    margin-left: 8px;
    font-size: 17px;
}

.product-buttons {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.add-to-cart-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    font-weight: 500;
    transition: var(--transition);
    font-size: 15px;
    background-color: #666666;
    color: white;
}

.wishlist-btn, .view-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--light-text);
    cursor: pointer;
    transition: var(--transition);
}

.add-to-cart-btn:hover {
    background-color: var(--primary-color);
}

.wishlist-btn:hover, .view-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Rating styles */
.product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 15px;
    color: var(--gray-text);
    font-size: 13px;
}

.stars {
    display: flex;
}

.stars i {
    color: #ffc107;
    margin-right: 2px;
}

/* Discount badge */
.discount-badge {
    display: inline-block;
    background-color: #e8f5e9;
    color: #2e7d32;
    padding: 3px 6px;
    font-size: 11px;
    border-radius: 3px;
    margin-left: 8px;
}

/* No Products Message */
.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--gray-text);
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 40px;
}

.page-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--card-bg);
    color: var(--gray-text);
    border-radius: 4px;
    transition: var(--transition);
    text-decoration: none;
}

.page-link:hover,
.page-link.active {
    background-color: var(--primary-color);
    color: white;
}

.page-dots {
    color: var(--gray-text);
    margin: 0 5px;
}

.page-link.next {
    width: auto;
    padding: 0 15px;
}

/* RTL Support */
html[dir="rtl"] .filter-select {
    background-position: left 10px center;
    padding-right: 15px;
    padding-left: 35px;
}

html[dir="rtl"] .product-tag {
    left: auto;
    right: 10px;
}

html[dir="rtl"] .section-title:after {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

/* Responsive Styles */
@media (max-width: 768px) {
    .section-title {
        font-size: 26px;
        margin-bottom: 30px;
    }
    
    .products-filters {
        flex-direction: column;
        align-items: flex-start;
        padding: 15px;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-select {
        flex-grow: 1;
    }
    
    .products-grid {
        gap: 15px;
    }
    
    .product-details {
        padding: 15px;
    }
    
    .product-details h3 {
        font-size: 16px;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .products-grid {
    }
    
    .product-price .current {
        font-size: 18px;
    }
}
