/* چیدمان صفحه محصول مطابق الگوی مرجع؛ تمام انتخابگرها محدود به صفحه محصول هستند. */
.afp-product-page,
.afp-product-page * {
    box-sizing: border-box;
}

.afp-product-page {
    --afp-green: #39b978;
    --afp-green-dark: #229f67;
    --afp-border: #e2e5e9;
    --afp-text: #343a40;
    --afp-muted: #7a838d;
    width: 100%;
    max-width: 100%;
    margin: 0 auto 28px;
    color: var(--afp-text);
    direction: rtl;
    text-align: right;
    font-size: 13px;
}

.afp-product-layout {
    display: grid;
    grid-template-columns: minmax(260px, 31%) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    direction: rtl;
}

.afp-product-sidebar,
.afp-product-main {
    min-width: 0;
}

.afp-product-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.afp-panel,
.afp-download-panel,
.afp-gallery-panel,
.afp-description-panel,
.afp-related-section {
    background: #fff;
    border: 1px solid var(--afp-border);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(22, 34, 48, .035);
}

.afp-seller-panel {
    padding: 13px 15px 12px;
}

.afp-seller-label {
    padding-bottom: 10px;
    margin-bottom: 11px;
    border-bottom: 1px solid #edf0f2;
    color: #59616a;
    font-size: 12px;
    font-weight: 700;
}

.afp-seller-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.afp-seller-avatar {
    display: block;
    flex: 0 0 62px;
    width: 62px;
    height: 62px;
    overflow: hidden;
    border: 1px solid #e8ecef;
    border-radius: 50%;
    background: #f5f6f7;
}

.afp-seller-avatar img,
.afp-seller-avatar .avatar {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.afp-seller-details {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
}

.afp-seller-name {
    color: #333b43;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
}

.afp-seller-name:hover,
.afp-seller-more:hover {
    color: var(--afp-green-dark);
}

.afp-seller-more {
    color: var(--afp-green-dark);
    font-size: 11px;
    text-decoration: none;
}

.afp-seller-stars {
    display: flex;
    align-items: center;
    gap: 2px;
    min-height: 14px;
    direction: ltr;
    color: #f4b52b;
    font-size: 13px;
    line-height: 1;
    letter-spacing: .2px;
}

.afp-seller-stars span {
    display: inline-block;
}

.afp-seller-description {
    margin: 10px 0 0;
    color: var(--afp-muted);
    font-size: 12px;
    line-height: 1.9;
}

.afp-seller-note {
    margin: 9px 0 0;
    color: #66717a;
    direction: rtl;
    text-align: justify;
    text-align-last: right;
    font-size: 12px;
    line-height: 1.95;
    overflow-wrap: anywhere;
}

.afp-seller-note p {
    margin: 0 0 7px;
    text-align: justify;
    text-align-last: right;
}

.afp-seller-note p:last-child {
    margin-bottom: 0;
}

.afp-download-panel {
    overflow: hidden;
}

.afp-download-toggle {
    display: flex;
    width: 100%;
    min-height: 47px;
    align-items: center;
    justify-content: center;
    gap: 11px;
    padding: 10px 16px;
    border: 0;
    border-radius: 3px;
    background: var(--afp-green);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    transition: background .18s ease;
}

.afp-download-toggle:hover,
.afp-download-toggle.is-open {
    background: var(--afp-green-dark);
}

.afp-download-toggle svg {
    width: 18px;
    height: 18px;
    transition: transform .18s ease;
}

.afp-download-toggle.is-open svg {
    transform: rotate(180deg);
}

.afp-purchase-options {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 13px;
    border-top: 1px solid #e6ece8;
    background: #fbfdfc;
}

.afp-purchase-options[hidden],
.afp-product-tab-pane[hidden] {
    display: none !important;
}

.afp-purchase-price .price-row {
    margin: 0 0 4px;
    padding: 0 0 9px;
    border-bottom: 1px solid #edf0f2;
}

.afp-purchase-price .sprice {
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: #30343b !important;
}

.afp-purchase-price .sprice * {
    color: #30343b !important;
}

.afp-cart-action .prod-add,
.afp-cart-action .add-col {
    width: 100%;
    margin: 0;
    padding: 0;
}

.afp-cart-action .edd_download_purchase_form,
.afp-cart-action .edd_purchase_submit_wrapper {
    display: block;
    width: 100%;
    margin: 0;
}

.afp-cart-action .edd-submit,
.afp-cart-action .edd-add-to-cart,
.afp-cart-action .button,
.afp-cart-action a.edd-submit,
.afp-cart-action button[type="submit"],
.afp-cart-action input[type="submit"] {
    display: flex !important;
    width: 100% !important;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 3px !important;
    background: #f5a623 !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    text-align: center;
    text-decoration: none !important;
}

.afp-subscription-action {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    border: 1px solid var(--afp-green);
    border-radius: 3px;
    background: #fff;
    color: var(--afp-green-dark);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.afp-subscription-action:hover {
    background: #effaf4;
    color: #148450;
}

.afp-subscription-disabled {
    border-color: #d9dfe3;
    background: #f5f6f7;
    color: #929ba3;
    cursor: not-allowed;
}

.afp-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 12px 14px;
    border-bottom: 1px solid #edf0f2;
    color: #4d555d;
    font-size: 12px;
    font-weight: 700;
}

.afp-panel-title-icon {
    color: var(--afp-green-dark);
    font-size: 16px;
    line-height: 1;
}

.afp-specs-list {
    padding: 4px 13px 7px;
    direction: rtl;
    text-align: right;
    font-size: 12px;
}

.afp-specs-list .prod-row,
.afp-specs-list .prod-attr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    width: 100%;
    min-height: 38px;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 8px 0;
    border-bottom: 1px solid #f0f2f4;
    font-size: 12px;
    line-height: 1.7;
    direction: rtl;
}

.afp-specs-list .prod-row:last-child {
    border-bottom: 0;
}

.afp-specs-list .attr {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
    color: #737c85;
    font-size: 12px;
}

.afp-specs-list .picon {
    color: #8b949c;
}

.afp-specs-list .attr-value {
    min-width: 0;
    color: #3f474f;
    text-align: left;
    overflow-wrap: anywhere;
    font-size: 12px;
}

.afp-specs-list .attr-text,
.afp-specs-list .attr-value span {
    font-size: 12px;
}

.afp-specs-list .attr-value a {
    color: #3f474f;
    text-decoration: none;
}

.afp-tags-panel {
    padding-bottom: 12px;
}

.afp-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 12px 13px 0;
}

.afp-tags-list a {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 4px 9px;
    border: 1px solid #e7eaed;
    border-radius: 3px;
    background: #f8f9fa;
    color: #66717a;
    font-size: 10px;
    text-decoration: none;
}

.afp-tags-list a:hover {
    border-color: #b9e6d0;
    background: #f1fbf5;
    color: var(--afp-green-dark);
}

.afp-product-ads {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.afp-ad-item {
    overflow: hidden;
    border: 1px solid var(--afp-border);
    border-radius: 4px;
    background: #fff;
}

.afp-ad-item a,
.afp-ad-item img {
    display: block;
    width: 100%;
}

.afp-ad-item img {
    height: auto;
    max-height: 260px;
    object-fit: contain;
}

.afp-product-main {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 14px;
}

.afp-gallery-panel {
    position: relative;
    min-width: 0;
    padding: 13px;
}

.afp-product-badges {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
}

.afp-gallery-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 75px;
    gap: 12px;
    direction: rtl;
    align-items: stretch;
}

.afp-gallery-main {
    display: flex;
    min-width: 0;
    min-height: 390px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f2f3f5;
}

.afp-gallery-full-link {
    display: flex;
    width: 100%;
    height: 100%;
    min-height: 390px;
    align-items: center;
    justify-content: center;
}

.afp-gallery-main-image {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 510px;
    object-fit: contain;
}

.afp-gallery-thumbnails {
    display: flex;
    max-height: 510px;
    flex-direction: column;
    gap: 9px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #cbd3d9 transparent;
}

.afp-gallery-thumb {
    display: flex;
    flex: 0 0 76px;
    width: 75px;
    height: 76px;
    align-items: center;
    justify-content: center;
    padding: 3px;
    overflow: hidden;
    border: 1px solid #e0e4e8;
    border-radius: 3px;
    background: #fff;
    cursor: pointer;
}

.afp-gallery-thumb.is-active {
    border: 2px solid var(--afp-green);
}

.afp-gallery-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.afp-gallery-empty {
    min-height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.afp-description-panel {
    min-width: 0;
    overflow: hidden;
}

.afp-product-tabs {
    display: flex;
    min-height: 43px;
    align-items: stretch;
    gap: 4px;
    padding: 0 13px;
    border-bottom: 1px solid var(--afp-border);
    background: #fbfbfc;
}

.afp-product-tab {
    position: relative;
    padding: 0 14px;
    border: 0;
    background: transparent;
    color: #737b83;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
}

.afp-product-tab.is-active {
    color: #303940;
    font-weight: 700;
}

.afp-product-tab.is-active::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: var(--afp-green);
    content: '';
}

.afp-product-tab-content {
    padding: 18px 19px 22px;
}

.afp-product-tab-pane {
    min-width: 0;
}

/* تایپوگرافی توضیحات محصول مستقل است؛ محتوای FAQ/راهنمای خرید از استایل خود افزونه و پوسته پیروی می‌کند. */
#afp-tab-description {
    font-size: 12px;
}

#afp-tab-faq {
    font: revert;
    color: revert;
    line-height: revert;
}

.afp-product-title {
    margin: 0 0 17px;
    color: #343b42;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.9;
}

#afp-tab-description .down-con {
    padding: 0;
    border: 0;
    box-shadow: none;
    color: #464e56;
    font-size: 12px;
    line-height: 2.2;
}

#afp-tab-description .down-con p {
    margin: 0 0 13px;
    line-height: 2.15;
}

#afp-tab-description .down-con h2,
#afp-tab-description .down-con h3,
#afp-tab-description .down-con h4 {
    margin: 17px 0 9px;
    color: #343b42;
    font-size: 13px;
    font-weight: 700;
}

#afp-tab-description .down-con .p-tags,
#afp-tab-description footer,
#afp-tab-description .read-more {
    display: none !important;
}

.afp-faq-empty {
    margin: 0;
    padding: 12px;
    border-radius: 3px;
    background: #f6f8f9;
    color: #69737b;
    line-height: 2;
}

.afp-related-section {
    margin-top: 16px;
    padding: 13px 14px 15px;
    overflow: hidden;
}

.afp-related-heading {
    display: flex;
    min-height: 35px;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.afp-related-heading h2 {
    margin: 0;
    color: #414950;
    font-size: 13px;
    font-weight: 700;
}

.afp-related-more {
    margin-right: auto;
    color: #e56b32;
    font-size: 11px;
    text-decoration: none;
}

.afp-related-more span {
    font-size: 17px;
    vertical-align: -1px;
}

.afp-related-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.afp-related-arrow {
    display: flex;
    width: 27px;
    height: 27px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid #e3e7ea;
    border-radius: 50%;
    background: #fff;
    color: #727b83;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.afp-related-arrow:hover {
    border-color: var(--afp-green);
    color: var(--afp-green-dark);
}

.afp-related-track {
    display: flex;
    gap: 10px;
    padding: 2px 1px 5px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: #d1d7dc transparent;
    direction: rtl;
}

.afp-related-card {
    display: flex;
    flex: 0 0 190px;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #e7eaed;
    border-radius: 3px;
    background: #fff;
    scroll-snap-align: start;
}

.afp-related-image {
    display: flex;
    height: 150px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f2f3f5;
}

.afp-related-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.afp-related-no-image {
    color: #9aa2a9;
    font-size: 11px;
}

.afp-related-name {
    display: -webkit-box;
    min-height: 43px;
    padding: 8px 9px;
    overflow: hidden;
    color: #545d65;
    font-size: 10px;
    line-height: 1.8;
    text-decoration: none;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.afp-related-name:hover {
    color: var(--afp-green-dark);
}

@media (max-width: 991px) {
    .afp-product-layout {
        grid-template-columns: minmax(230px, 34%) minmax(0, 1fr);
        gap: 12px;
    }

    .afp-gallery-main,
    .afp-gallery-full-link {
        min-height: 320px;
    }

    .afp-gallery-thumb {
        flex-basis: 64px;
        width: 64px;
        height: 64px;
    }
}

@media (max-width: 767px) {
    .afp-product-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .afp-product-sidebar {
        order: 1;
    }

    .afp-product-main {
        order: 2;
    }

    .afp-seller-panel {
        padding: 11px 12px;
    }

    .afp-gallery-panel {
        padding: 8px;
    }

    .afp-gallery-wrap {
        grid-template-columns: minmax(0, 1fr) 58px;
        gap: 8px;
    }

    .afp-gallery-main,
    .afp-gallery-full-link {
        min-height: 270px;
    }

    .afp-gallery-main-image {
        max-height: 420px;
    }

    .afp-gallery-thumbnails {
        max-height: 420px;
        gap: 7px;
    }

    .afp-gallery-thumb {
        flex-basis: 58px;
        width: 58px;
        height: 58px;
    }

    .afp-product-tabs {
        gap: 0;
        padding: 0 5px;
    }

    .afp-product-tab {
        padding: 0 8px;
        font-size: 12px;
    }

    .afp-product-tab-content {
        padding: 14px 12px 17px;
    }

    .afp-related-card {
        flex-basis: 154px;
    }

    .afp-related-image {
        height: 120px;
    }
}

@media (max-width: 380px) {
    .afp-product-tabs {
        overflow-x: auto;
    }

    .afp-product-tab {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .afp-gallery-main,
    .afp-gallery-full-link {
        min-height: 230px;
    }
}

/* اصلاحات تکمیلی نسخه سوم بر اساس بازخورد صفحه محصول */
.afp-product-page {
    font-size: 14px;
}

/* کادر طراح: نام، امتیاز واقعی و لینک همگی از یک لبه راست تراز شوند. */
.afp-seller-content {
    direction: rtl;
    align-items: center;
}

.afp-seller-details {
    flex: 1 1 auto;
    min-width: 0;
    align-items: flex-start;
    direction: rtl;
    text-align: right;
    gap: 7px;
}

.afp-seller-name {
    font-size: 15px;
    line-height: 1.7;
}

.afp-seller-more {
    font-size: 13px;
    line-height: 1.7;
}

.afp-seller-rating {
    align-self: flex-start;
    direction: ltr;
    min-height: 16px;
    line-height: 1;
    text-align: right;
}

.afp-seller-rating .star-rating,
.afp-seller-rating .jq-star,
.afp-seller-rating .jq-stars {
    float: none !important;
    display: inline-block;
    margin: 0 !important;
    vertical-align: middle;
}

.afp-seller-description,
.afp-seller-note,
.afp-seller-note p {
    font-size: 13px;
    line-height: 1.95;
    text-align: justify;
    text-align-last: right;
}

.afp-seller-label,
.afp-panel-title {
    font-size: 14px;
}

/* داخل کادر مشخصات فایل، اندازه ۱۲ پیکسل حفظ می‌شود. */
.afp-specs-panel .afp-panel-title {
    font-size: 12px;
}

/* دکمه اصلی خرید و خرید اشتراک از یک خانواده ظاهری استفاده می‌کنند. */
.afp-download-toggle {
    font-size: 17px;
}

.afp-purchase-price .sprice {
    font-size: 16px;
}

.afp-cart-action .edd-submit,
.afp-cart-action .edd-add-to-cart,
.afp-cart-action .button,
.afp-cart-action a.edd-submit,
.afp-cart-action button[type="submit"],
.afp-cart-action input[type="submit"] {
    min-height: 44px;
    padding: 10px 14px !important;
    border: 1px solid #e59a18 !important;
    border-radius: 4px !important;
    background: #f6ad2b !important;
    color: #4a3212 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.5;
    text-shadow: none !important;
    box-shadow: 0 2px 4px rgba(166, 103, 10, .12);
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.afp-cart-action .edd-submit:hover,
.afp-cart-action .edd-add-to-cart:hover,
.afp-cart-action .button:hover,
.afp-cart-action a.edd-submit:hover,
.afp-cart-action button[type="submit"]:hover,
.afp-cart-action input[type="submit"]:hover,
.afp-cart-action .edd-submit:focus,
.afp-cart-action .edd-add-to-cart:focus,
.afp-cart-action .button:focus {
    border-color: #ca7d0a !important;
    background: #df8d13 !important;
    color: #38240b !important;
}

.afp-subscription-action {
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid #159b6e;
    border-radius: 4px;
    background: #27b985;
    color: #123f30;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.5;
    box-shadow: 0 2px 4px rgba(15, 125, 87, .12);
    transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}

.afp-subscription-action:hover,
.afp-subscription-action:focus {
    border-color: #0e8059;
    background: #159968;
    color: #092f23;
}

.afp-subscription-disabled {
    border-color: #64bf91;
    background: #b8e9d0;
    color: #285b43;
    opacity: 1;
}

.afp-subscription-disabled:hover {
    border-color: #64bf91;
    background: #b8e9d0;
    color: #285b43;
}

/* ردیف‌های مشخصات از هم جدا و مانند کارت‌های ظریف نمایش داده شوند. */
.afp-specs-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 10px 13px 13px;
    font-size: 12px;
}

.afp-specs-list .prod-row,
.afp-specs-list .prod-attr {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    width: 100% !important;
    max-width: 100%;
    min-height: 40px;
    align-items: center;
    gap: 12px;
    margin: 0 !important;
    padding: 8px 10px !important;
    border: 1px solid #e9edf1 !important;
    border-radius: 6px;
    background: #f8f9fb;
    box-shadow: 0 1px 2px rgba(24, 39, 55, .035);
    font-size: 12px !important;
    line-height: 1.75;
}

.afp-specs-list .prod-row:last-child,
.afp-specs-list .prod-attr:last-child {
    border-bottom: 1px solid #e9edf1 !important;
}

.afp-specs-list .attr,
.afp-specs-list .attr-value,
.afp-specs-list .attr-text,
.afp-specs-list .attr-value span,
.afp-specs-list .attr-value a {
    font-size: 12px !important;
    line-height: 1.75;
}

/* فرمت فایل در گوشه چپ بالای تصویر و جدا از نشان‌های دیگر محصول قرار می‌گیرد. */
.afp-format-badges {
    position: absolute;
    z-index: 4;
    top: 12px;
    left: 12px;
    right: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-width: 45%;
    direction: ltr;
}

.afp-format-badge {
    display: inline-flex;
    min-height: 23px;
    align-items: center;
    justify-content: center;
    padding: 3px 7px;
    border-radius: 4px;
    background: #3569e8;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: .2px;
}

/* فقط زمانی که واقعاً چند تصویر وجود دارد، ستون بندانگشتی در سمت چپ ساخته می‌شود. */
.afp-gallery-wrap:not(.has-thumbnails) {
    grid-template-columns: minmax(0, 1fr);
}

.afp-gallery-wrap.has-thumbnails {
    grid-template-columns: minmax(0, 1fr) 76px;
    align-items: start;
}

.afp-gallery-wrap.has-thumbnails .afp-gallery-thumbnails {
    display: flex !important;
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    width: 76px;
    max-height: 510px;
    flex-direction: column;
    gap: 9px;
    visibility: visible;
    opacity: 1;
}

.afp-gallery-wrap.has-thumbnails .afp-gallery-main {
    grid-column: 1;
    grid-row: 1;
}

.afp-gallery-wrap.has-thumbnails .afp-gallery-thumb {
    flex: 0 0 76px;
    width: 76px;
    height: 76px;
}

/* اندازه متن تب‌های اصلی؛ فقط محتوای توضیحات کنترل می‌شود. FAQ و راهنمای خرید از استایل داخلی خود استفاده می‌کنند. */
.afp-product-tab {
    font-size: 13px;
}

#afp-tab-description {
    font-size: 13px;
}

.afp-product-title {
    font-size: 17px;
}

.afp-tags-list a {
    font-size: 12px;
}

.afp-related-heading h2 {
    font-size: 14px;
}

.afp-related-more {
    font-size: 12px;
}

.afp-related-name {
    font-size: 11px;
}

@media (max-width: 767px) {
    .afp-gallery-wrap.has-thumbnails {
        grid-template-columns: minmax(0, 1fr) 58px;
    }

    .afp-gallery-wrap.has-thumbnails .afp-gallery-thumbnails {
        width: 58px;
        max-height: 420px;
        gap: 7px;
    }

    .afp-gallery-wrap.has-thumbnails .afp-gallery-thumb {
        flex-basis: 58px;
        width: 58px;
        height: 58px;
    }
}

.afp-gallery-main {
    position: relative;
}

.afp-format-badges {
    top: 10px;
    left: 10px;
}


/* اصلاحات تکمیلی مطابق بازخورد صفحه محصول */

/* امتیازدهی EDD قالب اصلی در کارت طراح، از سمت راست تراز می‌شود. */
.afp-seller-rating {
    display: block;
    align-self: flex-start;
    width: auto;
    min-height: 16px;
    direction: ltr;
    text-align: right;
}

.afp-seller-rating .az-star-ratings {
    display: block;
    width: auto !important;
    margin: 0 !important;
    text-align: right;
}

.afp-seller-rating .az-star-ratings .stars-wrap {
    width: 85px;
    margin: 0 !important;
    clear: both;
}

/* دکمه نارنجی ساده است؛ آیکون و افکت موجی/حرکت از راست به چپ قالب حذف می‌شود. */
.afp-cart-action .edd-add-to-cart::before,
.afp-cart-action .edd-submit::before,
.afp-cart-action .edd-go-to-checkout::before,
.afp-cart-action .edd-add-to-cart::after,
.afp-cart-action .edd-submit::after,
.afp-cart-action .edd-go-to-checkout::after,
.afp-cart-action .edd-add-to-cart-label::before {
    display: none !important;
    content: none !important;
    width: 0 !important;
    height: 0 !important;
    background: none !important;
    box-shadow: none !important;
    transition: none !important;
}

.afp-cart-action .edd-submit,
.afp-cart-action .edd-add-to-cart,
.afp-cart-action .button,
.afp-cart-action a.edd-submit,
.afp-cart-action button[type="submit"],
.afp-cart-action input[type="submit"] {
    position: relative !important;
    display: flex !important;
    width: 100% !important;
    min-height: 44px;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 14px !important;
    overflow: hidden !important;
    border: 1px solid #e39a20 !important;
    border-radius: 4px !important;
    background: #f4a722 !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.5 !important;
    text-align: center !important;
    text-decoration: none !important;
    text-shadow: none !important;
    box-shadow: 0 2px 4px rgba(166, 103, 10, .12) !important;
    transform: none !important;
    transition: background-color .16s ease, border-color .16s ease !important;
}

.afp-cart-action .edd-submit:hover,
.afp-cart-action .edd-add-to-cart:hover,
.afp-cart-action .button:hover,
.afp-cart-action a.edd-submit:hover,
.afp-cart-action button[type="submit"]:hover,
.afp-cart-action input[type="submit"]:hover,
.afp-cart-action .edd-submit:focus,
.afp-cart-action .edd-add-to-cart:focus,
.afp-cart-action .button:focus {
    border-color: #c77d0b !important;
    background: #d98710 !important;
    color: #fff !important;
}

.afp-cart-action .edd-add-to-cart-label,
.afp-cart-action .edd-add-to-cart-label *,
.afp-cart-action .edd-submit *,
.afp-cart-action .edd-add-to-cart *,
.afp-cart-action .button * {
    color: #fff !important;
    text-shadow: none !important;
}

/* هرگونه آیکون داخلی احتمالی دکمه خرید نیز مخفی می‌شود. */
.afp-cart-action .edd-add-to-cart i,
.afp-cart-action .edd-submit i,
.afp-cart-action .edd-add-to-cart svg,
.afp-cart-action .edd-submit svg {
    display: none !important;
}

.afp-cart-action .edd-submit,
.afp-cart-action .edd-add-to-cart,
.afp-cart-action .button {
    background-image: none !important;
    animation: none !important;
    filter: none !important;
}

/* دکمه اشتراک هم متن سفید دارد و در هاور فقط رنگ پس‌زمینه تیره می‌شود. */
.afp-subscription-action {
    border-color: #159b6e !important;
    background: #20b783 !important;
    color: #fff !important;
    transition: background-color .16s ease, border-color .16s ease !important;
}

.afp-subscription-action:not(.afp-subscription-disabled):hover,
.afp-subscription-action:not(.afp-subscription-disabled):focus {
    border-color: #0e8059 !important;
    background: #138b61 !important;
    color: #fff !important;
}

.afp-subscription-action.afp-subscription-disabled {
    color: #fff !important;
}

/* مقدار هر مشخصه در لبه چپ ردیف تراز می‌شود؛ عنوان و آیکون در سمت راست می‌مانند. */
.afp-specs-list .prod-row,
.afp-specs-list .prod-attr {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    justify-items: stretch !important;
    direction: rtl !important;
}

.afp-specs-list .prod-row > .attr-value,
.afp-specs-list .prod-attr > .attr-value {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    justify-self: stretch !important;
    padding-left: 8px !important;
    text-align: left !important;
}

.afp-specs-list .prod-row > .attr-value span,
.afp-specs-list .prod-attr > .attr-value span,
.afp-specs-list .prod-row > .attr-value a,
.afp-specs-list .prod-attr > .attr-value a {
    display: inline-block;
    width: 100%;
    text-align: left !important;
}

/* نشان فرمت فقط روی خود تصویر و از طبقه‌بندی پنل طراحان قرار می‌گیرد. */
.afp-gallery-main .afp-format-badges {
    position: absolute !important;
    z-index: 5;
    top: 10px !important;
    left: 10px !important;
    right: auto !important;
    pointer-events: none;
}


/* نسخه پنجم: متن دکمه‌ها در تمام حالت‌ها سفید می‌ماند و هیچ افکت حرکتی باقی نمی‌ماند. */
.afp-cart-action .edd-submit:hover,
.afp-cart-action .edd-add-to-cart:hover,
.afp-cart-action .button:hover,
.afp-cart-action .edd-submit:focus,
.afp-cart-action .edd-add-to-cart:focus,
.afp-cart-action .button:focus {
    background-image: none !important;
    animation: none !important;
    transform: none !important;
    color: #fff !important;
}

.afp-cart-action .edd-submit *,
.afp-cart-action .edd-add-to-cart *,
.afp-cart-action .button *,
.afp-subscription-action,
.afp-subscription-action * {
    color: #fff !important;
}

/* مقدارهای مشخصات، مستقل از جهت نوشتار عنوان، دقیقاً به لبه چپ ستون می‌چسبند. */
.afp-specs-list .prod-row > .attr-value,
.afp-specs-list .prod-attr > .attr-value,
.afp-specs-list .prod-row > .attr-value > span,
.afp-specs-list .prod-attr > .attr-value > span {
    direction: ltr;
    unicode-bidi: plaintext;
    text-align: left !important;
    justify-self: stretch !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}


/* v6: رنگ مبلغ فایل زغالی تیره است؛ ستاره‌ها مستقیماً از افزونه پنل طراحان EDD می‌آیند. */
.afp-purchase-price .sprice,
.afp-purchase-price .sprice * {
    color: #30343b !important;
}

.afp-seller-rating .esp-profile-stars {
    display: block !important;
    width: max-content !important;
    max-width: 100%;
    margin: 0 !important;
    text-align: right !important;
    clear: both;
}

.afp-seller-rating .esp-profile-stars .esp-stars {
    display: flex !important;
    justify-content: flex-start !important;
    margin: 0 !important;
}


/* نسخه هفتم: قاب اصلی دقیقاً با نسبت طبیعی تصویر هماهنگ می‌شود؛ قاب ثابت و فضای خالی اجباری حذف شده است. */
.afp-gallery-panel .afp-gallery-wrap {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 76px !important;
    align-items: start !important;
    gap: 12px !important;
    direction: rtl !important;
}

.afp-gallery-panel .afp-gallery-wrap:not(.has-thumbnails) {
    grid-template-columns: minmax(0, 1fr) !important;
}

.afp-gallery-panel .afp-gallery-main {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
    overflow: visible !important;
    align-items: initial !important;
    justify-content: initial !important;
    background: #fff !important;
    line-height: 0 !important;
}

.afp-gallery-panel .afp-gallery-full-link {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    line-height: 0 !important;
}

.afp-gallery-panel .afp-gallery-main-image {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: initial !important;
    margin: 0 !important;
}

/* بندانگشتی‌ها بیرون قاب و در ستون مستقل سمت چپ تصویر اصلی می‌مانند. */
.afp-gallery-panel .afp-gallery-wrap.has-thumbnails .afp-gallery-thumbnails {
    display: flex !important;
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: start !important;
    width: 76px !important;
    max-height: none !important;
    overflow: visible !important;
    flex-direction: column !important;
    gap: 9px !important;
}

.afp-gallery-panel .afp-gallery-wrap.has-thumbnails .afp-gallery-main {
    grid-column: 1 !important;
    grid-row: 1 !important;
}

.afp-gallery-panel .afp-gallery-thumb {
    flex: 0 0 76px !important;
    width: 76px !important;
    height: 76px !important;
}

@media (max-width: 767px) {
    .afp-gallery-panel .afp-gallery-wrap {
        grid-template-columns: minmax(0, 1fr) 58px !important;
        gap: 8px !important;
    }

    .afp-gallery-panel .afp-gallery-wrap.has-thumbnails .afp-gallery-thumbnails {
        width: 58px !important;
        max-height: none !important;
        gap: 7px !important;
    }

    .afp-gallery-panel .afp-gallery-thumb {
        flex-basis: 58px !important;
        width: 58px !important;
        height: 58px !important;
    }
}


/* V8: قاب گالری از اندازه واقعی rendition تک‌تصویر single-download پیروی می‌کند. */
.afp-gallery-panel .afp-gallery-wrap,
.afp-gallery-panel .afp-gallery-wrap.has-thumbnails {
    display: grid !important;
    width: max-content !important;
    max-width: 100% !important;
    grid-template-columns: minmax(0, max-content) 76px !important;
    justify-content: center !important;
    align-items: start !important;
    gap: 12px !important;
    margin: 0 auto !important;
    direction: rtl !important;
    vertical-align: top;
}

.afp-gallery-panel .afp-gallery-wrap:not(.has-thumbnails) {
    grid-template-columns: minmax(0, max-content) !important;
}

.afp-gallery-panel .afp-gallery-main {
    display: block !important;
    width: max-content !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    justify-self: center !important;
    overflow: visible !important;
    background: transparent !important;
    line-height: 0 !important;
}

.afp-gallery-panel .afp-gallery-full-link {
    display: block !important;
    width: max-content !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    line-height: 0 !important;
}

.afp-gallery-panel .afp-gallery-main-image {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center center !important;
    margin: 0 auto !important;
}

.afp-gallery-panel .afp-gallery-wrap.has-thumbnails .afp-gallery-thumbnails {
    grid-column: 2 !important;
    grid-row: 1 !important;
    width: 76px !important;
    max-height: none !important;
    align-self: start !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

.afp-gallery-panel .afp-gallery-wrap.has-thumbnails .afp-gallery-main {
    grid-column: 1 !important;
    grid-row: 1 !important;
}

.afp-gallery-panel .afp-gallery-thumb img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

/* شمارنده فایل‌های حاضر در نوار محصولات مرتبط. */
.afp-related-count {
    display: inline-block;
    margin-right: 5px;
    color: #87919a;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

/* لینک مشاهده بیشتر بدون فلش؛ با کنتراست و تأکید متناسب با پوسته. */
.afp-related-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: auto;
    padding: 7px 12px;
    border: 1px solid #f0d5c4;
    border-radius: 4px;
    background: #fff8f3;
    color: #c95820 !important;
    font-size: 13px !important;
    font-weight: 700;
    line-height: 1.5;
    text-decoration: none !important;
    transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.afp-related-more:hover,
.afp-related-more:focus {
    border-color: #d7682b;
    background: #d7682b;
    color: #fff !important;
}

.afp-related-more span {
    display: none !important;
}

.afp-related-heading-title {
    margin: 0;
    color: #414950;
    font-size: 13px;
    font-weight: 700;
}

/* تصاویر کارت‌های مرتبط نیز از single-download می‌آیند و هیچ crop دیگری روی آن‌ها اعمال نمی‌شود. */
.afp-related-image {
    min-height: 150px;
    height: 150px;
    padding: 8px;
}

.afp-related-image img {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
}

@media (max-width: 767px) {
    .afp-gallery-panel .afp-gallery-wrap,
    .afp-gallery-panel .afp-gallery-wrap.has-thumbnails {
        grid-template-columns: minmax(0, max-content) 58px !important;
        gap: 8px !important;
    }

    .afp-gallery-panel .afp-gallery-wrap:not(.has-thumbnails) {
        grid-template-columns: minmax(0, max-content) !important;
    }

    .afp-gallery-panel .afp-gallery-wrap.has-thumbnails .afp-gallery-thumbnails {
        width: 58px !important;
    }
}

/* V9: پنل گالری به اندازه محتوای واقعی جمع می‌شود؛ تصویر قاب مستقل و طبیعی دارد. */
.afp-product-main > .afp-gallery-panel {
    align-self: center !important;
    width: fit-content !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 0 1 auto !important;
    padding: 9px !important;
    box-sizing: border-box !important;
}

.afp-gallery-panel .afp-gallery-wrap,
.afp-gallery-panel .afp-gallery-wrap.has-thumbnails {
    display: grid !important;
    width: fit-content !important;
    max-width: 100% !important;
    grid-template-columns: minmax(0, max-content) 76px !important;
    align-items: start !important;
    justify-content: center !important;
    gap: 12px !important;
    margin: 0 auto !important;
    direction: rtl !important;
}

.afp-gallery-panel .afp-gallery-wrap:not(.has-thumbnails) {
    grid-template-columns: minmax(0, max-content) !important;
}

.afp-gallery-panel .afp-gallery-main {
    display: block !important;
    width: fit-content !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 5px !important;
    border: 1px solid #e1e6e9 !important;
    border-radius: 5px !important;
    background: #fff !important;
    box-shadow: 0 1px 5px rgba(27, 43, 55, .08) !important;
    overflow: visible !important;
    line-height: 0 !important;
}

.afp-gallery-panel .afp-gallery-full-link {
    display: block !important;
    width: fit-content !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    line-height: 0 !important;
}

.afp-gallery-panel .afp-gallery-main-image {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: none !important;
    object-fit: contain !important;
    object-position: center center !important;
    margin: 0 !important;
}

/* تصاویر بندانگشتی خارج از قاب تصویر اصلی و در سمت چپ آن قرار می‌گیرند. */
.afp-gallery-panel .afp-gallery-wrap.has-thumbnails .afp-gallery-thumbnails {
    display: flex !important;
    grid-column: 2 !important;
    grid-row: 1 !important;
    align-self: start !important;
    width: 76px !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    flex-direction: column !important;
    gap: 9px !important;
}

.afp-gallery-panel .afp-gallery-wrap.has-thumbnails .afp-gallery-main {
    grid-column: 1 !important;
    grid-row: 1 !important;
}

.afp-gallery-panel .afp-gallery-thumb {
    flex: 0 0 76px !important;
    width: 76px !important;
    height: 76px !important;
    padding: 3px !important;
    border: 1px solid #e0e5e9 !important;
    border-radius: 4px !important;
    background: #fff !important;
}

.afp-gallery-panel .afp-gallery-thumb.is-active {
    border: 2px solid var(--afp-green) !important;
}

/* شمارنده، تعداد کل نتایج واجد شرایط را نشان می‌دهد؛ نه تعداد کارت‌های نوار. */
.afp-related-count {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin-right: 8px !important;
    padding: 4px 9px !important;
    border: 1px solid color-mix(in srgb, var(--afp-green, #39b978) 28%, #fff) !important;
    border-radius: 20px !important;
    background: color-mix(in srgb, var(--afp-green, #39b978) 9%, #fff) !important;
    color: color-mix(in srgb, var(--afp-green-dark, #229f67) 78%, #263b35) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

.afp-related-count strong {
    display: inline-flex !important;
    min-width: 28px !important;
    height: 28px !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 5px !important;
    border-radius: 15px !important;
    background: var(--afp-green, #39b978) !important;
    color: #fff !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
}

/* دکمه مشاهده بیشتر با سبز روشن سایت و هاور سبز تیره. */
.afp-related-more {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-right: auto !important;
    padding: 8px 15px !important;
    border: 1px solid var(--afp-green, #35b77c) !important;
    border-radius: 4px !important;
    background: var(--afp-green, #35b77c) !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    box-shadow: 0 2px 5px rgba(35, 159, 103, .14) !important;
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease !important;
}

.afp-related-more:hover,
.afp-related-more:focus {
    border-color: var(--afp-green-dark, #218f5e) !important;
    background: var(--afp-green-dark, #218f5e) !important;
    color: #fff !important;
    box-shadow: 0 3px 7px rgba(25, 117, 77, .22) !important;
}

.afp-related-more span {
    display: none !important;
}

@media (max-width: 767px) {
    .afp-gallery-panel .afp-gallery-wrap,
    .afp-gallery-panel .afp-gallery-wrap.has-thumbnails {
        grid-template-columns: minmax(0, max-content) 58px !important;
        gap: 8px !important;
    }

    .afp-gallery-panel .afp-gallery-wrap:not(.has-thumbnails) {
        grid-template-columns: minmax(0, max-content) !important;
    }

    .afp-gallery-panel .afp-gallery-wrap.has-thumbnails .afp-gallery-thumbnails {
        width: 58px !important;
        gap: 7px !important;
    }

    .afp-gallery-panel .afp-gallery-thumb {
        flex-basis: 58px !important;
        width: 58px !important;
        height: 58px !important;
    }
}


/* فرمت‌های تصویری TIFF/Vector/PSD روی عکس نمایش داده نمی‌شوند؛ اطلاعات فرمت در مشخصات فایل باقی می‌ماند. */
.afp-gallery-panel .tfsp-format-badges,
.afp-gallery-panel .tfsp-format-image-wrap-single,
.afp-gallery-panel .afp-format-badges {
    display: none !important;
    visibility: hidden !important;
}

/* لایت‌باکس تصویر محصول در همان صفحه. */
.afp-lightbox[hidden] {
    display: none !important;
}

.afp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(12, 18, 24, .92);
    direction: ltr;
}

.afp-lightbox__dialog {
    position: relative;
    display: flex;
    max-width: 96vw;
    max-height: 94vh;
    align-items: center;
    justify-content: center;
    outline: none;
}

.afp-lightbox__image {
    display: block;
    width: auto;
    height: auto;
    max-width: 92vw;
    max-height: 88vh;
    object-fit: contain;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 12px 44px rgba(0, 0, 0, .36);
}

.afp-lightbox__close,
.afp-lightbox__nav {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 50%;
    background: rgba(28, 36, 44, .78);
    color: #fff;
    cursor: pointer;
    line-height: 1;
    transition: background .15s ease, transform .15s ease;
}

.afp-lightbox__close:hover,
.afp-lightbox__nav:hover {
    background: #239f67;
    transform: scale(1.05);
}

.afp-lightbox__close {
    top: -18px;
    right: -18px;
    width: 40px;
    height: 40px;
    font-size: 30px;
}

.afp-lightbox__nav {
    top: 50%;
    width: 42px;
    height: 42px;
    margin-top: -21px;
    font-size: 32px;
}

.afp-lightbox__previous {
    left: -58px;
}

.afp-lightbox__next {
    right: -58px;
}

.afp-lightbox__nav[hidden] {
    display: none !important;
}

@media (max-width: 640px) {
    .afp-lightbox {
        padding: 12px;
    }
    .afp-lightbox__image {
        max-width: 94vw;
        max-height: 84vh;
    }
    .afp-lightbox__previous {
        left: 7px;
    }
    .afp-lightbox__next {
        right: 7px;
    }
    .afp-lightbox__close {
        top: 8px;
        right: 8px;
    }
}


/* V13 button fix: نوار خرید چسبان قدیمی در صفحه محصول جدید فرم EDD تکراری می‌ساخت. */
.afp-product-page ~ .azin-sticky-add-cart,
body:has(.afp-product-page) .azin-sticky-add-cart {
    display: none !important;
}

/* فاصله استاندارد بین دکمه خرید EDD و دکمه اشتراک. */
.afp-purchase-options {
    gap: 8px;
}

/*
 * خروجی فرم EDD در پوسته ۲۰px فضای خالی انتهایی به‌جا می‌گذارد:
 * خود دکمه ۴۴px است اما جعبه afp-cart-action در Inspector برابر ۶۴px دیده می‌شود.
 * فقط وقتی فرم واقعی خرید وجود دارد، فضای خالی داخلی جمع می‌شود تا فاصله نهایی ۸px بماند.
 * حالت‌های رایگان/به‌زودی که فرم EDD ندارند، دست‌نخورده می‌مانند.
 */
.afp-cart-action:has(.edd_download_purchase_form) {
    margin-bottom: -20px !important;
}

/* حذف marginهای پیش‌فرض پوسته و فرم EDD داخل پنل خرید. */
.afp-cart-action,
.afp-cart-action form,
.afp-cart-action p,
.afp-cart-action .edd_download_purchase_form,
.afp-cart-action .edd_purchase_submit_wrapper,
.afp-cart-action .prod-add,
.afp-cart-action .add-col {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}
