/* Base styles for all screens */
.products-grid, .category-grid {
    display: grid;
    gap: 1rem;
    padding: 1rem;
}

.product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0,0,0,.125);
    overflow: hidden;
}

.product-image {
    position: relative;
    padding-top: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Mobile (1 column) - default */
.products-grid {
    grid-template-columns: 1fr;
    display: grid;
    gap: 1.5rem;
    padding: 1rem;
}

.category-grid {
    grid-template-columns: 1fr;
}

.login-box {
    width: 95%;
    padding: 1rem;
}

/* Tablet Portrait (2 columns) */
@media (min-width: 576px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .login-box {
        width: 80%;
        padding: 1.5rem;
    }
}

/* Tablet Landscape (3 columns) */
@media (min-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .login-box {
        width: 60%;
        padding: 2rem;
    }
}

/* Desktop (4 columns for products, 5 for categories) */
@media (min-width: 1400px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        padding: 1.5rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(5, 1fr);
        padding: 1.5rem;
    }
    
    .login-box {
        width: 40%;
        max-width: 500px;
    }
}

/* Additional styles for cards */
.category-card {
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-card i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Ensure proper spacing and alignment */
.card-body {
    padding: 1rem;
}

.card-title {
    margin-bottom: 0.75rem;
}

.badge {
    margin-right: 0.5rem;
}

/* Ensure proper spacing in mobile view */
@media (max-width: 575px) {
    .products-grid, .category-grid {
        gap: 1.75rem;
        padding: 0;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    .category-card {
        padding: 1rem;
    }
}

/* Style for purchased products */
.product-card.purchased {
    opacity: 0.3;
    background-color: #f8f9fa;
}

.product-card.purchased .product-image img {
    filter: grayscale(100%);
}

.product-card.purchased .card-title {
    color: #6c757d;
}

.product-card:not(.purchased):hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
} 