/* Compact Product Grid Layout */
.products {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .products {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

@media (min-width: 992px) {
    .products {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 1200px) {
    .products {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Compact Product Cards */
.product {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

body.dark-mode .product {
    background-color: #1e1e1e;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.product:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.product-img {
    position: relative;
    overflow: hidden;
    height: 150px;
}

/* Premium 3D Ribbon Discount Tag */
.discount-badge {
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e50914;
    color: white;
    font-size: 13px;
    font-weight: 700;
    z-index: 5;
    clip-path: polygon(0 0, 100% 0, 100% 70%, 90% 100%, 0 100%);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

/* Add 3D ribbon fold effect */
.discount-badge::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    border-style: solid;
    border-width: 0 8px 8px 0;
    border-color: transparent #b20710 transparent transparent;
    z-index: 1;
}

/* Add gradient and animation effects */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.discount-badge {
    background: linear-gradient(45deg, #e50914, #f40612, #e50914);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

/* Style the span inside the badge */
.discount-badge span {
    position: relative;
    z-index: 1;
    display: inline-block;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .discount-badge {
        width: 85px;
        height: 35px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .discount-badge {
        width: 75px;
        height: 30px;
        font-size: 12px;
    }
}

/* Dark mode styling */
body.dark-mode .discount-badge {
    background: #e50914;
}

body.dark-mode .discount-badge::before {
    border-color: transparent #b20710 transparent transparent;
}

.wishlist-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.8);
    color: #ccc;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
}

.product-info {
    padding: 10px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-info h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.3;
}

.product-info p {
    color: #666;
    font-size: 12px;
    margin-bottom: 5px;
}

.rating {
    margin-bottom: 5px;
    color: #ffa502;
    font-size: 12px;
}

.price {
    margin-bottom: 5px;
    font-weight: 600;
}

.original {
    color: #777;
    text-decoration: line-through;
    margin-right: 5px;
    font-size: 12px;
}

.discounted {
    color: var(--primary-color);
    font-size: 14px;
}

.duration {
    color: #666;
    font-size: 12px;
    margin-bottom: 8px;
}

.product-features {
    margin-top: 5px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #666;
}

.product-features ul {
    list-style: none;
    padding-left: 0;
}

.product-features li {
    margin-bottom: 3px;
    position: relative;
    padding-left: 15px;
}

.product-features li:before {
    content: '✓';
    color: var(--success-color);
    position: absolute;
    left: 0;
    font-size: 10px;
}

.add-to-cart-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 8px 12px;
    border-radius: 5px;
    margin-top: auto;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-to-cart-btn i {
    margin-right: 5px;
    font-size: 12px;
}

/* Ensure mobile compatibility */
@media (max-width: 480px) {
    .products {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-img {
        height: 120px;
    }
    
    .product-info h3 {
        font-size: 14px;
    }
    
    .product-features li {
        font-size: 11px;
    }
    
    .add-to-cart-btn {
        padding: 6px 10px;
        font-size: 11px;
    }
}
