.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.1rem;
}

.filter-container {
    background-color: rgb(226, 207, 234);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 2rem;
    padding: 16px;
    grid-column: 1 / span 4;
}

.filter-container h6 {
    font-weight: bolder;
}

.result {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.filter-button {
    border: none;
    border-radius: 20%;
    font-size: 1.2rem;
    color: white;
    background-color: #AB2346;
}

.card {
    border-radius: 10px;
    overflow: hidden;
    max-width: 18rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.discount-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #dc3545;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 10;
}

.product-card-img {
    height: 200px;
    width: 100%;
    object-fit: contain;
    background-color: #ffffff;
    padding: 10px;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 8px;
    min-height: 2.6rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.personal-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
}

.product-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 12px;
}

.product-meta {
    flex-grow: 0;
}

.price-section {
    margin-bottom: 4px;
}

.original-price {
    font-size: 0.8rem;
    color: #888;
    text-decoration: line-through;
    margin-bottom: 2px;
}

.discounted-price,
.pricing {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.card-actions {
    margin-top: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.card-actions button,
.card-actions a {
    width: 100%;
    padding: 8px 12px;
    font-size: 0.85rem;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

/* Mobile optimization */
@media (max-width: 576px) {
    .card {
        max-width: 100%;
    }
    
    .product-card-img {
        height: 200px;
    }

    .card-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .card-actions button,
    .card-actions a {
        padding: 8px 10px;
        font-size: 0.85rem;
        width: 100%;
        max-width: 74px;
        max-height: 40px;
    }
}

/* Tablet and smaller desktop */
@media (max-width: 768px) {
    .card {
        max-width: 100%;
    }
}


/* Filter Sidebar Styles */
.filter-sidebar {
    position: fixed;
    top: 0;
    right: -350px; /* Hidden by default */
    width: 350px;
    height: 100vh;
    background-color: #fff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1050;
    transition: right 0.3s ease-in-out;
    overflow-y: auto;
}

.filter-sidebar.active {
    right: 0; /* Slide in */
}

.filter-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 10;
}

.filter-sidebar-header h5 {
    margin: 0;
}

.close-filter {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.close-filter:hover {
    color: #dc3545;
}

.filter-sidebar-content {
    padding: 20px;
}

.filter-sidebar-content a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.filter-sidebar-content a:hover {
    color: #007bff;
}

/* Overlay */
.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.filter-overlay.active {
    opacity: 1;
    visibility: visible;
}

@media only screen and (max-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .filter-container {
        grid-column: 1 / span 3;
    }
}


/* Responsive adjustments */
@media (max-width: 576px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-sidebar {
        width: 100%;
        right: -100%;
    }

    .filter-container {
        grid-column: 1 / span 2;
    }
}

/* Category links styling */
.filter-sidebar-content .mb-3 a {
    padding: 8px 0;
    display: inline-block;
}

.filter-sidebar-content ul {
    padding-left: 15px;
}

.filter-sidebar-content ul li {
    margin-bottom: 8px;
}

.filter-sidebar-content ul li a {
    font-size: 14px;
    padding: 5px 0;
}


@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.price-section {
    margin: 15px 0;
}

.original-price {
    color: #999;
    text-decoration: line-through;
    font-size: 14px;
}

.discounted-price {
    color: #ff4d4d;
    font-size: 24px;
    font-weight: bold;
    margin: 5px 0;
}

.savings {
    color: #28a745;
    font-size: 13px;
    font-weight: 600;
}