﻿
.products {
    font-size: 14px;
    width: 90%;
    padding: 0.5rem;
    margin: 5rem auto;
    border-radius: 5px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.product-card {
    border: 2px solid #A9864E;
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

    .product-card img {
        width: 100%;
        height: auto;
        max-height: 150px;
        object-fit: contain;
        margin-bottom: 10px;
        display: block
    }

.image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 100%; /* مربع */
    overflow: hidden;
}

    .image-wrapper img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        visibility: hidden; /* به جای display:none */
    }

.product-card div.placeholder {
    position: absolute;
    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 {
}

    .product-info .product-title {
        color: #402E32;
        font-size: 16px;
        margin-bottom: 6px;
        min-height: 45px;
        font-weight: bold;
    }

    .product-info .product-price {
        color: #402E32;
        font-size: 15px;
        margin-bottom: 4px;
    }

    .product-info .product-price-old {
        color: #A9864E;
        text-decoration: line-through;
        font-size: 14px;
        min-height: 18px;
        margin-bottom: 10px;
    }

        .product-info .product-price-old.hidden {
            visibility: hidden;
        }

    .product-info .buy-button {
        background-color: #BB871E;
        color: white;
        border: none;
        padding: 5px 10px;
        font-size: 14px;
        border-radius: 4px;
        cursor: pointer;
        transition: background 0.3s;
        width: 100%;
        max-width: 160px;
        margin: 0 auto;
        display: block;
        text-decoration: none;
    }

        .product-info .buy-button:hover {
            background-color: #BB871E;
            color: white;
            border: none;
        }

.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;
    }
