﻿.products-container {
    display: flex;
    flex-wrap: wrap;
    border-radius: 5px;
}

.product-item {
    position: relative;
    margin: 5px;
    width: 200px;
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
    /* overflow: hidden; */
}

.product-image-container {
    width: 180px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 5px;
    margin: 0 auto;
    margin-bottom: 10px;
}

.product-image {
    max-width: 100%;
    max-height: 100%;
}

.product-info p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    text-decoration: none;
    color: black;
}

    .product-info p:hover {
        text-decoration: underline;
    }

.product-info a {
    text-decoration: none;
    color: inherit;
}

.product-preview {
    position: absolute;
    width: 250px;
    top: 0;
    left: 0;
    background-color: white;
    border: 1px solid #ccc;
    padding: 10px;
    width: 100%;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    overflow: hidden;
    align-items: center;
    border-radius: 5px;
    transition: opacity 0.5s ease-in;
    transition-delay: 0.5s;
}


.preview-image-container {
    width: 190px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-image {
    max-width: 100%;
    max-height: 100%;
}


.quantity-input {
    width: 50px;
    margin-right: 5px;
    text-align: right;
    border-radius: 10px;
}

.preview-link {
    text-decoration: none;
    color: black;
    align-items: center;
}

    .preview-link:hover {
        color: black;
        text-decoration: none;
    }

/* 📱 На екранах до 768px картка і прев'ю розтягуються */
@media (max-width: 768px) {
    .product-item {
        width: 100% !important;
        height: auto;
        max-width: 100% !important;
    }

    

    .product-image-container {
        width: 100% !important;
        height: auto;
    }

    .product-preview {
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: none; /* без тіні на мобільному */
    }

    .preview-image-container {
        width: 100% !important;
        height: auto;
    }

    .preview-image {
        width: 100%;
        height: auto;
    }
}
