body {
    font-family: tahoma, sans-serif;
    margin: 0;
    padding: 0;
    /* background: #fff; */
    direction: rtl;
}

.product-page {
    display: grid;
    grid-template-columns: 1fr 1fr 0.7fr;
    gap: 20px;
    max-width: 1200px;
    width: 100%;
    margin: 40px auto;
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

/* بخش عکس‌ها */
.product-images {
    text-align: center;
}

#main-image {
    width: 100%;
    max-width: 500px;
    border-radius: 10px;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

#main-image.zoomed {
    cursor: zoom-out;
    transform: scale(2); /* میزان زوم */
    z-index: 999;
    position: relative;
}

.thumbnails {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    max-width: 100%;
    overflow: hidden;
}

.thumbnails img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.3s;
    max-width: 100%;
}

.thumbnails img:hover {
    border-color: #007bff;
}

/* بخش مشخصات */
.product-details h1 {
    margin-top: 0;
    font-size: 24px;
    color: #333;
}

.product-details p {
    color: #555;
    line-height: 1.6;
}

.product-details ul {
    list-style: none;
    padding: 0;
    margin-top: 15px;
}

.product-details ul li {
    margin-bottom: 8px;
    color: #444;
}

/* بخش خرید */
.product-purchase {
    width: 300px;
    background-color: #ccc;
    height: 370px;
    padding-right: 20px;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.20);
}

.stock {
    color: #6d5050;
    font-size: 14px;
}

.price {
    font-size: 22px;
    color: #000;
    margin-bottom: 40px;
    font-weight: bold;
}

.price .currency {
    font-size: 16px;
    font-weight: normal;
    vertical-align: super;
    color: #333;
    margin-left: 3px;
}

.add-to-cart {
    display: block;
    width: 100%;
    padding: 12px;
    background: #007bff;
    color: white;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    margin-top: 30px;
}

.add-to-cart:hover {
    background: #0056b3;
}

#main-image {
    width: 100%;
    max-width: 400px;
    height: auto;
}

.thumbnails img {
    width: 70px;
    height: 70px;
    object-fit: cover;
}
.product-review {
    margin-top: 40px;
    padding: 20px;
    border-top: 1px solid #eee;
    font-family: "Vazirmatn", sans-serif;
}

.star-rating {
    direction: rtl;
    display: inline-block;
    margin-bottom: 10px;
}

.star-rating span {
    font-size: 26px;
    cursor: pointer;
    color: #ccc;
    transition: color 0.2s;
}

.star-rating span.active,
.star-rating span:hover,
.star-rating span:hover~span {
    color: #ffb400;
}

#review-text {
    width: 100%;
    height: 100px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    resize: none;
    font-size: 15px;
    margin-top: 10px;
}

#submit-review {
    background: #0078d7;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    margin-top: 10px;
    cursor: pointer;
}

#submit-review:hover {
    background: #005fa3;
}

#review-message {
    margin-top: 10px;
    color: green;
    font-size: 14px;
}
.price-details {
    padding: 15px;
    border-radius: 8px;
}

.quantity-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 30px;
}

.quantity-wrapper input {
    width: 150px;
    height: 40px;
    text-align: center;
    border-radius: 6px;
    border: 1px solid #ccc;
    padding: 0;
    box-sizing: border-box;
}

.quantity-decrease,
.quantity-increase {
    position: absolute;
    top: 0;
    width: 30px;
    height: 100%;
    line-height: 40px;
    text-align: center;
    cursor: pointer;
    background: none;
    border: none;
    user-select: none;
    font-size: 25px;
}

.quantity-decrease {
    left: 0;
}

.quantity-increase {
    right: 0;
}

.quantity-controls button:hover {
    color: #0056b3;
}

.price-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 16px;
    color: #333;
    gap: 40px;
}

.price-row:last-child {
    margin-bottom: 0;
}

.product-info-wrapper {
    border-bottom: 5px solid #ccc;
    width: 100%;
    padding-bottom: 15px;
    margin-bottom: 55px;
}

.product-info {
    display: flex;
    justify-content: space-between;
    max-width: 1200px;
    margin: 20px auto;
    flex-wrap: nowrap;
    box-sizing: border-box;
}

.info-item {
    flex: 1;
    text-align: center;
    padding: 10px;
    box-sizing: border-box;
    color: #757575;
}

.product-tabs {
    margin-top: 40px;
    max-width: 1200px;
    padding: 20px auto;
    margin: 20px auto;
    margin-bottom: 70px;
}

.tab-buttons {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #ccc;
    margin-bottom: 15px;
}

.tab-buttons .tab-btn {
    flex: 1;
    padding: 10px;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 19px;
    color: #555;
    transition: 0.3s;
}

.tab-buttons .tab-btn:hover {
    color: #007bff;
}

.tab-buttons .tab-btn.active {
    color: #007bff;
    border-bottom: 3px solid #007bff;
    font-weight: bold;
}

.tab-content .tab-panel {
    display: none;
    color: #333;
    line-height: 1.9;
}

.tab-content .tab-panel.active {
    display: block;
}

/* جدول مشخصات */
.product-specs {
    border-top: 1px solid #eee;
    margin-top: 10px;
}

.spec-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.spec-title {
    font-weight: bold;
    color: #555;
    flex: 0 0 160px;
}

.spec-value {
    color: #333;
    flex: 1;
    text-align: right;
}

/* بخش نظرات */
.comments-sendbtn {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1000px;
}

.comments {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.comment {
    border-bottom: 1px solid #eee;
    padding: 12px 0;
}

.comment:last-child {
    border-bottom: none;
}

.comment .author {
    font-weight: bold;
    color: #333;
}

.add-comment-btn {
    display: block;
    margin: 20px auto 0;
    padding: 15px 25px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #fff;
    padding: 23px;
    width: 90%;
    max-width: 400px;
    border-radius: 11px;
}

.modal textarea {
    width: 100%;
    height: 100px;
    padding: 8px;
    resize: none;
    margin-bottom: 10px;
}

.modal .username {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #666;
}

.modal button {
    background: #28a745;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
}

.close {
    float: left;
    cursor: pointer;
    color: #888;
}

.text {
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.stock-warning {
    color: #e67e22;
    font-weight: bold;
    margin: 10px 0;
    animation: pulse 1.2s infinite;
}

.out-of-stock {
    color: #e74c3c;
    font-weight: bold;
    margin: 10px 0;
}

.add-to-cart.disabled {
    background: #bbb;
    color: #555;
    cursor: not-allowed;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

/* بخش نظرات و پاسخ‌ها */
.comments {
    margin-top: 20px;
    padding: 10px;
}

.comment {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.comment .author {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.comment .text {
    color: #444;
    line-height: 1.6;
}

.replies {
    margin-right: 25px;
    margin-top: 10px;
    border-right: 3px solid #0078ff30;
    padding-right: 10px;
}

.reply {
    background: #eef5ff;
    border-radius: 10px;
    padding: 8px 10px;
    margin-top: 8px;
}

.reply .author {
    font-weight: 600;
    color: #0052cc;
}

.reply .text {
    font-size: 0.95rem;
    color: #333;
}

.reply-btn {
    margin-top: 30px;
}

.add-comment-btn,
.reply-btn {
    background: #0078ff;
    color: #fff;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.9rem;
}

.add-comment-btn:hover,
.reply-btn:hover {
    background: #005fc4;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    margin: 100px auto;
    position: relative;
}

.modal-content textarea {
    width: 100%;
    height: 100px;
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 8px;
    resize: none;
}

.modal-content button {
    margin-top: 10px;
    width: 100%;
    background: #0078ff;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
}

.modal-content .close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 20px;
    cursor: pointer;
    color: #666;
}