/* =====================================================================
   صفحه جزئیات محصول — از متغیرهای رنگ site-modern.css استفاده می‌کند
   ===================================================================== */
.pd-page { --pd-gap: 24px; }
.pd-page .main-row { display: block; }

.pd-card {
    background: var(--s-surface, #fff);
    border: 1px solid var(--s-border, #ebe5de);
    border-radius: var(--s-radius-lg, 20px);
    box-shadow: var(--s-shadow, 0 6px 20px rgba(0,0,0,.06));
    padding: var(--pd-gap);
    margin-bottom: 20px;
}

.pd-grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 4fr) minmax(280px, 3fr);
    grid-template-areas: "gallery info buy";
    gap: var(--pd-gap);
    align-items: start;
}
.pd-gallery { grid-area: gallery; position: relative; min-width: 0; }
.pd-info { grid-area: info; min-width: 0; }
.pd-buy { grid-area: buy; min-width: 0; position: sticky; top: 150px; }

/* ---------- گالری ---------- */
.pd-main-image {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: var(--s-radius, 16px);
    background: var(--s-surface-2, #faf8f5);
    border: 1px solid var(--s-border, #ebe5de);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pd-main-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    cursor: zoom-in;
    transition: opacity .2s ease, transform .4s ease;
}
.pd-main-image:hover img { transform: scale(1.03); }
.pd-main-image img.is-fading { opacity: .35; }
.pd-no-image { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--s-muted, #857a71); font-size: 13px; }
.pd-no-image i { font-size: 48px; }

.pd-gallery-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.pd-icon-btn {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--s-border, #ebe5de);
    border-radius: 12px;
    background: rgba(255, 255, 255, .92);
    color: var(--s-text-2, #4b433d);
    font-size: 20px;
    cursor: pointer;
    transition: color .15s, border-color .15s, transform .15s;
    backdrop-filter: blur(4px);
}
.pd-icon-btn:hover { color: var(--s-primary, #7c4a2a); border-color: var(--s-primary, #7c4a2a); transform: translateY(-1px); }
.pd-icon-btn.is-active { color: var(--s-accent, #d9363e); border-color: var(--s-accent, #d9363e); }
.pd-icon-btn:focus-visible, .pd-thumb:focus-visible, .pd-variant:focus-visible { outline: 0; box-shadow: var(--s-ring, 0 0 0 4px rgba(124,74,42,.14)); }

.pd-thumbs {
    list-style: none;
    margin: 12px 0 0;
    padding: 2px 2px 6px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: thin;
}
.pd-thumbs li { flex: 0 0 auto; }
.pd-thumb {
    width: 72px;
    height: 72px;
    padding: 4px;
    border: 2px solid var(--s-border, #ebe5de);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color .15s, opacity .15s;
    opacity: .75;
}
.pd-thumb img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }
.pd-thumb:hover { opacity: 1; }
.pd-thumb.active { border-color: var(--s-primary, #7c4a2a); opacity: 1; }

/* ---------- اطلاعات ---------- */
.pd-headline { padding-bottom: 16px; border-bottom: 1px dashed var(--s-border, #ebe5de); }
.pd-title { margin: 0; font-size: 22px; font-weight: 800; line-height: 1.7; color: var(--s-text, #2a2420); }
.pd-title-en { margin-top: 2px; font-size: 13px; color: var(--s-muted, #857a71); text-align: left; }
.pd-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pd-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--s-surface-2, #faf8f5);
    border: 1px solid var(--s-border, #ebe5de);
    font-size: 12px;
    color: var(--s-muted, #857a71);
}
.pd-chip b { color: var(--s-text, #2a2420); font-weight: 700; }
.pd-chip a { color: var(--s-primary, #7c4a2a) !important; font-weight: 700; }

.pd-block { padding: 16px 0; border-bottom: 1px dashed var(--s-border, #ebe5de); }
.pd-block:last-child { border-bottom: 0; }
.pd-block-title { margin-bottom: 12px; font-size: 14px; font-weight: 800; color: var(--s-text, #2a2420); }
.pd-selected-color { font-weight: 500; color: var(--s-muted, #857a71); }

.pd-variants { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.pd-variant {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 6px 14px 6px 10px;
    border: 1.5px solid var(--s-border-strong, #ddd4ca);
    border-radius: 12px;
    background: #fff;
    color: var(--s-text-2, #4b433d);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s, color .15s;
}
.pd-variant:hover { border-color: var(--s-primary, #7c4a2a); }
.pd-variant.active { border-color: var(--s-primary, #7c4a2a); color: var(--s-primary, #7c4a2a); box-shadow: var(--s-ring, 0 0 0 4px rgba(124,74,42,.14)); }
.pd-swatch { width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); box-shadow: inset 0 0 0 2px #fff; flex: 0 0 auto; }

.pd-specs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pd-specs li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--s-surface-2, #faf8f5);
    font-size: 13px;
}
.pd-specs li span { color: var(--s-muted, #857a71); }
.pd-specs li b { color: var(--s-text, #2a2420); font-weight: 600; text-align: left; }
.pd-specs-full { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.pd-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 14px; color: var(--s-muted, #857a71); }
.pd-tags a {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--s-primary-50, #f8f2ec);
    color: var(--s-primary, #7c4a2a) !important;
    font-size: 12px;
}
.pd-tags a:hover { background: var(--s-primary-100, #efe3d8); }

/* ---------- جعبه خرید ---------- */
.pd-buy-box {
    padding: 18px;
    border-radius: var(--s-radius-lg, 20px);
    background: var(--s-surface-2, #faf8f5);
    border: 1px solid var(--s-border, #ebe5de);
}
.pd-buy-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--s-border, #ebe5de); font-size: 13px; }
.pd-buy-label { color: var(--s-muted, #857a71); font-size: 13px; }
.pd-buy-label i { font-size: 16px; vertical-align: -2px; }
.pd-buy-value { color: var(--s-text, #2a2420); font-weight: 700; text-align: left; }

.pd-price { padding: 16px 0 6px; text-align: left; }
.pd-price .MyPriceWithSpe { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.pd-price del { color: #a39a92; font-size: 14px; }
.pd-discount {
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--s-accent, #d9363e);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}
.pd-price-final { margin-top: 4px; font-size: 24px; font-weight: 900; color: var(--s-text, #2a2420); }
.pd-price-final small, .pd-coworker small { font-size: 13px; font-weight: 500; color: var(--s-muted, #857a71); }
.pd-price-final .Sold { color: var(--s-accent, #d9363e); font-size: 18px; }

.pd-coworker { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; margin-top: 8px; border-radius: 12px; background: var(--s-gold-50, #fbf4e8); font-weight: 700; }
.pd-coworker del { color: #a39a92; font-weight: 400; margin-left: 6px; }

.pd-comment { padding: 10px 0; }
.pd-comment textarea { margin-top: 6px; border-radius: 12px; resize: vertical; }

.pd-qty-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.pd-qty {
    display: inline-flex;
    align-items: center;
    height: 42px;
    border: 1px solid var(--s-border-strong, #ddd4ca);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}
.pd-qty button { width: 40px; height: 100%; border: 0; background: transparent; color: var(--s-primary, #7c4a2a); font-size: 20px; cursor: pointer; }
.pd-qty button:hover { background: var(--s-primary-50, #f8f2ec); }
.pd-qty input { width: 48px; height: 100%; border: 0; text-align: center; font-size: 16px; font-weight: 800; background: transparent; -moz-appearance: textfield; }
.pd-qty input::-webkit-outer-spin-button, .pd-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.pd-remaining { padding: 8px 12px; margin: 4px 0; border-radius: 10px; background: var(--s-accent-50, #fdecec); color: var(--s-accent, #d9363e); font-size: 12px; font-weight: 700; }

.pd-actions { display: grid; gap: 8px; margin-top: 10px; }
.pd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    padding: 0 16px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none !important;
    cursor: pointer;
    transition: background .15s, transform .15s, box-shadow .15s;
}
.pd-btn i { font-size: 20px; }
.pd-btn-primary { border: 0; background: var(--s-primary, #7c4a2a); color: #fff !important; box-shadow: 0 10px 24px rgba(124, 74, 42, .25); }
.pd-btn-primary:hover { background: var(--s-primary-600, #643a20); transform: translateY(-1px); }
.pd-btn-outline { border: 1.5px solid var(--s-primary, #7c4a2a); background: #fff; color: var(--s-primary, #7c4a2a) !important; }
.pd-btn-outline:hover { background: var(--s-primary-50, #f8f2ec); }
.pd-btn.is-loading { opacity: .6; pointer-events: none; }

/* ---------- مزایا ---------- */
.pd-usp { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 20px; }
.pd-usp-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--s-radius, 16px);
    background: var(--s-surface, #fff);
    border: 1px solid var(--s-border, #ebe5de);
}
.pd-usp-item img { width: 40px; height: 40px; object-fit: contain; flex: 0 0 auto; }
.pd-usp-t1 { font-size: 13px; font-weight: 800; color: var(--s-text, #2a2420); }
.pd-usp-t2 { font-size: 12px; color: var(--s-muted, #857a71); }

/* ---------- توضیحات ---------- */
.pd-section-title {
    position: relative;
    margin: 0 0 18px;
    padding-right: 14px;
    font-size: 18px;
    font-weight: 800;
    color: var(--s-text, #2a2420);
}
.pd-section-title::before { content: ""; position: absolute; right: 0; top: 4px; bottom: 4px; width: 4px; border-radius: 4px; background: var(--s-primary, #7c4a2a); }
.pd-description-body { font-size: 14px; line-height: 2.1; color: var(--s-text-2, #4b433d); overflow-wrap: anywhere; }
.pd-description-body img, .pd-description-body video, .pd-description-body iframe { max-width: 100% !important; height: auto !important; border-radius: 12px; }
.pd-description-body table { display: block; max-width: 100%; overflow-x: auto; }
.pd-description-body p { margin-bottom: 1em; }

/* ---------- اشتراک‌گذاری ---------- */
.pd-share { border-radius: var(--s-radius-lg, 20px); }
.pd-share-links { display: flex; gap: 8px; margin-bottom: 14px; }
.pd-share-links a {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--s-border, #ebe5de);
    border-radius: 12px;
    color: var(--s-text-2, #4b433d) !important;
}
.pd-share-links a:hover { border-color: var(--s-primary, #7c4a2a); color: var(--s-primary, #7c4a2a) !important; }
.pd-share-links i { font-size: 20px; }
.pd-share-copy { display: flex; gap: 8px; }
.pd-share-copy .form-control { border-radius: 12px; font-size: 12px; }
.pd-share-copy .pd-btn { min-height: 40px; font-size: 13px; white-space: nowrap; }

/* ---------- ریسپانسیو ---------- */
@media (max-width: 1199.98px) {
    .pd-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas: "gallery info" "gallery buy";
    }
    .pd-buy { position: static; }
}
@media (max-width: 767.98px) {
    .pd-page { --pd-gap: 16px; }
    .pd-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "gallery" "info" "buy"; }
    .pd-title { font-size: 18px; }
    .pd-thumb { width: 60px; height: 60px; }
    .pd-specs-full { grid-template-columns: minmax(0, 1fr); }
    .pd-price-final { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
    .pd-main-image img, .pd-btn, .pd-icon-btn { transition: none; }
    .pd-main-image:hover img { transform: none; }
}
