/* ============================================================
   Setak Bamar - Single Product Page (single-product.php)
============================================================ */

.setak-single-product-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    direction: rtl;
}

/* --- بردکرامب --- */
.setak-breadcrumb {
    font-size: 13px;
    color: #888;
    margin-bottom: 20px;
}
.setak-breadcrumb a { color: #977837; text-decoration: none; }
.setak-breadcrumb a:hover { text-decoration: underline; }
.setak-breadcrumb span { color: #333; font-weight: 600; }

/* --- بخش بالا: گالری + اطلاعات + کارت خرید --- */
.setak-sp-top {
    display: flex;
    align-items: flex-start;
    gap: 40px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 25px;
    padding: 30px;
    box-shadow: -8px 8px 0px 0px #f3ebd8;
    margin-bottom: 30px;
}

.setak-sp-gallery { flex: 1.1; max-width: 460px; }
.setak-sp-info { flex: 1.3; display: flex; flex-direction: column; min-width: 0; }
.setak-sp-sidebar { flex: 0.8; max-width: 300px; }

/* --- گالری --- */
.setak-pg-main {
    position: relative;
    width: 100%;
    height: 420px;
    border-radius: 20px;
    overflow: hidden;
    background: #F9FAFB;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-in;
}
.setak-pg-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.25s;
}
.setak-pg-sale-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #d4af37;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
}
.setak-pg-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.setak-pg-thumb-btn {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    border-radius: 12px;
    border: 2px solid #eee;
    background: #F9FAFB;
    padding: 4px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.setak-pg-thumb-btn img { width: 100%; height: 100%; object-fit: contain; }
.setak-pg-thumb-btn.setak-active,
.setak-pg-thumb-btn:hover { border-color: #D3A16A; }

/* --- اطلاعات محصول --- */
.setak-sp-title {
    font-size: 24px;
    font-weight: 800;
    color: #2b2b2b;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.setak-sp-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
}

.setak-sp-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}
.setak-sp-stars {
    --percent: calc(var(--rating) / 5 * 100%);
    display: inline-block;
    font-size: 18px;
    line-height: 1;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #f5a623 var(--percent), #ddd var(--percent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.setak-sp-review-count { font-size: 12px; color: #977837; text-decoration: none; }
.setak-sp-review-count:hover { text-decoration: underline; }

.setak-sp-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    padding: 18px 0;
    border-top: 1px dashed #eee;
    border-bottom: 1px dashed #eee;
    margin-bottom: 18px;
}
.setak-sp-price-amount { font-size: 28px; font-weight: 800; color: #333; }
.setak-sp-price-currency { font-size: 14px; color: #666; font-weight: 600; }
.setak-sp-price-original { font-size: 15px; color: #aaa; text-decoration: line-through; }
.setak-sp-discount-percent {
    background: #fdeaea;
    color: #d84343;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 10px;
}

.setak-sp-short-desc {
    font-size: 14px;
    color: #555;
    line-height: 1.9;
    margin-bottom: 18px;
}

.setak-sp-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    width: fit-content;
    margin-bottom: 20px;
}
.setak-in-stock { background: #e9f7ef; color: #1e8449; }
.setak-out-of-stock { background: #fdecea; color: #c0392b; }

/* --- انتخاب تنوع محصول (متغیر) --- */
.setak-variation-row {
    margin-bottom: 15px;
}
.setak-variation-row label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #444;
    margin-bottom: 8px;
}
.setak-variation-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.setak-pill-btn {
    padding: 8px 18px;
    border: 1px solid #e3d4b7;
    border-radius: 10px;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.setak-pill-btn:hover { border-color: #D3A16A; }
.setak-pill-btn.setak-selected {
    background: #7F8756;
    border-color: #7F8756;
    color: #fff;
}
.setak-pill-btn.setak-unavailable {
    opacity: 0.4;
    cursor: not-allowed;
    text-decoration: line-through;
}
.setak-variation-result {
    background: #F0EADC;
    border-radius: 12px;
    padding: 12px 16px;
    margin: 15px 0;
    font-size: 13px;
    color: #555;
}
.setak-variation-placeholder { margin: 0; }
.setak-variation-result.setak-has-variation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    color: #333;
}

/* --- انتخاب تعداد --- */
.setak-qty-stepper {
    display: flex;
    align-items: center;
    width: fit-content;
    border: 1px solid #e3d4b7;
    border-radius: 12px;
    overflow: hidden;
    margin: 10px 0 5px 0;
}
.setak-qty-stepper button {
    width: 38px;
    height: 42px;
    border: none;
    background: #F0EADC;
    font-size: 18px;
    cursor: pointer;
    color: #444;
}
.setak-qty-input {
    width: 50px;
    height: 42px;
    border: none;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    -moz-appearance: textfield;
}
.setak-qty-input::-webkit-outer-spin-button,
.setak-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* --- کارت خرید (ساید‌بار چسبان) --- */
.setak-sp-sidebar-sticky {
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #FAF7F0;
    border: 1px solid #f0e8d5;
    border-radius: 20px;
    padding: 20px;
}

.setak-sp-buybox {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.setak-sp-buybox .setak-sp-price {
    padding: 0 0 12px 0;
    border-top: none;
    border-bottom: 1px dashed #e6dcc4;
    margin: 0;
}
.setak-sp-buybox .setak-qty-stepper { width: 100%; justify-content: center; }
.setak-sp-buybox .setak-variation-result { margin: 0; }

.setak-accordion-empty { color: #999; font-style: italic; }

.setak-sp-add-to-cart-btn {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #D3A16A;
    color: #fff;
    border: none;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}
.setak-sp-add-to-cart-btn:hover { background: #bb8a56; transform: translateY(-2px); }
.setak-sp-add-to-cart-btn:disabled,
.setak-sp-add-to-cart-btn.setak-disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}
.setak-sp-add-to-cart-btn.added::after {
    content: ' ✓';
}

.setak-sp-wishlist-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
}
.setak-sp-wishlist-btn:hover { border-color: #D3A16A; color: #D3A16A; }

.setak-sp-trust-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.setak-sp-trust-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    background: #fff;
    border: 1px solid #f0e8d5;
    border-radius: 12px;
    padding: 14px 8px;
    font-size: 11px;
    color: #666;
}
.setak-sp-trust-box svg { color: #D3A16A; }

.setak-sp-mini-review {
    background: #fff;
    border: 1px solid #f0e8d5;
    border-radius: 12px;
    padding: 14px;
}
.setak-sp-mini-review-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.setak-sp-mini-review-head img { border-radius: 50%; }
.setak-sp-mini-review-head strong { display: block; font-size: 13px; color: #333; }
.setak-sp-mini-stars {
    --percent: calc(var(--rating) / 5 * 100%);
    font-size: 12px;
    letter-spacing: 1px;
    background: linear-gradient(90deg, #f5a623 var(--percent), #ddd var(--percent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.setak-sp-mini-review p { margin: 0; font-size: 12.5px; color: #666; line-height: 1.8; }

/* --- بخش توضیحات / مشخصات / راهنما (تمام‌عرض، زیر سه ستون) --- */
.setak-sp-details {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 25px;
    padding: 10px 30px 30px;
    box-shadow: -8px 8px 0px 0px #f3ebd8;
    margin-bottom: 40px;
}

.setak-sp-accordions { display: flex; flex-direction: column; }
.setak-accordion-item {
    border-bottom: 1px solid #f0ebe0;
}
.setak-accordion-item:last-child { border-bottom: none; }
.setak-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: none;
    border: none;
    padding: 20px 5px;
    font-size: 15px;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    font-family: inherit;
}
.setak-accordion-arrow { transition: transform 0.25s; color: #977837; flex-shrink: 0; }
.setak-accordion-item.setak-open .setak-accordion-arrow { transform: rotate(180deg); }
.setak-accordion-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.setak-accordion-item.setak-open .setak-accordion-body { max-height: 2000px; }
.setak-accordion-body-inner {
    padding: 0 5px 25px;
    font-size: 14px;
    color: #555;
    line-height: 2;
}

.setak-sp-attrs-table { width: 100%; border-collapse: collapse; }
.setak-sp-attrs-table tr { border-bottom: 1px solid #f5f5f5; }
.setak-sp-attrs-table th {
    text-align: right;
    padding: 12px 15px;
    background: #FAF7F0;
    font-weight: 700;
    color: #444;
    width: 220px;
}
.setak-sp-attrs-table td { padding: 12px 15px; color: #666; }

/* ============================================================
   بخش نظرات کاربران
   (این بخش قبلاً هیچ استایلی نداشت و با حذف استایل پیش‌فرض
   ووکامرس، هم خلاصه‌ی امتیازها و هم فرم دیدگاه کاملاً بدون
   طراحی و درهم نمایش داده می‌شدند)
============================================================ */
.setak-sp-reviews-section {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 25px;
    padding: 10px 30px 35px;
    box-shadow: -8px 8px 0px 0px #f3ebd8;
    margin-bottom: 40px;
}

/* --- خلاصه امتیازها --- */
.setak-reviews-summary {
    display: flex;
    align-items: center;
    gap: 40px;
    padding: 25px 0 30px;
    border-bottom: 1px dashed #eee;
    margin-bottom: 25px;
    flex-wrap: wrap;
}
.setak-reviews-avg {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    min-width: 140px;
}
.setak-reviews-avg-number { font-size: 40px; font-weight: 800; color: #333; line-height: 1; }
.setak-reviews-avg-count { font-size: 12px; color: #999; }

.setak-reviews-bars { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 8px; }
.setak-reviews-bar-row { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #666; }
.setak-reviews-bar-label { width: 55px; flex-shrink: 0; }
.setak-reviews-bar-track {
    flex: 1;
    height: 8px;
    background: #f0ebe0;
    border-radius: 10px;
    overflow: hidden;
}
.setak-reviews-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #f5a623, #D3A16A);
    border-radius: 10px;
    transition: width 0.4s ease;
}
.setak-reviews-bar-count { width: 24px; flex-shrink: 0; text-align: left; color: #999; }

/* --- لیست دیدگاه‌ها و فرم ثبت‌نظر (خروجی native ووکامرس comments_template) --- */
.setak-reviews-list #comments { margin-bottom: 10px; }
.setak-reviews-list .woocommerce-Reviews-title {
    font-size: 17px;
    font-weight: 800;
    color: #333;
    margin: 0 0 15px;
}
.setak-reviews-list .woocommerce-noreviews {
    font-size: 14px;
    color: #888;
    background: #FAF7F0;
    padding: 14px 18px;
    border-radius: 12px;
    margin: 0 0 25px;
}

.setak-reviews-list .commentlist { list-style: none; margin: 0 0 25px; padding: 0; }
.setak-reviews-list .commentlist .comment {
    display: flex;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid #f5f0e3;
}
.setak-reviews-list .commentlist .comment:last-child { border-bottom: none; }
.setak-reviews-list .commentlist img.avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
}
.setak-reviews-list .comment-text { flex: 1; }
.setak-reviews-list .comment-text .meta { font-size: 13px; font-weight: 700; color: #333; margin-bottom: 4px; }
.setak-reviews-list .comment-text .description p { margin: 6px 0 0; font-size: 13.5px; color: #666; line-height: 1.9; }
.setak-reviews-list .comment-text .star-rating {
    position: relative;
    display: inline-block;
    height: 16px;
    line-height: 16px;
    width: 90px;
    font-size: 14px;
    letter-spacing: 2px;
    color: #ddd;
    margin-bottom: 4px;
}
.setak-reviews-list .comment-text .star-rating::before {
    content: '★★★★★';
    position: absolute;
    inset: 0;
}
.setak-reviews-list .comment-text .star-rating span {
    position: absolute;
    inset: 0;
    overflow: hidden;
    color: #f5a623;
}
.setak-reviews-list .comment-text .star-rating span::before { content: '★★★★★'; }

/* --- فرم ثبت دیدگاه --- */
.setak-reviews-list #review_form_wrapper {
    background: #FAF7F0;
    border-radius: 16px;
    padding: 24px;
}
.setak-reviews-list #reply-title {
    display: block;
    font-size: 15px;
    font-weight: 800;
    color: #333;
    margin: 0 0 18px;
}
.setak-reviews-list #reply-title small { display: block; font-size: 12px; font-weight: 400; margin-top: 6px; }
.setak-reviews-list #reply-title small a { color: #d84343; }

.setak-reviews-list .comment-form-rating { margin-bottom: 16px; }
.setak-reviews-list .comment-form-rating label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #444;
    margin-bottom: 10px;
}
.setak-reviews-list .comment-form-rating .required { color: #d84343; }
.setak-reviews-list p.stars { margin: 0; }
.setak-reviews-list p.stars span {
    display: inline-flex;
    flex-direction: row-reverse; /* در RTL: ستاره ۱ سمت راست، ستاره ۵ سمت چپ */
    gap: 4px;
}
.setak-reviews-list p.stars a {
    position: relative;
    display: inline-block;
    width: 26px;
    height: 24px;
    font-size: 0; /* متن پیش‌فرض «۱ از ۵ ستاره» مخفی می‌شود */
    text-decoration: none;
}
.setak-reviews-list p.stars a::before {
    content: '★';
    position: absolute;
    inset: 0;
    font-size: 24px;
    line-height: 24px;
    text-align: center;
    color: #ddd;
    transition: color 0.15s;
}
.setak-reviews-list p.stars a.setak-star-hover::before,
.setak-reviews-list p.stars a.setak-star-selected::before {
    color: #f5a623;
}

.setak-reviews-list .comment-form-comment { margin-bottom: 16px; }
.setak-reviews-list .comment-form-comment label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #444;
    margin-bottom: 8px;
}
.setak-reviews-list .comment-form-comment textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px 14px;
    border: 1px solid #e3d4b7;
    border-radius: 12px;
    font-family: inherit;
    font-size: 13.5px;
    color: #333;
    resize: vertical;
}
.setak-reviews-list .comment-form-comment textarea:focus { outline: none; border-color: #D3A16A; }

.setak-reviews-list .form-submit { margin: 0; }
.setak-reviews-list .form-submit #submit {
    background: #7F8756;
    color: #fff;
    border: none;
    padding: 12px 35px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}
.setak-reviews-list .form-submit #submit:hover { background: #6a7147; }

/* --- محصولات مرتبط --- */
.setak-sp-related { margin-bottom: 40px; }
.setak-sp-related .setak-products-wrapper { position: relative; }

/* اسلایدر خودکفا (مستقل از استایل کاتالوگ که فقط در صفحه فروشگاه لود می‌شود) */
.setak-sp-related .setak-products-container {
    overflow: hidden;
}
.setak-sp-related .setak-products-slider {
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.setak-sp-related .setak-products-slider::-webkit-scrollbar { display: none; }
.setak-sp-related .setak-products-slider > * {
    flex: 0 0 auto;
    width: 240px;
    scroll-snap-align: start;
}
.setak-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #eee;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #977837;
    z-index: 2;
    transition: opacity 0.2s;
}
.setak-slider-btn svg { width: 18px; height: 18px; }
.setak-slider-btn:hover { background: #FAF7F0; }
.setak-slider-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.setak-slider-prev { right: -18px; }
.setak-slider-next { left: -18px; }
@media (max-width: 768px) {
    .setak-slider-prev { right: 0; }
    .setak-slider-next { left: 0; }
}

/* --- لایت‌باکس تصاویر --- */
.setak-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(20, 18, 14, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
}
.setak-lightbox.setak-lightbox-open {
    opacity: 1;
    visibility: visible;
}
.setak-lightbox-stage {
    width: min(90vw, 900px);
    height: min(80vh, 700px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.setak-lightbox-stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    transition: opacity 0.2s, transform 0.2s;
}
.setak-lightbox-close {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}
.setak-lightbox-close:hover { background: rgba(255,255,255,0.2); }
.setak-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
.setak-lightbox-nav svg { width: 22px; height: 22px; }
.setak-lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.setak-lightbox-prev { right: 20px; }
.setak-lightbox-next { left: 20px; }
.setak-lightbox-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 13px;
    background: rgba(255,255,255,0.1);
    padding: 6px 14px;
    border-radius: 20px;
}

/* --- ریسپانسیو --- */
@media (max-width: 992px) {
    .setak-sp-top { flex-direction: column; }
    .setak-sp-gallery { max-width: 100%; }
    .setak-sp-sidebar { max-width: 100%; }
    .setak-sp-sidebar-sticky { position: static; }
    .setak-sp-buybox { display: none; } /* دکمه خرید در نوار چسبان پایین موبایل نمایش داده می‌شود */
    .setak-pg-main { height: 320px; }
}

@media (max-width: 768px) {
    .setak-single-product-page { padding: 12px; }
    .setak-sp-top,
    .setak-sp-details { padding: 18px; border-radius: 18px; }
    .setak-sp-title { font-size: 19px; }
    .setak-sp-price-amount { font-size: 22px; }
    .setak-pg-main { height: 260px; }
    .setak-lightbox-prev { right: 10px; }
    .setak-lightbox-next { left: 10px; }
    .setak-sp-attrs-table th { width: auto; }
}

/* --- نوار چسبان پایین صفحه (موبایل) --- */
.setak-sp-mobile-bar {
    display: none;
}
@media (max-width: 992px) {
    .setak-sp-mobile-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 15px;
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        z-index: 500;
        background: #fff;
        box-shadow: 0 -4px 15px rgba(0,0,0,0.08);
        padding: 12px 18px;
    }
    .setak-sp-mobile-bar-price {
        display: flex;
        align-items: baseline;
        gap: 6px;
        font-size: 18px;
        font-weight: 800;
        color: #333;
        white-space: nowrap;
    }
    .setak-mobile-add-btn { width: auto; flex: 1; max-width: 220px; }
}