body {
    direction: rtl;

}

* {
    box-sizing: border-box;
}

li {
    list-style: none;
}

a {
    text-decoration: none;
}

.mapping {
    display: flex;
    align-items: center;
    padding: 20px 8px;
    margin: 10px 0;
}

.mapping a {
    text-decoration: none;
    color: #464646;
    margin: 0 10px;
    font-size: 0.8rem;
}

.mapping a:hover {
    color: #e50e0e;
}

.mapping i {
    margin: 0 5px;
    color: #000;
}

/* استایل کلی صفحه محصول */
.product-container {
    max-width: 100%;
    margin: 5px auto;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}


.product-container h1 {
    text-align: center;
    color: #333;
}

.product-container .btn-add-cart {
    background-color: #4CAF50;
    color: rgb(243, 255, 245);
    border: none;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 80%;
    padding: 12px 20px;
    font-size: 1.5rem;
    width: 100%;
    transform: none;
    margin-top: 10px;
}


.product-image-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 30%;
    min-width: 300px;
    padding: 10px;
}


.price-container {
    flex: 1;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

}

.price {
    font-size: 1.5rem;
    color: #e91e63;
    font-weight: bold;
}

.sale-price {
    font-size: 1.5rem;
    color: #e91e63;
    font-weight: bold;

}

.original-price {
    font-size: 1.5rem;
    color: #999;
    margin-top: 5px;

}

.btn-add-cart:hover {
    background-color: #45a049;
    border: 4px solid #0056b3;
}

.product-image {
    max-height: 400px;
    width: 100%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 15px;
    object-fit: contain;
}

.product-image:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease;

}

.thumbnail-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 10px;
}

.thumbnail-container img:hover {
    border: #0056b3 3px solid;
    border-radius: 5px;
}

.thumbnail {
    width: 120px;
    height: 120px;
    margin: 0 5px;
    cursor: pointer;
    transition: transform 0.2s;
    object-fit: cover;
}

.thumbnail:hover {
    transform: scale(1.1);
}

.hidden {
    display: none;
}

.show-more {
    margin-top: 10px;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.5rem;
}

.show-more:hover {
    background-color: #0056b3;
    /* تغییر رنگ در حالت hover */

}

/* CSS برای مدال */
.modalproduct {
    display: none;
    position: fixed;
    z-index: 1020;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-content {
    position: relative;
    margin-top: 2%;
    left: 0;
    right: 0;
    width: 90%;
    /* عرض مدال 90% */
    height: 90%;
    /* ارتفاع خودکار */
    outline: none;
    /* حذف خط آزاد */

}

.modal-image {
    width: 40%;
    height: 70%;
    display: block;
    margin: auto;
    border-radius: 20px;

}

.modal-thumbnails {
    display: flex;
    justify-content: center;
    margin-top: 3%;
}

.modal-thumbnail {
    width: 8%;
    aspect-ratio: 1/1;
    margin: 0 5px;
    cursor: pointer;
    border-radius: 20px;
    transition: transform 0.3s ease;
}

.modal-thumbnail:hover {
    transform: scale(1.1);
    /* افزایش اندازه به هنگام هاور */
    border: #002aff 3px solid;
    margin: 0 10px;
}

.close {
    position: absolute;
    margin: 20px 40px;
    color: white;
    font-size: 4rem;
    cursor: pointer;
    z-index: 1021;
}

.product-details {
    flex: 1;
    padding: 0 20px;
    margin-right: 5%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;


}

.product-details p {
    line-height: 1.5;
    transform: translateX(-10%);

}

.mojudi {
    display: flex;
    flex-direction: row;
    margin: 15px;

}

.product-price {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;

}

.product-title {
    font-size: 2rem;
    font-weight: bold;
    color: #008f1f;
}

.product-description {
    font-size: 2rem;
    color: #666;
    margin-bottom: 15px;
}

.product-description p {
    font-size: 5rem;
}

.quantity-container {
    transform: translateX(-10%);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.quantity-container label {
    font-size: 1.2rem;
}

.quantity-container select {
    width: 60px;
    height: 40px;
    border: solid #000 1.5px;
    border-radius: 10px;
    font-size: 1.2rem;
    margin-top: 20px;
    margin-bottom: 20px;
}


.tabs-container {
    min-height: 500px;
    margin-top: 25px;
    border-top: 1px solid #eaeaea;
    padding-top: 0;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #ddd;
    border-radius: 8px;
    border-top: none;
}

.tabs {
    display: flex;
    list-style: none;
    margin: 5px;
    background: #f8f9fa;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #eaeaea;
    overflow: hidden
}

.tab {
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    padding: 0;
    margin: 0 4px;
    min-width: 120px;
    user-select: none;
}

/* استایل دکمه‌ها */
.tabs button {
    background: transparent;
    border: none;
    padding: 12px 24px;
    margin: 0;
    margin-bottom: -10px;
    font: inherit;
    color: #555;
    cursor: pointer;
    width: 100%;
    text-align: center;
    border-radius: 10px;
    transition: all 0.25s ease;
    font-weight: 600;
    font-size: 1.2rem;
}

.tabs button:hover {
    color: #007bff;
    background: #f0f7ff;
}

/* استایل تب فعال — روی دکمه */
.tabs button.active {
    color: #007bff;
    background: #ffffff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
    border: 1px solid #d0e6ff;
    border-bottom: none;
}

/* محتوای تب‌ها */
.tab-content {
    display: block !important;
    visibility: hidden;
    opacity: 0;
    height: 0;
    overflow: hidden;
    position: relative;
    transition: opacity 0.2s ease;
    margin: 20px 40px 20px 30px;
    line-height: 2.2;

}


.tab-content.active {
    visibility: visible;
    opacity: 1;
    height: auto;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* استایل بخش نظرات */
.comments-section {
    width: 70%;
    padding-top: 0;
}

.comments-section p {

    margin-bottom: 50px;
}

/* استایل نظرات */
.comment {
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    margin-bottom: 15px;
}

.comment-date {
    font-size: 1.2rem;
    color: #888;
    margin: 20px 30px;
}

/* استایل نام کاربر و تاریخ */
.comment strong {
    display: block;
    color: #000;
    font-size: 1.8rem;
}

/* استایل فرم ارسال نظر */
.comment-form {
    margin-top: 20px;

    padding: 15px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px;

}

.comment p {
    font-size: 1.5rem;

}

.comment-form p {
    margin: 20px 0;

}

.comment-form input[type="text"],
.comment-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.comment-form button {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.comment-form button:hover {
    background-color: #0069d9;
}

.comments-section textarea {
    width: 90%;
    aspect-ratio: 7/2;
    font-size: 1.5rem;
    padding: 30px;
}



.cat-list {
    max-width: 1500px;
    width: 100%;
    position: relative;
    padding: 0;
    margin: 10;
    display: flex;
    overflow: hidden;
    height: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    user-select: none;
}

/* شروع اسلایدر */
.nproduct,
.list-wrapper {
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    margin: 10px;
    border: solid 1px var(--accent);
    border-radius: 20px;
    margin-top: 20px;
    min-height: 550px;

}

.list-wrapper {
    background-color: #fff;
}

.nproduct.new{
    background-color: #00ff1694;
}
.nproduct.pustomu , .nproduct.bhdashti{
    background-color: #f6eeee47;
}


.newproduct {
    display: flex;
    justify-content: space-between;
    border-radius: 20px;
    margin: 10px;
    align-items: center;
    height: 70px;
}

.newproduct p:nth-child(1) {
    font-size: 1.5rem;
    padding: 10px;

}

.newproduct p:nth-child(3),
.list-wrapper .newproduct a {
    background-color: #19f541;
    font-size: 1rem;
    cursor: pointer;
    margin-left: 30px;
    text-align: center;
    padding: 20px;
    border-radius: 20px;
    position: relative;
}

.line {
    flex-grow: 1;
    height: 2px;
    background-color: rgb(124, 124, 124);
    margin: 0 20px;

}

.wrapper,
.cat-list {
    max-width: 1500px;
    width: 100%;
    position: relative;
    padding: 0;
    margin: 10;
    display: flex;
    overflow: hidden;
    height: auto;
}


.wrapper span:active,
.card__action span:active,
.list-wrapper .arrow:active {
    transform: translateY(-55%) scale(0.85);
}

.wrapper span:first-child {
    left: 10px;
}


.wrapper .carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 16px;
    padding: 0 16px 20px;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.carousel .card,
.slide-item {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    flex: 0 0 calc(16.666% - 20px);
    margin: 0 8px;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 240px;
    max-width: 280px;
    height: 450px;
    /* ⬅️ ارتفاع ثابت برای پر کردن فضا */
    padding: 16px;
}

.carousel .card a,
.slide-item a {
    width: 100%;
    height: 100%;
    color: #000;
}

.carousel .card .img-ratio {
    width: 100%;
    position: relative;
    padding-top: calc(2 / 3 * 100%);
    overflow: hidden;
}


.carousel .card img,
.slide-item img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    margin-bottom: 16px;
}

.cardheader {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 12px;
}

.cardtitle {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
    text-align: right;
    direction: rtl;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    min-height: 3.2em;
}

.card hr {
    width: 90%;
    border: 1px solid #9a9a9a;
}

.cardprice {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    margin-top: auto;
    padding-top: 12px;

}

.discount-button {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 5;
}

.discount-button button {
    background: #ff5722;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 6px 10px;
    font-size: 0.9rem;
    font-weight: bold;
}

.discount-percentage {
    position: absolute;
    top: 200px;
    left: 16px;
    background: #4CAF50;
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: bold;
    z-index: 5;
}

.carousel::-webkit-scrollbar {
    display: none;
}

.carousel.no-transition {
    scroll-behavior: auto;
}

.carousel :where(.card, .img) {
    display: flex;
    justify-content: center;
    align-items: center;
}

.cardprice h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #d32f2f;
    margin: 0;
    direction: rtr;
    text-align: left;
}

.carousel .card h3,
.carousel {
    margin-right: 10px;
    flex-direction: row;
    white-space: nowrap;
    direction: rtl;

}

.carousel .card span {
    color: #6A6D78;
    font-size: 1.31rem;
}

.carousel .card strike,
.cardprice strike {
    font-size: 1.1rem;
    color: #777;
    text-decoration: line-through;
    margin-top: 10px;

}

.out-of-stock {
    color: #999 !important;
    font-size: 1.3rem !important;
    font-weight: 700;
}

.hidden {
    display: none !important;
}

.wrapper .sleft,
.wrapper .sright,
.list-wrapper .arrow {
    top: 50%;
    height: 50px;
    width: 50px;
    cursor: pointer;
    font-size: 2rem;
    position: absolute;
    text-align: center;
    background: #ffffff;
    border-radius: 50%;
    transform: translateY(-100%);
    transition: transform 0.1s linear;
    z-index: 900;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wrapper .sleft:hover,
.wrapper .sright:hover,
.list-wrapper .arrow:hover {
    background: #e2e5e7;
}

.card__action {
    color: white;
    padding: 10px 15px;
    margin-bottom: 10px;
    text-align: center;
    position: absolute;
    display: block;
    font-size: 16px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.5s ease;
    top: 10%;
    left: -60%;
    opacity: 1;

}

.card:hover .card__action,
.slide-item:hover .card__action {
    opacity: 1;
    left: 10%;
    transition: all 0.5s ease 0s;
}

.card:hover .card__action .icon,
.slide-item:hover .card__action .icon {
    border: 3px solid #002aff;
    cursor: pointer;
}

.card__action .icon {
    background: #ffeeeecc;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.add-to-cart {
    border: none;
    border-radius: 50%;
}


@media (max-width: 1023px) {
    .thumbnail{
        width: 60px;
        height: 60px;
    }
    .newproduct .dragging .slide-item a {
  pointer-events: none;
}

/* جلوگیری از highlight لمسی */
.slide-item a {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

/* اجازه اسکرول افقی */
.carousel-list {
  touch-action: pan-x;
}
.tab-content {

    margin: 20px 10px 20px 10px;

}
.comments-section p {
    margin-bottom: 10px !important;
    margin-right: 10px !important;
}
    .product-container {
        margin: 0;
        flex-direction: column;
    }


    .mapping {
        padding: 2px;
        margin: 0;
    }

    .mapping a {
        margin: 0 5px;
        font-size: 0.6rem;
    }

    .product-title {
        font-size: 1.2rem;

    }

    .product-details hr {
        margin: 8px;
    }

    .comments-section {
        width: 100%;
        min-height: 1000px;
    }

    .comments-section textarea {
        width: 90%;
        aspect-ratio: 7/3;
        font-size: 1.5rem;
        padding: 30px;
    }


    .modal-image {
        height: auto;
        aspect-ratio: 3 / 4;
        margin-top: 30%;
        width: 80%;
    }

    .modal-thumbnail {
        width: 22%;
        margin-top: 10%;
    }

    .tabs {
        justify-content: center;
        padding: 0;
        margin: 3px;
    }

    .tabs button {
        font-size: 1rem;
        padding: 12px 4px;
    }

    .newproduct p:nth-child(1) {
        font-size: 1rem;
        padding: 10px;
    }

    .newproduct p:nth-child(3) {
        font-size: 1rem;
        margin-left: 10px;
        padding: 10px;
        border-radius: 12px;

    }

 
    .slide-item {
        height: auto;
        min-height: unset;
        max-height: calc(50vh - 60px);
        padding: 12px;
    }

    .slide-item img {
        height: 160px;
    }

    .cardtitle {
        font-size: 1.1rem;
        min-height: 2.8em;
    }

    .cardprice h3 {
        font-size: 1rem;
    }

    .newproduct {
        height: 60px;
    }

    .newproduct p:nth-child(1) {
        font-size: 1.25rem;
    }

   
    .newproduct p:nth-child(3) {
        padding: 14px;
        font-size: 0.9rem;
    }
    .card__action {

    left: 10%;

}
.wrapper .sleft, .wrapper .sright{
    height: 35px;
    width: 35px;
    font-size: 1.5rem;
}
}