﻿.product {
    width: 90%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin: 0 auto;
    padding: 0.5rem 1rem;
    border: 2px solid #A9864E;
    border-radius: 12px;
}

.product-image {
    position: relative; /* 👈 خیلی مهم */
    width: 30%;
    aspect-ratio: 1/1; /* یا هر نسبتی که می‌خوای، برای حفظ ابعاد */
    overflow: hidden;
    border-radius: 6px; /* هماهنگ با placeholder */
}

    .product-image > img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        visibility: hidden; /* تا وقتی لود نشده */
        border-radius: 6px;
        display: block;
    }

    .product-image div.placeholder {
        position: absolute; /* 👈 بذارش روی img */
        top: 0;
        left: 0;
        width: 100%; /* کل ظرف عکس */
        height: 100%;
        background: linear-gradient(90deg, #eee, #ddd, #eee);
        background-size: 200% 100%;
        animation: shimmer 1.2s infinite;
        border-radius: 6px;
    }

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.product-info {
    padding: 0;
    margin: 0;
    border-right: 2px solid #A9864E;
    width: 70%;
}

    .product-info > h1 {
        text-align: right;
        padding: 1rem;
        color: #402E32;
    }

    .product-info > div > button#show-all-properties {
        margin: 0.5em auto;
        display: block;
        border: 1px solid #A9864E;
        color: #A9864E;
        padding: 0.5rem;
        font-size: 10px;
        width: 8vw;
    }


.product-info__actions {
    margin: 0;
    padding: 0.5rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 1rem;
    border-radius: 5px;
}

    .product-info__actions > div {
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        font-size: 18px;
    }

    .product-info__actions div.price {
        margin: 0.5rem 0;
    }

    .product-info__actions div.price-old {
        margin: 0.5rem 0;
        border: 1px solid;
        text-decoration: line-through;
    }

        .product-info__actions div.price-old.hidden {
            visibility: hidden;
        }

    .product-info__actions > div > button {
        background-color: #BB871E;
        color: white;
        border: none;
        padding: 0.5rem 2rem;
        font-size: 16px;
        border-radius: 4px;
        cursor: pointer;
        transition: background 0.3s;
        width: 30%;
    }

.product-info__properties {
    margin: 0;
    padding: 0;
    max-height: 20em;
    overflow: hidden;
    position: relative;
    transition: max-height 0.5s ease;
    mask-image: linear-gradient(to bottom, black 60%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent);
}

    .product-info__properties.expanded {
        max-height: 20000px;
        mask-image: none;
        -webkit-mask-image: none;
    }

    .product-info__properties .title {
        padding: 1rem;
    }

        .product-info__properties .title > h2 {
            font-size: 14px
        }

.property {
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid #A9864E;
    padding: 0 1rem;
    margin: 0.5rem;
    color: #402E32;
}

    .property :first-child {
        font-weight: bolder;
    }

    .property :last-child {
        padding: 0.5rem 0;
    }

.product-info__summary {
    text-align: justify;
}

.product-info__description {
    line-height: 2.5em;
    margin: 0.5rem;
    text-align: justify;
    border: 2px solid;
}

.description {
    width: 90%;
    font-size: 14px;
    line-height: 2.5em;
    text-align: justify;
    margin: 0.5rem auto;
    padding: 0 0.5rem;
}

    .description h3,
    .description h4,
    .description h5,
    .description h6 {
        color: #A9864E;
        border-right: 5px solid #A9864E;
        padding: 0.5rem;
        background-color: #FFF8F0;
        margin: 1rem 0;
    }

    .description a {
        text-decoration: none;
        color: #A9864E;
        font-weight: bolder;
        padding: 0 1rem;
    }

        .description a img {
            display: block;
            width: 50%;
        }

    .description > div p {
        padding: 0 0.5rem;
    }

@media only screen and (min-width: 768px) {
}

@media only screen and (max-width: 768px) {
    .product {
        display: flex;
        flex-direction: column;
    }

    .product-image {
        width: 100%;
    }

        .product-image > img {
            width: 100%;
            display: block;
            margin: 0 auto;
        }

    .product-info {
        padding: 0;
        margin: 0;
        border: none;
        width: 100%;
    }

        .product-info > h1 {
            text-align: center;
            padding: 1rem;
            color: #402E32;
            font-size: 18px;
        }

        .product-info > div > button#show-all-properties {
            width: 50%;
            font-size: 8px;
            border: none;
        }

    .product-info__actions {
        padding: 0;
        margin: 0;
    }

        .product-info__actions > div {
            text-align: center;
        }

            .product-info__actions > div > button {
                margin: 0 auto;
                width: 50%;
            }
}
