/* ==========================================================================
   صفحه محصول — دو ستون: گالری | اطلاعات و پنل خرید
   هماهنگ با ui.css (.hp / .pdp). فقط در صفحه محصول بارگذاری می‌شود.
   ========================================================================== */
.single-product main.site-main.container {
    max-width: 1240px;
    padding-inline: clamp(16px, 4vw, 32px);
}
.pdp { padding-bottom: clamp(16px, 3vw, 32px); }

/* ---------- Breadcrumb ---------- */
.pdp .theme-breadcrumb { flex-wrap: wrap; gap: 2px 0; padding-block: 18px 14px; font-size: .85rem; color: var(--hp-text); }
.pdp .theme-breadcrumb a, .pdp .theme-breadcrumb a:hover { color: var(--hp-text); }
.pdp .theme-breadcrumb a:hover { color: var(--hp-navy); text-decoration: underline; text-underline-offset: 4px; }
.pdp .theme-breadcrumb i { font-size: .65rem; color: #9FB0C1; padding-inline: 8px; }

/* ---------- چیدمان اصلی ---------- */
.pdp-top { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
.pdp-gallery, .pdp-info { min-width: 0; }
@media (min-width: 900px) {
    .pdp-top { grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 56px; align-items: start; }
    .pdp-gallery { position: sticky; top: calc(var(--hp-header-h) + 16px); }
}

/* ---------- گالری ---------- */
.pdp .product-images-wrapper { max-width: 540px; margin-inline: auto; }
.pdp .main-image-container {
    position: relative;
    aspect-ratio: 1 / 1;
    background: var(--hp-soft);
    border: 1px solid var(--hp-line);
    border-radius: 28px;
    overflow: hidden;
}
.pdp #mainProductImage { display: grid; place-items: center; width: 100%; height: 100%; padding: 8%; }
.pdp #currentMainImage { width: 100%; height: 100%; max-height: none; object-fit: contain; mix-blend-mode: multiply; }
.pdp .pdp-badge {
    position: absolute; top: 16px; inset-inline-start: 16px; z-index: 2; padding: 2px 14px; border-radius: 999px;
    background: var(--hp-sale); color: #fff; font-size: .85rem; font-weight: 800; line-height: 1.9;
}
/* دکمه‌های علاقه‌مندی/اشتراک روی گالری */
.pdp .pdp-thumbs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.pdp button.thumbnail-item {
    width: 64px; height: 64px; padding: 5px; display: grid; place-items: center; background: #fff; border: 1px solid var(--hp-line);
    border-radius: 16px; opacity: 1; box-shadow: none; cursor: pointer; transition: border-color .2s;
}
.pdp button.thumbnail-item:hover { border-color: var(--hp-blue); }
.pdp button.thumbnail-item.active { border-color: var(--hp-navy); box-shadow: 0 0 0 1px var(--hp-navy); }
.pdp button.thumbnail-item img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }

/* ---------- عنوان و مشخصات سریع ---------- */
.pdp .pdp-head__top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.pdp .pdp-head__top:empty { display: none; }
.pdp img.brandIcon { height: 28px; width: auto; max-width: 130px; object-fit: contain; }
.pdp a.pdp-cat, .pdp a.pdp-cat:visited {
    padding: 2px 14px; border: 1px solid var(--hp-line); border-radius: 999px; background: #fff; font-size: .82rem; font-weight: 600; color: var(--hp-text);
    transition: border-color .2s, color .2s;
}
.pdp a.pdp-cat:hover { border-color: var(--hp-blue); color: var(--hp-navy); }
.pdp .pdp-title { margin: 12px 0 0; font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 900; line-height: 1.7; text-transform: none; color: var(--hp-navy); }
.pdp .pdp-en { margin: 2px 0 0; max-height: none; font-family: system-ui, sans-serif; font-size: .85rem; text-align: left; text-transform: none; color: #8496A8; }
.pdp ul.pdp-meta { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 10px; font-size: .86rem; }
.pdp .pdp-meta b { font-weight: 800; color: var(--hp-navy); }
.pdp .pdp-stock { position: relative; padding-inline-start: 16px; font-weight: 700; }
.pdp .pdp-stock::before { content: ""; position: absolute; inset-inline-start: 0; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: #8496A8; }
.pdp .pdp-stock.is-in { color: #1E7A37; }
.pdp .pdp-stock.is-in::before { background: #1E7A37; box-shadow: 0 0 0 4px rgba(30, 122, 55, .15); }
.pdp .pdp-stock.is-out { color: var(--hp-sale); }
.pdp .pdp-stock.is-out::before { background: var(--hp-sale); }

/* ---------- پنل خرید ---------- */
.pdp-buy { margin-top: 20px; padding: clamp(18px, 3vw, 26px); background: var(--hp-soft); border: 1px solid var(--hp-line); border-radius: 24px; }
.pdp-buy__price { min-height: 44px; }
.pdp .pdp-price__top { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.pdp .pdp-price__off { padding: 0 12px; border-radius: 999px; background: var(--hp-sale); color: #fff; font-size: .85rem; font-weight: 800; line-height: 2; }
.pdp .pdp-price__top del { font-size: 1rem; font-weight: 300; color: #8496A8; text-decoration: line-through; }
.pdp .pdp-price__now { margin: 0; font-size: clamp(1.8rem, 3.4vw, 2.3rem); font-weight: 900; line-height: 1.5; text-align: start; color: var(--hp-navy); }
.pdp .pdp-price__now--sale { color: var(--hp-sale); }
.pdp .pdp-price__now small { font-size: .42em; font-weight: 600; margin-inline-start: 6px; color: var(--hp-text); }
.pdp .pdp-price__call { font-size: 1.4rem; color: var(--hp-blue); }
.pdp .pdp-oos { margin: 0; font-size: 1.15rem; font-weight: 800; color: var(--hp-sale); }

.pdp p.stock { display: none; } /* وضعیت موجودی در ردیف مشخصات بالا نمایش داده می‌شود */
.pdp form.cart:not(.variations_form) { display: flex; align-items: stretch; gap: 12px; padding-top: 18px !important; }
.pdp form.variations_form { display: block; padding-top: 14px; }
.pdp .woocommerce-variation-add-to-cart { display: flex !important; align-items: stretch; gap: 12px; margin-top: 14px; }
.pdp form.cart .quantity { display: flex; }
.pdp form.cart .quantity input.qty {
    width: 68px; height: 56px; padding: 0 8px; border: 1.5px solid var(--hp-line); border-radius: 16px; background: #fff;
    font-size: 1.05rem; font-weight: 800; text-align: center; color: var(--hp-navy);
}
.pdp form.cart .quantity input.qty:focus { border-color: var(--hp-blue); outline: 0; }
.pdp form.cart button.single_add_to_cart_button.button.alt,
.pdp form.cart button.single_add_to_cart_button.button.alt:hover {
    flex: 1; width: auto; min-height: 56px; margin: 0; padding: 0 24px; border: 0; border-radius: 16px; background: var(--hp-navy); color: #fff;
    font-size: 1.05rem; font-weight: 800; cursor: pointer; transition: background-color .2s, opacity .2s;
}
.pdp form.cart button.single_add_to_cart_button.button.alt:hover { background: #00417f; }
.pdp form.cart button.single_add_to_cart_button.disabled, .pdp form.cart button.single_add_to_cart_button:disabled { opacity: .45; cursor: not-allowed; }
.pdp p.pdp-buy__foot { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--hp-line); font-size: .86rem; }
.pdp .pdp-buy__foot svg { flex: 0 0 auto; color: var(--hp-blue); }

/* ---------- توضیح کوتاه (زیر عنوان) ---------- */
.pdp-summary { margin-top: 14px; font-size: .96rem; line-height: 2; color: var(--hp-text); }
.pdp-summary > *:first-child { margin-top: 0; }
.pdp-summary > *:last-child { margin-bottom: 0; }
.pdp-summary p { margin: 0 0 .6em; }
.pdp-summary ul { display: grid; gap: 6px; }
.pdp-summary li { position: relative; padding-inline-start: 22px; }
.pdp-summary li::before {
    content: ""; position: absolute; top: .65em; inset-inline-start: 0; width: 14px; height: 14px; border-radius: 50%;
    background: var(--hp-mist) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='%233085C3' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat;
}
.pdp-summary table { max-width: 100%; }

/* ---------- نوار مزایا (یک ردیف) ---------- */
.pdp ul.pdp-perks {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin-top: 26px;
    border: 1px solid var(--hp-line); border-radius: 18px; background: #fff; overflow: hidden;
}
.pdp-perks li { display: grid; justify-items: center; gap: 6px; padding: 14px 6px; text-align: center; border-inline-start: 1px solid var(--hp-line); }
.pdp-perks li:first-child { border-inline-start: 0; }
.pdp-perks i { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--hp-mist); color: var(--hp-navy); font-size: 1.05rem; }
.pdp .pdp-perks span { font-size: .78rem; font-weight: 600; line-height: 1.6; color: var(--hp-navy); }
.pdp .pdp-return { margin-top: 12px; font-size: .8rem; color: #8496A8; }

/* ---------- محصول متغیر ---------- */
.pdp .pdp-price__var { display: grid; gap: 2px; }
.pdp .pdp-price__from { font-size: .85rem; color: var(--hp-text); }
.pdp .pdp-price__range { font-size: .8rem; color: #8496A8; }
.pdp-buy.has-variation .pdp-buy__price { display: none; }

.pdp table.variations, .pdp table.variations tbody { display: block; width: 100%; margin: 0; }
.pdp table.variations tr { display: flex !important; flex-direction: column; gap: 8px; padding: 0 0 14px; border: 0; }
.pdp table.variations th, .pdp table.variations td { display: block; padding: 0; border: 0; }
.pdp table.variations th label { margin: 0; font-size: .92rem; font-weight: 800; color: var(--hp-navy); }
.pdp table.variations select { display: none; }

.pdp .rudr-variation-radios { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; min-height: 0; }
.pdp .rudr-variation-radios br { display: none; }
.pdp .rudr-variation-radios input[type=radio] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}
.pdp .rudr-variation-radios label {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1.5px solid var(--hp-line);
    border-radius: 12px;
    background: #fff;
    font-size: .92rem;
    font-weight: 600;
    color: var(--hp-navy);
    cursor: pointer;
    transition: border-color .2s, background-color .2s, color .2s;
}
.pdp .rudr-variation-radios label:hover { border-color: var(--hp-blue); }
.pdp .rudr-variation-radios input:checked + label { border-color: var(--hp-navy); background: var(--hp-navy); color: #fff; }
.pdp .rudr-variation-radios input:focus-visible + label { outline: 3px solid var(--hp-blue); outline-offset: 2px; }

.pdp a.reset_variations { display: inline-block; margin-top: 6px; font-size: .85rem; color: var(--hp-blue); }
.pdp .single_variation_wrap { display: block; }
.pdp .single_variation:not(:empty) {
    margin-top: 4px;
    padding: 14px 16px;
    border: 1px solid var(--hp-line);
    border-radius: 16px;
    background: #fff;
}
.pdp .woocommerce-variation-price { padding: 0 !important; text-align: start; font-size: clamp(1.4rem, 2.6vw, 1.7rem); font-weight: 900; line-height: 1.5; color: var(--hp-navy); }
.pdp .woocommerce-variation-price .price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 12px; }
.pdp .woocommerce-variation-price del { order: -1; font-size: 1rem; font-weight: 300; color: #8496A8; }
.pdp .woocommerce-variation-price ins { text-decoration: none; color: var(--hp-sale); }
.pdp .woocommerce-variation-price .woocommerce-Price-currencySymbol { font-size: .45em; font-weight: 600; margin-inline-start: 4px; color: var(--hp-text); }
.pdp .woocommerce-variation-description p { margin-bottom: 6px; font-size: .9rem; }
.pdp .woocommerce-variation-availability p.stock { margin: 4px 0 0; }

/* ---------- ناوبری بخش‌ها ---------- */
.pdp-tabs {
    display: flex; gap: 8px; margin-top: clamp(32px, 5vw, 56px); padding-block: 12px; border-bottom: 1px solid var(--hp-line);
    background: #fff; overflow-x: auto; scrollbar-width: none; z-index: 5;
}
.pdp-tabs::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .pdp-tabs { position: sticky; top: var(--hp-header-h); } }
.pdp .pdp-tabs a, .pdp .pdp-tabs a:visited { flex: 0 0 auto; padding: 6px 20px; border-radius: 999px; font-size: .95rem; font-weight: 600; color: var(--hp-text); transition: background-color .2s, color .2s; }
.pdp .pdp-tabs a:hover { background: var(--hp-mist); color: var(--hp-navy); }

/* ---------- بخش‌ها (عنوان کنار محتوا در دسکتاپ) ---------- */
.pdp-sec { padding-top: clamp(28px, 4.5vw, 52px); scroll-margin-top: calc(var(--hp-header-h) + 64px); }
.pdp .pdp-h2 { margin: 0 0 16px; font-size: 1.3rem; font-weight: 800; color: var(--hp-navy); }
@media (min-width: 900px) {
    .pdp #attrbox, .pdp .pdp-desc { display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: 48px; row-gap: 0; align-items: start; }
    .pdp #attrbox > .pdp-sec__head, .pdp .pdp-desc > .pdp-h2 { grid-column: 1; grid-row: 1 / span 99; }
    .pdp #attrbox > :not(.pdp-sec__head), .pdp .pdp-desc > :not(.pdp-h2) { grid-column: 2; }
}
.pdp .pdp-sec__head { padding: 0; border: 0; }

.pdp .pdp-spec { gap: 16px; padding-block: 14px; border-bottom: 1px solid var(--hp-line); }
.pdp #attrbox .pdp-sec__head + .pdp-spec { border-top: 1px solid var(--hp-line); }
.pdp .pdp-spec b { flex: 0 0 min(34%, 240px); font-weight: 600; color: var(--hp-text); }
.pdp .pdp-spec p { flex: 1; margin: 0; color: var(--hp-navy); }

.pdp button.pdp-more {
    display: inline-flex; justify-self: start; margin-top: 16px; padding: 8px 22px; border: 1px solid var(--hp-line); border-radius: 999px; background: #fff;
    font-size: .92rem; font-weight: 600; color: var(--hp-navy); cursor: pointer; transition: background-color .2s;
}
.pdp button.pdp-more:hover { background: var(--hp-mist); }

/* توضیحات (ارتفاع و دکمه‌ی «بیشتر» را script.js کنترل می‌کند) */
.pdp div#desc { height: 240px; text-align: start; }
.pdp div#desc * { font-size: 1rem; line-height: 2.1; color: var(--hp-text); }
.pdp div#desc h2, .pdp div#desc h3, .pdp div#desc h4 { margin: 1.2em 0 .4em; line-height: 1.7; font-weight: 800; color: var(--hp-navy); }
.pdp div#desc img { max-width: 100%; height: auto; border-radius: 16px; }
.pdp div#desc ul, .pdp div#desc ol { padding-inline-start: 1.4em; }
.pdp div#desc li { list-style: disc; }


/* جدول‌های داخل توضیحات (ویرایشگر وردپرس/گوتنبرگ) */
.pdp div#desc table, .pdp div#desc .wp-block-table table {
    width: 100% !important;
    max-width: 100%;
    margin: 1.2em 0;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--hp-line);
    border-radius: 14px;
    overflow: hidden;
    table-layout: auto;
}
.pdp div#desc figure.wp-block-table { margin: 0; overflow-x: auto; }
.pdp div#desc caption { padding: 0 0 8px; caption-side: top; font-size: .9rem; font-weight: 700; text-align: start; color: var(--hp-navy); }
.pdp div#desc th, .pdp div#desc td {
    width: auto !important;
    height: auto !important;
    padding: 11px 14px;
    border: 0;
    border-bottom: 1px solid var(--hp-line);
    border-inline-start: 1px solid var(--hp-line);
    font-size: .92rem;
    line-height: 1.9;
    text-align: start;
    vertical-align: middle;
    color: var(--hp-text);
}
.pdp div#desc tr > :first-child { border-inline-start: 0; }
.pdp div#desc tr:last-child > * { border-bottom: 0; }
.pdp div#desc th, .pdp div#desc thead td, .pdp div#desc tr:first-child > th { background: var(--hp-soft); font-weight: 800; color: var(--hp-navy); }
.pdp div#desc tbody tr:nth-child(even) td { background: #FAFCFE; }
.pdp div#desc td p, .pdp div#desc th p { margin: 0; }
.pdp div#desc td *, .pdp div#desc th * { font-size: inherit; line-height: inherit; }
@media (max-width: 700px) {
    .pdp div#desc table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .pdp div#desc th, .pdp div#desc td { min-width: 120px; }
}

/* ---------- دیدگاه‌ها ---------- */
.pdp #reviews { margin: 0 !important; padding-top: clamp(32px, 5vw, 56px); scroll-margin-top: calc(var(--hp-header-h) + 64px); }
.pdp #reviews > .col-12 { padding-inline: 0; }
.pdp #reviews .bg-light {
    margin-bottom: 8px !important;
    padding: 16px 20px !important;
    background: var(--hp-soft) !important;
    border-radius: 20px !important;
    gap: 12px;
    flex-wrap: wrap;
}
.pdp #reviews .btn { border-radius: 14px; font-weight: 800; min-height: 44px; }
.pdp #reviews .btn-primary { background: var(--hp-navy); border-color: var(--hp-navy); color: #fff; }
.pdp #reviews .btn-primary:hover { background: #00417f; border-color: #00417f; }
.pdp #reviews .btn-outline-primary { border-color: var(--hp-navy); color: var(--hp-navy); background: transparent; }
.pdp #reviews .btn-outline-primary:hover { background: var(--hp-navy); color: #fff; }
.pdp #reviews .review-item { border-color: var(--hp-line) !important; }
.pdp #reviews .alert-info { border: 0; border-radius: 16px; background: var(--hp-mist); color: var(--hp-navy); }

/* ---------- محصولات مرتبط ---------- */
.pdp-related { padding-top: clamp(36px, 6vw, 72px); overflow: hidden; }

/* ---------- نوار خرید ثابت (موبایل) ---------- */
.pdp-sticky {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 1020; display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid var(--hp-line);
    box-shadow: 0 -10px 30px rgba(0, 47, 93, .1); transform: translateY(110%); transition: transform .3s cubic-bezier(.2, .7, .2, 1); overflow: visible;
}
.pdp-sticky.is-visible { transform: none; }
.pdp-sticky__price { line-height: 1.5; min-width: 0; }
.pdp-sticky__price b { font-size: 1.15rem; font-weight: 900; color: var(--hp-navy); }
.pdp-sticky__price small { font-size: .78rem; color: var(--hp-text); }
.pdp .pdp-sticky__btn, .hp.pdp-sticky .pdp-sticky__btn {
    flex: 0 0 auto; min-height: 48px; padding: 0 26px; border: 0; border-radius: 14px; background: var(--hp-navy); color: #fff; font-size: .98rem; font-weight: 800; cursor: pointer;
}
@media (min-width: 900px) { .pdp-sticky { display: none; } }
@media (max-width: 899px) { body.single-product a.hp.hp-wa { bottom: 84px; } }
/* دسکتاپ: پنل خرید سمت چپ است، پس دکمه‌ی واتس‌اپ به گوشه‌ی راست می‌رود تا روی «افزودن به سبد» نیفتد */
@media (min-width: 900px) { body.single-product a.hp.hp-wa { left: auto; right: 20px; } }

/* ---------- موبایل ---------- */
@media (max-width: 520px) {
    .pdp .pdp-spec { flex-direction: column; gap: 2px; }
    .pdp .pdp-spec b { flex: none; }
    .pdp .product-images-wrapper { max-width: 360px; }
    .pdp button.thumbnail-item { width: 56px; height: 56px; }
}

.pdp .woocommerce-variation-price del .woocommerce-Price-currencySymbol { font-size: inherit; font-weight: inherit; color: inherit; margin-inline-start: 2px; }

/* ---------- Review stars ---------- */
.star-rating {
    position: relative; display: inline-block; flex: none; overflow: hidden;
    height: 1.2em; line-height: 1.2; font-size: 16px; letter-spacing: 2px; white-space: nowrap;
    color: #D3DCE6; font-family: Arial, sans-serif; vertical-align: middle;
    margin-inline: 10px 0;
}
.star-rating::before { content: "\2605\2605\2605\2605\2605"; display: block; }
.star-rating > span {
    position: absolute; top: 0; inset-inline-start: 0; height: 100%; overflow: hidden; display: block;
    color: #F5A623; font-size: 0;
}
.star-rating > span::before { content: "\2605\2605\2605\2605\2605"; display: block; font-size: 16px; line-height: 1.2; letter-spacing: 2px; white-space: nowrap; }
.pdp #reviews .d-flex > .star-rating:first-child { margin-inline-start: 0; }

.rating-input { flex-direction: row-reverse; justify-content: flex-end; gap: 2px !important; }
.rating-input input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.rating-input .star-label {
    margin: 0; padding: 0 2px; font-size: 30px; line-height: 1.2; cursor: pointer; color: #D3DCE6;
    font-family: Arial, sans-serif; transition: color .15s, transform .15s;
}
.rating-input .star-label:hover { transform: scale(1.12); }
.rating-input input:checked ~ .star-label,
.rating-input .star-label:hover,
.rating-input .star-label:hover ~ .star-label { color: #F5A623; }
.rating-input input:focus-visible + .star-label { outline: 2px solid var(--hp-blue); outline-offset: 2px; border-radius: 4px; }
.review-item div > .star-rating { margin-inline: 0; }
.review-item strong + .star-rating { margin-inline: 10px 0; }
