:root {
    --primary: #ff5722;
    --secondary: #2196f3;
    --dark: #333;
    --light: #f5f5f5;
    --danger: #f44336;
    --success: #4caf50;
    --warning: #ff9800;
}

/* Category Page Styles */

.category-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.category-header {
    margin-bottom: 30px;
    text-align: center;
}

.category-title {
    font-size: 32px;
    color: var(--dark);
    margin-bottom: 10px;
}

.category-description {
    color: #666;
    max-width: 800px;
    margin: 0 auto;
}

.category-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 8px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.filter-label {
    font-weight: bold;
    margin-right: 5px;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.view-toggle {
    display: flex;
    gap: 5px;
}

.view-toggle button {
    background: none;
    border: 1px solid #ddd;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 4px;
}

.view-toggle button.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Product Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

/* Product Card - Grid View */
.product-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.product-image {
    height: 250px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
    position: relative; /* Ensure this is relative to place badge correctly */
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-info {
    padding: 15px;
}

.product-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    height: 80px;
    overflow: hidden;
    display: -webkit-box;
    /* -webkit-line-clamp: 2; */
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 10px;
}

.product-rating {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    color: #ffc107;
}

.product-rating span {
    margin-left: 5px;
    color: #666;
    font-size: 14px;
}

.product-actions {
    display: flex;
    justify-content: space-between;
}

.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: #e64a19;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #ddd;
}

.btn-outline:hover {
    background-color: #f5f5f5;
}

.no-products {
    text-align: center;
    padding: 50px;
    font-size: 18px;
    color: #666;
}



@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .category-filters {
        flex-direction: column;
        gap: 15px;
    }
    .filter-group {
        width: 100%;
        justify-content: space-between;
    }
    .product-card.list-view {
        flex-direction: column;
        height: auto;
    }
    .product-card.list-view .product-image {
        width: 100%;
        height: 250px;
    }
}

@media (max-width: 600px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
}

.product-badge {
    position: absolute; /* Position the badge relative to the product image */
    top: 10px;
    right: 10px;
    background-color: var(--danger);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold; /* Ensure it's on top of other elements */
}

a.product-link {
    text-decoration: none; /* For normal state */
    color: var(--dark);
}
