/* File: assets/css/product-page.css (FINAL - HIGH SPECIFICITY)
   Refactored to Canonical Tokens
*/

/* Bulk Price Widget */
.elementor-widget-ganjeh-kala-bulk-price .spd-bulk-price-wrapper {
    background-color: var(--gk-neutral-100) !important;
    border-radius: var(--gk-radius-md) !important;
    padding: 1rem !important;
    margin: 1.5rem 0 !important;
    direction: rtl !important;
}

.elementor-widget-ganjeh-kala-bulk-price .spd-bulk-price-container {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.elementor-widget-ganjeh-kala-bulk-price .spd-bulk-price-item {
    display: flex !important;
    flex-direction: column !important;
}

.elementor-widget-ganjeh-kala-bulk-price .spd-bulk-price-item:first-child {
    align-items: flex-start !important;
}
.elementor-widget-ganjeh-kala-bulk-price .spd-bulk-price-item:last-child {
    align-items: flex-end !important;
}

.elementor-widget-ganjeh-kala-bulk-price .spd-title,
.elementor-widget-ganjeh-kala-bulk-price .spd-min-qty {
    font-size: 14px !important;
    color: var(--gk-neutral-600) !important;
    margin-bottom: 8px !important;
    font-weight: normal !important;
}

.elementor-widget-ganjeh-kala-bulk-price .spd-retail-price,
.elementor-widget-ganjeh-kala-bulk-price .spd-discounted-price {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: var(--gk-text) !important;
}

.elementor-widget-ganjeh-kala-bulk-price .spd-bulk-values {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.elementor-widget-ganjeh-kala-bulk-price .spd-discount-percentage {
    order: 1 !important;
    background-color: var(--gk-primary) !important;
    color: var(--gk-surface) !important;
    padding: 2px 10px !important;
    border-radius: 16px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
}

/* ——— Product Gallery ——— */
.gk-gallery-thumbs { position: relative; }
.gk-gallery-thumbs .gk-thumbs-track {
    display: flex; gap: 8px; overflow-x: auto; scroll-behavior: smooth;
    -ms-overflow-style: none; scrollbar-width: none;
}
.gk-gallery-thumbs .gk-thumbs-track::-webkit-scrollbar { display: none; }

.gk-gallery-thumbs .gk-thumb { flex: 0 0 auto; }
.gk-gallery-thumbnail { display: block; width: 60px; height: 60px; object-fit: cover; border-radius: var(--gk-radius-sm); }

.gk-thumbs-next, .gk-thumbs-prev {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; border: 0; cursor: pointer; background: rgba(0,0,0,var(--gk-opacity-overlay));
    border-radius: 50%;
}
.gk-thumbs-next { right: -4px; }
.gk-thumbs-prev { left: -4px; }

.gk-thumbs-next::before, .gk-thumbs-prev::before {
    content: ''; display: block; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; margin: 0 auto;
    transform: rotate(-45deg);
}
.gk-thumbs-prev::before { transform: rotate(135deg); }

/* ——— Breadcrumb ——— */
.gk-breadcrumb {
    display: inline-block; /* نمایش در یک خط */
    font-size: 14px;
    margin: 0;
    padding: 0;
}

.gk-breadcrumb ul {
    display: inline; /* آیتم‌ها در یک خط */
    padding: 0;
    margin: 0;
    list-style: none;
}

.gk-breadcrumb li {
    display: inline;
    margin: 0;
    padding: 0;
}

.gk-breadcrumb li:not(:last-child)::after {
    content: " / "; /* جداکننده بین آیتم‌ها */
    color: var(--gk-secondary); /* رنگ جداکننده */
    margin: 0 5px;
}

.gk-breadcrumb li a {
    text-decoration: none;
    color: var(--gk-secondary);
}

.gk-breadcrumb li a:hover {
    text-decoration: underline;
}

.gk-breadcrumb li:last-child a,
.gk-breadcrumb li:last-child span {
    color: var(--gk-neutral-600); /* آیتم آخر به رنگ متفاوت */
    cursor: default;
    pointer-events: none; /* آیتم آخر کلیک‌پذیر نباشد */
}

/* ——— Product Brand ——— */
.gk-product-brand {
    display: inline-flex;
    align-items: baseline;
    gap: 0; /* فاصله را با کنترل Elementor تنظیم می‌کنیم */
    font: inherit;
    color: inherit;
}

.gk-product-brand__label {
    color: var(--gk-neutral-600);
    margin-inline-end: 6px; /* با کنترل gap_inline قابل تغییر است */
}

.gk-product-brand__link {
    text-decoration: none;
}

.gk-product-brand__link:hover {
    text-decoration: underline;
}

/* ——— Product Title ——— */
.gk-title {
    line-height: 1.4;
    word-wrap: break-word;
}

/* ——— Product SKU ——— */
.gk-sku{
    display: flex;
    align-items: center;
    justify-content: flex-start; /* با کنترل container_align تغییر می‌کند */
    gap: 0; /* فاصلهٔ لیبل با کنترل inline_gap ست می‌شود */
}

.gk-sku__label{
    font-weight: 600;
    margin-inline-end: 5px; /* قابل override توسط کنترل المنتور */
    color: var(--gk-text);
}

.gk-sku__value{
    color: var(--gk-secondary);
}

.gk-sku--empty{
    color: var(--gk-neutral-500);
}

/* ——— Product Rating ——— */
.gk-rating{
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 16px; /* با کنترل تایپوگرافی قابل تغییر است */
    color: var(--gk-text);
}

.gk-rating__icon{
    display:inline-flex;
    align-items:center;
}

.gk-rating__icon img{
    display:block;
}

.gk-rating__icon--text{
    font-size: 18px;
    line-height: 1;
    color: var(--gk-accent);
}

.gk-rating__text{
    display:inline-flex;
    align-items:center;
    gap: 6px;
}

.gk-rating__value{
    font-weight: 600;
}

.gk-rating__count{
    opacity:.85;
}

/* ——— Review Button ——— */
.gk-review-btn{
    display: inline-flex;
    align-items: center;
    justify-content: center; /* با کنترل content_alignment قابل تغییر است */
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, box-shadow .2s ease;
}

.gk-review-btn__text{
    line-height: 1.4;
}

.gk-review-btn__icon{
    display: inline-flex;
    align-items: center;
}

.gk-review-btn svg{
    display: block;
}
/* ——— Attributes Swiper Modern UI ——— */
.gk-attr-swiper {
    position: relative;
    padding: 10px 0; /* فضای تنفس برای سایه‌ها */
}

/* Base Card Style */
.gk-att-box {
    background-color: var(--gk-surface, #ffffff);
    border: 1px solid var(--gk-border-color, #eaeaea);
    border-radius: var(--gk-radius, 12px);
    padding: 12px 16px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all var(--gk-duration-fast, 0.2s) ease-in-out;
    box-sizing: border-box;
}

.gk-att-box:hover {
    border-color: var(--gk-primary);
    box-shadow: var(--gk-shadow-sm, 0 4px 12px rgba(0,0,0,0.05));
    transform: translateY(-2px);
}

.gk-att-box--center {
    align-items: center;
    text-align: center;
    background-color: transparent;
    border: 1px dashed var(--gk-border-color, #ccc);
}

.gk-att-box--center:hover {
    background-color: color-mix(in srgb, var(--gk-primary) 5%, transparent);
}

/* Typography */
.gk-att-name {
    font-size: 11px;
    font-weight: 500;
    color: var(--gk-text, #666);
    opacity: 0.7;
    margin: 0 0 4px 0;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gk-att-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--gk-text, #222);
    margin: 0;
    line-height: 1.5;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gk-att-value.is-truncated {
    cursor: help;
    border-bottom: 1px dotted var(--gk-primary);
    display: inline;
}

/* View All Button */
.gk-att-viewall {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--gk-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    width: 100%;
    height: 100%;
    transition: color 0.2s ease;
}

.gk-att-viewall-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--gk-primary) 10%, transparent);
    border-radius: 50%;
    padding: 4px;
    transition: transform 0.3s ease;
}

.gk-att-viewall:hover .gk-att-viewall-icon {
    transform: translateX(-4px); /* حرکت به سمت چپ برای زبان راست‌چین */
    background: var(--gk-primary);
    color: #fff;
}

/* Skeleton Loading (Modernized) */
.gk-skel {
    background: linear-gradient(90deg, var(--gk-surface, #f0f0f0) 25%, #e0e0e0 50%, var(--gk-surface, #f0f0f0) 75%);
    background-size: 200% 100%;
    animation: gk-skel-loading 1.5s infinite linear;
    border-radius: 4px;
}
.gk-skel--line { height: 10px; margin: 0 0 8px 0; width: 50%; }
.gk-skel--w80 { width: 80%; height: 14px; margin-bottom: 0; }
@keyframes gk-skel-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Swiper Initial States */
.swiper-slide.is-skeleton { opacity: 1; }
.swiper-slide.is-hidden-real { display: none; }

/* Pagination (Dots) */
.gk-attr-swiper .swiper-pagination {
    position: relative;
    margin-top: 16px;
}
.gk-attr-swiper .swiper-pagination-bullet {
    width: 6px;
    height: 6px;
    background: var(--gk-text, #000);
    opacity: 0.2;
    transition: all 0.3s ease;
    border-radius: 10px;
}
.gk-attr-swiper .swiper-pagination-bullet-active {
    background: var(--gk-primary);
    opacity: 1;
    width: 16px; /* افکت کپسولی برای نقطه فعال */
}

/* Navigation (Arrows) */
.gk-attr-swiper .swiper-button-prev,
.gk-attr-swiper .swiper-button-next {
    width: 36px;
    height: 36px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--gk-surface, #ffffff);
    color: var(--gk-text, #333);
    border: 1px solid var(--gk-border-color, #eaeaea);
    border-radius: 50%;
    box-shadow: var(--gk-shadow-sm, 0 2px 8px rgba(0,0,0,0.1));
    transition: all var(--gk-duration-fast, 0.2s) ease;
}

.gk-attr-swiper .swiper-button-prev:hover,
.gk-attr-swiper .swiper-button-next:hover {
    background: var(--gk-primary);
    color: #ffffff;
    border-color: var(--gk-primary);
}

.gk-attr-swiper .swiper-button-prev::after,
.gk-attr-swiper .swiper-button-next::after {
    font-size: 12px;
    font-weight: bold;
}

/* تنظیم موقعیت فلش‌ها برای بیرون نزدن از کادر */
.gk-attr-swiper .swiper-button-next { left: -10px; right: auto; }
.gk-attr-swiper .swiper-button-prev { right: -10px; left: auto; }
/* یکسان‌سازی ارتفاع تمام باکس‌ها در سوایپر */
.gk-attr-swiper .swiper-slide {
    height: auto !important; /* این باعث می‌شود همه اسلایدها کشیده شوند */
}

/* اطمینان از اینکه خود باکس تمام ارتفاع اسلاید را پر می‌کند */
.gk-att-box {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
/* ساختار مدرن تولتیپ با CSS */
.gk-att-value.is-truncated {
    position: relative;
    cursor: help;
    border-bottom: 1px dotted var(--gk-primary);
}

/* ظاهر تولتیپ */
.gk-att-value.is-truncated::after {
    content: attr(data-full-text);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px) scale(0.95);
    background-color: var(--gk-text, #333333);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: var(--gk-radius-sm, 6px);
    font-size: 11px;
    font-weight: 400;
    white-space: nowrap;
    box-shadow: var(--gk-shadow-sm, 0 4px 8px rgba(0,0,0,0.15));
    opacity: 0;
    visibility: hidden;
    transition: all var(--gk-duration-fast, 0.2s) ease;
    z-index: 100;
    pointer-events: none;
}

/* فلش پایین تولتیپ */
.gk-att-value.is-truncated::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border-width: 5px;
    border-style: solid;
    border-color: var(--gk-text, #333333) transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: all var(--gk-duration-fast, 0.2s) ease;
    z-index: 100;
}

/* نمایش در حالت هاور */
.gk-att-value.is-truncated:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-8px) scale(1);
}
.gk-att-value.is-truncated:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}


/* ——— Rotating product info ——— */
.gk-rot-info {
    position: relative;
    display: flex;
    align-items: center;
    /* ارتفاع را برای جلوگیری از پرش محتوا تنظیم کنید.
       این مقدار باید متناسب با ارتفاع بزرگترین پیام شما باشد. */
    min-height: 2em;
    overflow: hidden;
}

.gk-rot-info__item {
    display: flex;
    align-items: center;
    width: 100%;

    /* حالت اولیه و پنهان آیتم‌ها */
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;

    /* استفاده از متغیر CSS که در PHP ست شده */
    color: var(--msg-color, var(--gk-text));
}

.gk-rot-info__item.is-active {
    /* حالت فعال و نمایان آیتم */
    opacity: 1;
    transform: translateY(0);
    position: relative; /* برای اینکه آیتم فعال جریان عادی صفحه را حفظ کند */
}

.gk-rot-info__icon {
    flex-shrink: 0; /* جلوگیری از کوچک شدن آیکن */
    max-width: 100%;
    height: auto;
}

.gk-rot-info__text {
    /* استایل‌های متن اینجا قرار می‌گیرد */
}

/* ——— Single Attribute ——— */
.gk-single-attr{
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.gk-single-attr__icon{
    display: inline-block;
    height: auto; /* اندازه از طریق کنترل المنتور ست می‌شود */
}

.gk-single-attr__text{
    line-height: 1.5;
}

.gk-single-attr__label{
    font-weight: 600;
}

.gk-single-attr__value{
    /* رنگ و تایپوگرافی از کنترل‌های ویجت تزریق می‌شود */
}

/* QnA Section & Reviews */
:root {
    /* Legacy variables mapped via usage */
}

/* استایل‌های پایه و عمومی */
.qna-section * {
    box-sizing: border-box;
}
.qna-section a {
    text-decoration: none;
    color: inherit;
}
.qna-section button {
    font-family: inherit;
}

/* هدر بخش */
.qna-header {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    gap: 1rem;
}
.qna-title {
    font-size: 1.125rem;
    font-weight: 700;
    border-bottom: 2px solid var(--gk-primary);
    padding-bottom: 0.5rem;
    display: inline-block;
}
.submit-question-box {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
}
.submit-question-box p {
    font-size: 0.875rem;
    color: var(--gk-neutral-600);
}
.submit-question-btn {
    border: 1px solid var(--gk-primary);
    color: var(--gk-primary);
    background-color: transparent;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 200ms, background-color 200ms;
}
.submit-question-btn:hover {
    background-color: var(--gk-primary);
    color: var(--gk-surface);
}

/* فرم ثبت پرسش */
.qna-form-container {
    background-color: var(--gk-neutral-50);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: var(--gk-border-width) solid var(--gk-border-color);
}
.qna-form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}
.qna-form-row .qna-input {
    flex: 1;
}
.qna-input, .qna-textarea {
    width: 100%;
    padding: 0.75rem;
    border: var(--gk-border-width) solid var(--gk-border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--gk-text);
    background-color: var(--gk-surface);
}
.qna-textarea {
    margin-bottom: 1rem;
    resize: vertical;
}
.qna-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}
.qna-form-submit-btn, .qna-form-cancel-btn {
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    font-weight: 700;
    cursor: pointer;
}
.qna-form-submit-btn {
    background-color: var(--gk-primary);
    color: var(--gk-surface);
}
.qna-form-cancel-btn {
    background-color: transparent;
    color: var(--gk-neutral-600);
}
.qna-login-note {
    text-align: center;
    padding: 1rem;
    color: var(--gk-neutral-600);
}

/* نوار مرتب‌سازی */
.qna-sort-bar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    padding-top: 1rem;
    padding-bottom: 1rem;
    border-top: var(--gk-border-width) solid var(--gk-border-color);
    gap: 0.75rem;
}
.question-count {
    color: var(--gk-neutral-600);
    font-size: 0.75rem;
}
.sort-options {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.sort-options > span {
    color: var(--gk-neutral-600);
    font-size: 0.75rem;
}
.sort-options .sort-links {
    display: flex;
    gap: 0.5rem;
}
.sort-options .sort-links a {
    font-size: 0.75rem;
    color: var(--gk-neutral-600);
    transition: color 200ms;
}
.sort-options .sort-links a:hover {
    color: var(--gk-primary);
}
.sort-options .sort-links span {
    color: var(--gk-neutral-600);
    font-size: 0.75rem;
}
.active-sort {
    color: var(--gk-primary) !important;
    font-weight: 700;
}

/* لیست پرسش‌ها */
.qna-list {
    border-top: var(--gk-border-width) solid var(--gk-border-color);
}
.qna-item {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: var(--gk-border-width) solid var(--gk-border-color);
}
.qna-item:last-child {
    border-bottom: none;
}
.question-text {
    font-size: 0.875rem;
    line-height: 1.625;
    font-weight: 500;
    margin-bottom: 0.75rem;
}
.question-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--gk-neutral-600);
    margin-bottom: 1rem;
}
.reply-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--gk-secondary);
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

/* بخش پاسخ */
.answer-container {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-top: 1.5rem;
    background-color: var(--gk-neutral-50);
    padding: 1rem;
    border-radius: 8px;
}
.user-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}
.user-avatar svg {
    color: var(--gk-surface);
    width: 1rem;
    height: 1rem;
}
.answer-content {
    flex: 1;
}
.user-name {
    font-size: 0.75rem;
    font-weight: 700;
    display: block;
}
.answer-text {
    font-size: 0.875rem;
    line-height: 1.625;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}
.answer-date {
    color: var(--color-text-secondary);
    font-size: 0.75rem;
}
/* فرم پاسخ مدیر */
.qna-reply-form {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px dashed var(--gk-secondary);
    border-radius: 8px;
}
.qna-reply-input {
    width: 100%;
    padding: 0.75rem;
    border: var(--gk-border-width) solid var(--gk-border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    color: var(--gk-text);
    background-color: var(--gk-surface);
    margin-bottom: 1rem;
}
.qna-reply-submit-btn {
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    font-weight: 700;
    cursor: pointer;
    background-color: var(--gk-secondary);
    color: var(--gk-surface);
}

/* دکمه‌های لایک و دیس‌لایک */
.qna-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}
.action-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--gk-neutral-600);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 200ms;
}
.action-btn:hover {
    color: var(--gk-primary);
}
.action-btn span {
    font-size: 0.75rem;
}
.action-btn[disabled] {
    color: var(--gk-primary);
    opacity: 0.7;
}

/* دکمه بارگذاری بیشتر */
.qna-pagination {
    text-align: center;
    padding-top: 1.5rem;
}
.qna-load-more-btn {
    border: var(--gk-border-width) solid var(--gk-neutral-600);
    color: var(--gk-text);
    background-color: transparent;
    border-radius: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 200ms;
}
.qna-load-more-btn:hover {
    border-color: var(--gk-primary);
    background-color: var(--gk-primary);
    color: var(--gk-surface);
}

/* استایل آیکون‌های SVG */
.sort-options svg {
    width: 1rem;
    height: 1rem;
    color: var(--gk-neutral-600);
}
.reply-link svg,
.action-btn svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* Media Queries برای واکنش‌گرایی */
@media (min-width: 768px) {
    .qna-section {
        padding: 1.5rem;
    }
    .qna-header {
        flex-direction: row;
        align-items: center;
    }
    .submit-question-box {
        flex-direction: row;
        align-items: center;
        width: auto;
    }
    .qna-title {
        font-size: 1.25rem;
    }
    .qna-sort-bar {
        flex-direction: row;
        align-items: center;
    }
}

.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border: var(--gk-border-width) solid var(--gk-border-color);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}
.reviews-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.rating-value {
    font-size: 2rem;
    font-weight: 700;
}
.rating-value .fa-star {
    color: var(--gk-accent);
    font-size: 1.5rem;
    vertical-align: middle;
}
.rating-details span {
    display: block;
    font-size: 0.9rem;
}
.rating-details small {
    font-size: 0.75rem;
    color: var(--gk-neutral-600);
}
.add-review-box span {
    font-size: 0.8rem;
    color: var(--gk-neutral-600);
    display: block;
    margin-bottom: 0.5rem;
}
.add-review-btn {
    display: inline-block;
    border: 1px solid var(--gk-primary);
    color: var(--gk-primary);
    background: var(--gk-surface);
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}
.add-review-btn:hover {
    background-color: var(--gk-primary);
    color: var(--gk-surface);
}
.reviews-sort-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: var(--gk-border-width) solid var(--gk-border-color);
    padding-bottom: 1rem;
}
.reviews-title {
    font-size: 1.1rem;
    font-weight: 700;
}
.sort-options {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--gk-neutral-600);
}
.sort-links a {
    color: var(--gk-neutral-600);
    text-decoration: none;
    margin: 0 0.5rem;
    transition: color 0.2s;
}
.sort-links a:hover, .sort-links a.active-sort {
    color: var(--gk-primary);
    font-weight: 700;
}
.review-item {
    border-bottom: var(--gk-border-width) solid var(--gk-neutral-50);
    padding: 1.5rem 0;
}
.review-item:last-child {
    border-bottom: none;
}
.review-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.author-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.author-name {
    font-weight: 700;
}
.verified-badge {
    background: #e4f8e4;
    color: #008200;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
}
.review-content p {
    line-height: 1.8;
    color: var(--gk-neutral-700);
}
.review-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}
.review-date {
    font-size: 0.8rem;
    color: var(--gk-neutral-400);
}
.review-actions {
    display: flex;
    gap: 1rem;
}
.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gk-neutral-400);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
}
.action-btn:hover {
    color: var(--gk-text);
}
.action-btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}
.reviews-pagination {
    text-align: center;
    margin-top: 2rem;
}
.reviews-load-more-btn {
    font-family: inherit;
    border: 1px solid var(--gk-neutral-400);
    color: var(--gk-text);
    background-color: transparent;
    border-radius: 8px;
    padding: 0.75rem 2rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.reviews-load-more-btn:hover {
    border-color: var(--gk-primary);
    background-color: var(--gk-primary);
    color: var(--gk-surface);
}
/* Review Form Container */
.review-form-container {
    background-color: #f7f7f7;
    border: var(--gk-border-width) solid var(--gk-border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}
.review-form-rating {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}
.review-form-rating label {
    font-weight: 700;
}
.review-form-content {
    width: 100%;
    padding: 0.75rem;
    border: var(--gk-border-width) solid var(--gk-border-color);
    border-radius: 8px;
    resize: vertical;
    margin-bottom: 1rem;
}
.review-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}
.review-form-submit-btn, .review-form-cancel-btn {
    border: none;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    font-weight: 700;
    cursor: pointer;
}
.review-form-submit-btn {
    background-color: var(--gk-primary);
    color: var(--gk-surface);
}
.review-form-cancel-btn {
    background-color: transparent;
    color: var(--gk-neutral-600);
}
.review-login-note {
    text-align: center;
    padding: 1rem;
    color: var(--gk-neutral-600);
}
.review-login-note a {
    color: var(--gk-secondary);
    font-weight: 700;
}

/* ستاره اصلی در هدر */
.rating-value .rating-star-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: var(--gk-accent);
    vertical-align: middle;
}

/* ستاره‌های لیست نظرات */
.review-rating .star-icon svg {
    width: 1rem;
    height: 1rem;
    color: var(--gk-border-color); /* رنگ ستاره خالی */
    fill: var(--gk-border-color); /* برای اطمینان از پر شدن */
    stroke-width: 0;
}
.review-rating .star-icon.filled svg {
    color: var(--gk-accent); /* رنگ ستاره پر شده */
    fill: var(--gk-accent);
}

/* ستاره‌های فرم ثبت نظر */
.review-form-rating .stars {
    direction: ltr; /* To make stars left-to-right */
}
.review-form-rating .stars .star-icon {
    display: inline-flex;
    cursor: pointer;
}
.review-form-rating .stars .star-icon svg {
    width: 1.2rem;
    height: 1.2rem;
    color: #c1c1c1;
    fill: #c1c1c1;
    stroke-width: 0;
    transition: color 0.2s, fill 0.2s;
}
.review-form-rating .stars .star-icon.hover svg,
.review-form-rating .stars .star-icon.selected svg {
    color: var(--gk-accent);
    fill: var(--gk-accent);
}

/* آیکون‌های لایک/دیس‌لایک */
.action-btn svg {
    width: 1rem;
    height: 1rem;
}

/* ردیف کلی */
.gk-psf {
    direction: rtl;
    font-size: 13px;
}

/* لیست افقی */
.gk-psf__list {
    display: flex;
    align-items: center;
    justify-content: space-between;
    column-gap: 64px;
    row-gap: 16px;
}

/* آیتم */
.gk-psf__item {
    display: inline-flex;
    align-items: center;
    position: relative;
    white-space: nowrap;
    font-weight: 400;
    color: #858585;
}

/* جداکننده عمودی بین آیتم‌ها */
.gk-psf--divider .gk-psf__item + .gk-psf__item::before {
    content: '';
    position: absolute;
    right: -32px;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 20px;
    background-color: #e0e0e0;
}

/* آخرین آیتم بدون جداکننده */
.gk-psf--divider .gk-psf__item:last-child::before {
    display: none;
}

/* آیکن */
.gk-psf__icon {
    display: inline-flex;
    margin-left: 8px; /* از کنترل‌ها override می‌شود */
    font-size: 32px;
    color: var(--gk-neutral-400);
}

.gk-psf__icon svg {
    display: block;
}

/* متن */
.gk-psf__title {
    line-height: 1.8;
}

.gk-psf__description {
    font-size: 12px;
    margin-top: 2px;
    opacity: 0.8;
}

/* واکنش‌گرا */
@media (max-width: 992px) {
    .gk-psf__list {
        column-gap: 32px;
    }
}

@media (max-width: 767px) {
    .gk-psf--wrap .gk-psf__list {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    .gk-psf--wrap .gk-psf__item {
        margin-bottom: 8px;
        white-space: normal;
    }

    .gk-psf--wrap.gk-psf--divider .gk-psf__item::before {
        display: none; /* در حالت چند ردیفی، جداکننده منطقی نیست */
    }
}

/* v1.8.1 - Product attributes modern grid skin */
.gk-attr-grid {
  --gk-attr-grid-cols: 3;
  display: grid;
  grid-template-columns: repeat(var(--gk-attr-grid-cols), minmax(0, 1fr));
  gap: 14px;
  direction: rtl;
}
.gk-attr-grid-card {
  --gk-attr-hover-y: -4px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 96px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(17,24,39,.08);
  background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
  color: #111827;
  text-decoration: none !important;
  box-shadow: 0 14px 36px rgba(15,23,42,.06);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  overflow: hidden;
}
.gk-attr-grid-card::before {
  content: "";
  position: absolute;
  inset-inline-start: -34px;
  inset-block-start: -34px;
  width: 86px;
  height: 86px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--gk-primary, #0ea5e9) 13%, transparent);
  pointer-events: none;
}
.gk-attr-grid-card:hover {
  transform: translateY(var(--gk-attr-hover-y));
  border-color: color-mix(in srgb, var(--gk-primary, #0ea5e9) 35%, rgba(17,24,39,.08));
  box-shadow: 0 20px 48px rgba(15,23,42,.10);
}
.gk-attr-grid-icon {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 15px;
  color: var(--gk-primary, #0ea5e9);
  background: color-mix(in srgb, var(--gk-primary, #0ea5e9) 11%, #fff);
}
.gk-attr-grid-icon svg { width: 20px; height: 20px; display: block; }
.gk-attr-grid-text {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.gk-attr-grid-name {
  display: block;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.7;
  font-weight: 700;
}
.gk-attr-grid-value {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: #111827;
  font-size: 14px;
  line-height: 1.9;
  font-weight: 900;
}
.gk-attr-grid-card--viewall {
  justify-content: center;
  text-align: center;
  color: var(--gk-primary, #0ea5e9) !important;
  background: color-mix(in srgb, var(--gk-primary, #0ea5e9) 7%, #fff);
}
.gk-attr-grid--placeholder .gk-attr-grid-card { min-height: 80px; }
@media (max-width: 1024px) {
  .gk-attr-grid { grid-template-columns: repeat(min(var(--gk-attr-grid-cols), 2), minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .gk-attr-grid { grid-template-columns: repeat(1, minmax(0, 1fr)); }
  .gk-attr-grid-card { min-height: 82px; padding: 14px; }
}

/* v1.8.1 - Product description modern skins */
.spd-product-description--modern {
  --spd-accent: var(--gk-primary, #0ea5e9);
  position: relative;
  overflow: visible;
  border: 1px solid rgba(17,24,39,.08);
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
  box-shadow: 0 18px 45px rgba(15,23,42,.055);
}
.spd-product-description--notice { padding: 18px; border-radius: 16px; background: #f8fafc; color: #64748b; }
.spd-heading-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.spd-heading-icon {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 16px;
  color: var(--spd-accent);
  background: color-mix(in srgb, var(--spd-accent) 11%, #fff);
}
.spd-heading-icon svg { width: 22px; height: 22px; display: block; }
.spd-heading-texts { min-width: 0; }
.spd-widget-heading {
  margin: 0;
  color: #111827;
  font-size: 20px;
  line-height: 1.6;
  font-weight: 900;
}
.spd-widget-subtitle {
  margin: 4px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.9;
  font-weight: 600;
}
.spd-description-wrapper {
  position: relative;
  margin-top: 16px;
}
.spd-description-text,
.spd-full-description,
.spd-sheet-content {
  color: #334155;
  font-size: 14px;
  line-height: 2.15;
}
.spd-description-text.spd-truncated {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}
.spd-description-wrapper::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 36px;
  background: linear-gradient(180deg, transparent, #fff);
  pointer-events: none;
  opacity: 1;
}
.spd-product-description.is-expanded .spd-description-wrapper::after { opacity: 0; }
.spd-full-description[hidden] { display: none !important; }
.spd-full-description :where(h2,h3,h4) {
  margin: 1.2em 0 .45em;
  color: #111827;
  font-weight: 900;
  line-height: 1.75;
}
.spd-full-description :where(p,ul,ol) { margin: 0 0 .85em; }
.spd-full-description a,
.spd-sheet-content a { color: var(--spd-accent); font-weight: 800; text-decoration: none; }
.spd-read-more-btn {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid color-mix(in srgb, var(--spd-accent) 28%, transparent);
  background: color-mix(in srgb, var(--spd-accent) 9%, #fff);
  color: var(--spd-accent);
  padding: 10px 16px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 900;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.spd-read-more-btn:hover { transform: translateY(-1px); background: var(--spd-accent); color: #fff; }
.spd-read-more-btn svg { width: 17px; height: 17px; transition: transform .2s ease; }
.spd-product-description.is-expanded .spd-read-more-btn svg { transform: rotate(180deg); }
.spd-sheet { position: relative; z-index: 999999; }
.spd-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999998;
  background: rgba(15,23,42,.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.spd-sheet-panel {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  max-height: 82vh;
  background: #fff;
  border-radius: 28px 28px 0 0;
  transform: translateY(105%);
  transition: transform .32s cubic-bezier(.22,1,.36,1);
  box-shadow: 0 -24px 70px rgba(15,23,42,.24);
  overflow: hidden;
}
.spd-sheet.is-open .spd-sheet-backdrop { opacity: 1; pointer-events: auto; }
.spd-sheet.is-open .spd-sheet-panel { transform: translateY(0); }
.spd-sheet-handle {
  width: 46px;
  height: 5px;
  border-radius: 999px;
  background: #d1d5db;
  margin: 10px auto 0;
}
.spd-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(17,24,39,.08);
}
.spd-sheet-header strong { color: #111827; font-size: 15px; font-weight: 900; }
.spd-sheet-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: #f3f4f6;
  color: #111827;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}
.spd-sheet-content {
  padding: 16px 18px calc(22px + env(safe-area-inset-bottom));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.spd-sheet-open { overflow: hidden; }
@media (min-width: 769px) {
  .spd-product-description--mobile_sheet .spd-sheet-panel {
    max-width: 860px;
    inset-inline: 50%;
    transform: translate(-50%, 105%);
    border-radius: 28px 28px 0 0;
  }
  .spd-product-description--mobile_sheet .spd-sheet.is-open .spd-sheet-panel { transform: translate(-50%, 0); }
}

/* v1.8.2 - Rich HTML content styling for product description */
.spd-rich-content {
  --spd-rich-accent: var(--spd-accent, var(--gk-primary, #0ea5e9));
  --spd-rich-text: var(--gk-text, #1f2937);
  --spd-rich-muted: var(--gk-text-muted, #64748b);
  --spd-rich-border: var(--gk-border, #e5e7eb);
  --spd-rich-surface: var(--gk-surface, #ffffff);
  --spd-rich-soft: color-mix(in srgb, var(--spd-rich-accent) 6%, #fff);
}
.spd-rich-content :where(h1,h2,h3,h4,h5,h6),
.spd-sheet-content :where(h1,h2,h3,h4,h5,h6) {
  color: var(--spd-rich-text);
  font-weight: 900;
  line-height: 1.75;
  margin: 1.35em 0 .55em;
}
.spd-rich-content h2,
.spd-sheet-content h2 {
  font-size: clamp(18px, 1.7vw, 23px);
  padding-inline-start: 12px;
  border-inline-start: 4px solid var(--spd-rich-accent);
}
.spd-rich-content :where(h3,h4,h5,h6),
.spd-sheet-content :where(h3,h4,h5,h6) {
  font-size: clamp(16px, 1.35vw, 20px);
}
.spd-rich-content p,
.spd-sheet-content p {
  margin: 0 0 1em;
  color: inherit;
}
.spd-rich-content :where(ul,ol),
.spd-sheet-content :where(ul,ol) {
  margin: .85em 0 1.1em;
  padding-inline-start: 1.45em;
}
.spd-rich-content li,
.spd-sheet-content li {
  padding-inline-start: .25em;
  line-height: 2.05;
}
.spd-rich-content li::marker,
.spd-sheet-content li::marker {
  color: var(--spd-rich-accent);
}
.spd-rich-content a,
.spd-sheet-content a {
  color: var(--spd-rich-accent);
  font-weight: 800;
  text-decoration: none;
  border-bottom: 1px dashed color-mix(in srgb, var(--spd-rich-accent) 55%, transparent);
  transition: color .2s ease, border-color .2s ease;
}
.spd-rich-content a:hover,
.spd-sheet-content a:hover {
  color: color-mix(in srgb, var(--spd-rich-accent) 78%, #111827);
  border-bottom-style: solid;
}
.spd-rich-content table,
.spd-sheet-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 18px 0;
  overflow: hidden;
  border: 1px solid var(--spd-rich-border);
  border-radius: 16px;
  background: var(--spd-rich-surface);
  color: var(--spd-rich-text);
}
.spd-rich-content th,
.spd-rich-content td,
.spd-sheet-content th,
.spd-sheet-content td {
  border-bottom: 1px solid var(--spd-rich-border);
  border-inline-end: 1px solid var(--spd-rich-border);
  padding: 12px 14px;
  vertical-align: top;
}
.spd-rich-content tr:last-child :where(th,td),
.spd-sheet-content tr:last-child :where(th,td) { border-bottom: 0; }
.spd-rich-content :where(th,td):last-child,
.spd-sheet-content :where(th,td):last-child { border-inline-end: 0; }
.spd-rich-content th,
.spd-sheet-content th {
  background: var(--spd-rich-soft);
  color: var(--spd-rich-text);
  font-weight: 900;
}
.spd-rich-content blockquote,
.spd-sheet-content blockquote {
  margin: 18px 0;
  padding: 14px 16px;
  border-inline-start: 4px solid var(--spd-rich-accent);
  border-radius: 16px;
  background: var(--spd-rich-soft);
  color: var(--spd-rich-text);
}
.spd-rich-content img,
.spd-sheet-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--gk-product-image-radius, var(--gk-image-radius, 16px));
  margin: 14px 0;
  display: block;
}
.spd-rich-content figure,
.spd-sheet-content figure { margin: 18px 0; }
.spd-rich-content figcaption,
.spd-sheet-content figcaption {
  margin-top: 8px;
  color: var(--spd-rich-muted);
  font-size: 12px;
  text-align: center;
}
@media (max-width: 640px) {
  .spd-rich-content table,
  .spd-sheet-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .spd-rich-content th, .spd-rich-content td, .spd-sheet-content th, .spd-sheet-content td { min-width: 120px; padding: 10px 12px; }
}

.gk-attr-viewall-scroll {
    cursor: pointer;
}
