/**
 * Products Component Styles
 * Reusable product card and grid styles
 * Used across multiple pages (home, store, product detail)
 */

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

/* Product Card Image */
.product-card-image {
    aspect-ratio: 1 / 1;
    width: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.product-card:hover .product-card-image img {
    transform: scale(1.1);
}

.product-placeholder {
    font-size: 48px;
    color: var(--medium-grey);
}

/* Product Badge */
.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--primary-red);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.product-badge.out-of-stock {
    background: var(--dark-grey);
}

/* Product Card Content */
.product-card-content {
    padding: 20px;
}

.product-store {
    color: var(--medium-grey);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 0.3;
}

.product-name {
    font-size: 18px;
    margin: 8px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-description {
    color: var(--medium-grey);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Product Price */
.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.price-current {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-red);
}

.price-original {
    font-size: 18px;
    color: var(--medium-grey);
    text-decoration: line-through;
}

.price-label {
    font-size: 12px;
    color: var(--medium-grey);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Add to Cart Button */
.btn-add-cart {
    width: 100%;
    padding: 12px;
    background: var(--primary-black);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-add-cart:hover {
    background: var(--primary-red);
    transform: scale(1.05);
}

.btn-add-cart.disabled {
    background: var(--medium-grey);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-add-cart.disabled:hover {
    transform: none;
    background: var(--medium-grey);
}

/* Buy Now Button (Alternative style) */
.btn-buy-now {
    width: 100%;
    padding: 12px;
    background: var(--primary-red);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-buy-now:hover {
    background: var(--hover-red);
    transform: scale(1.05);
    color: white;
}

.btn-buy-now.disabled {
    background: var(--medium-grey);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-buy-now.disabled:hover {
    transform: none;
}

/* List View Variation */
.products-grid.list-view {
    grid-template-columns: 1fr;
}

.products-grid.list-view .product-card {
    display: flex;
    border-radius: 15px;
}

.products-grid.list-view .product-card-image {
    width: 200px;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
}

.products-grid.list-view .product-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 25px;
}

.products-grid.list-view .product-description {
    -webkit-line-clamp: 3;
}

.products-grid.list-view .btn-add-cart,
.products-grid.list-view .btn-buy-now {
    width: auto;
    padding: 12px 30px;
}

/* Product Hover Effect */
.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.product-card:hover::before {
    left: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .btn-buy-now {
        padding: 9px 12px;
        font-size: 13px;
        border-radius: 8px;
    }

    .product-card-image {
        aspect-ratio: 1 / 1;
    }

    .product-card-content {
        padding: 15px;
    }

    .product-store {
        font-size: 8px;
    }

    .product-name {
        font-size: 16px;
    }

    .price-current {
        font-size: 20px;
    }

    .products-grid.list-view .product-card {
        flex-direction: column;
    }

    .products-grid.list-view .product-card-image {
        width: 100%;
        aspect-ratio: 1 / 1;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .product-card-image {
        aspect-ratio: 1 / 1;
    }

    .product-description {
        display: none;
    }

    .btn-add-cart,
    .btn-buy-now {
        padding: 7px 10px;
        font-size: 12px;
        border-radius: 8px;
    }

    .btn-buy-now {
        gap: 4px;
    }

    .btn-buy-now i {
        font-size: 12px;
    }
}