/* Product detail page 1.7.2 */
/* Keep Porto's assigned Page Header block, but suppress the duplicate default
   page-top section that Porto prints immediately after the banner block. */
body.hps-product-detail-page .porto-html-block.porto-block-html-banner + .page-top,
body.hps-product-detail-page .porto-html-block.porto-block-html-banner + section.page-top {
    display: none !important;
}
body.hps-product-detail-page .porto-html-block.porto-block-html-banner,
body.hps-product-detail-page .porto-html-block.porto-block-html-banner .page-header,
body.hps-product-detail-page .porto-html-block.porto-block-html-banner .page-top,
body.hps-product-detail-page .porto-html-block.porto-block-html-banner .page-title-wrap {
    display: block !important;
}
body.hps-product-detail-page .porto-html-block.porto-block-html-banner .page-title,
body.hps-product-detail-page .porto-html-block.porto-block-html-banner .breadcrumbs-wrap {
    visibility: visible !important;
}

/* Porto full-width integration: remove the page sidebar only on HPS detail pages. */
body.hps-product-detail-page #main .main-content,
body.hps-product-detail-page #main .page-content,
body.hps-product-detail-page #main .content-area,
body.hps-product-detail-page #main #primary,
body.hps-product-detail-page #main .col-lg-8,
body.hps-product-detail-page #main .col-lg-9,
body.hps-product-detail-page #main .col-md-8,
body.hps-product-detail-page #main .col-md-9 {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    padding-top: 0;
}
body.hps-product-detail-page #main > .container > .row > #sidebar,
body.hps-product-detail-page #main > .container > .row > aside.sidebar,
body.hps-product-detail-page #main > .container > .row > .sidebar,
body.hps-product-detail-page #main .main-content + #sidebar,
body.hps-product-detail-page #main .main-content + aside.sidebar,
body.hps-product-detail-page #main .main-content ~ .sidebar,
body.hps-product-detail-page #main .content-area + .widget-area,
body.hps-product-detail-page #main .sidebar-toggle,
body.hps-product-detail-page #main .sidebar-overlay {
    display: none !important;
}
.hps-detail-page {
    --hps-primary: #292929;
    --hps-accent: #EDE621;
    --hps-radius: 18px;
    --hps-muted: #666a6d;
    --hps-line: rgba(41, 41, 41, .12);
    width: 100%;
    padding: clamp(24px, 4vw, 54px) 0 clamp(44px, 7vw, 84px);
    color: var(--hps-primary);
    background: linear-gradient(180deg, #fffef6 0, #fff 300px);
    font-family: inherit;
    text-align: right;
}
.hps-detail-page, .hps-detail-page * { box-sizing: border-box; }
.hps-detail-page a { text-decoration: none; }
.hps-detail-container {
    width: min(calc(100% - 40px), 1440px) !important;
    max-width: 1440px !important;
    margin-right: auto !important;
    margin-left: auto !important;
    padding-right: 0 !important;
    padding-left: 0 !important;
}
.hps-detail-article { min-width: 0; }
.hps-detail-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(360px, .88fr) minmax(0, 1.12fr);
    gap: clamp(28px, 5vw, 64px);
    align-items: center;
    overflow: hidden;
    padding: clamp(22px, 3.8vw, 46px);
    border: 1px solid var(--hps-line);
    border-radius: calc(var(--hps-radius) + 8px);
    background: #fff;
    box-shadow: 0 22px 58px rgba(28, 28, 28, .09), 0 2px 5px rgba(28, 28, 28, .035);
}
.hps-detail-hero::before {
    position: absolute;
    top: 0;
    right: clamp(24px, 5vw, 66px);
    width: 92px;
    height: 6px;
    border-radius: 0 0 10px 10px;
    background: var(--hps-accent);
    content: "";
}
.hps-detail-visual { min-width: 0; }
.hps-detail-image {
    position: relative;
    width: 100%;
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(41, 41, 41, .09);
    border-radius: calc(var(--hps-radius) + 2px);
    display: grid;
    place-items: center;
    padding: clamp(8px, 1.4vw, 18px);
    background: #f7f7f4;
    aspect-ratio: 1 / 1;
    box-shadow: 0 15px 38px rgba(28, 28, 28, .10);
}
.hps-detail-image::after { display: none; }
.hps-detail-image img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    object-fit: contain;
    object-position: center;
}
.hps-detail-icon {
    position: relative;
    display: grid;
    width: 100%;
    min-height: 390px;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(41, 41, 41, .10);
    border-radius: calc(var(--hps-radius) + 2px);
    background: linear-gradient(145deg, var(--hps-primary), #3d3d3d);
    color: var(--hps-accent);
    box-shadow: 0 15px 38px rgba(28, 28, 28, .13);
}
.hps-detail-icon::before,
.hps-detail-icon::after { position: absolute; border-radius: 50%; background: rgba(237,230,33,.09); content: ""; }
.hps-detail-icon::before { width: 260px; height: 260px; top: -90px; left: -70px; }
.hps-detail-icon::after { width: 180px; height: 180px; right: -60px; bottom: -70px; }
.hps-detail-icon svg { position: relative; z-index: 1; width: 92px; height: 92px; }
.hps-detail-summary { min-width: 0; }
.hps-detail-badge {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    padding: 6px 11px;
    border-radius: 9px;
    background: var(--hps-accent);
    color: var(--hps-primary);
    font-size: 12px;
    font-weight: 900;
}
.hps-detail-kicker { margin: 14px 0 5px !important; color: #777a7c; font-size: 13px; font-weight: 700; }
.hps-detail-summary h1,
.hps-detail-summary .hps-detail-title {
    margin: 0 !important;
    color: var(--hps-primary);
    font: inherit;
    font-size: clamp(29px, 4vw, 46px);
    font-weight: 950;
    line-height: 1.45;
    letter-spacing: -.025em;
}
.hps-detail-lead { margin-top: 13px; color: var(--hps-muted); font-size: clamp(15px, 1.5vw, 17px); line-height: 2.05; }
.hps-detail-lead p { margin: 0; }
.hps-detail-variants { display: grid; gap: 10px; margin-top: 25px; }
.hps-detail-variant {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 13px 14px;
    border: 1px solid rgba(41, 41, 41, .10);
    border-radius: 14px;
    background: #fbfbf8;
}
.hps-detail-variant-copy { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.hps-detail-variant-copy strong { color: var(--hps-primary); font-size: 13.5px; font-weight: 900; line-height: 1.7; }
.hps-detail-variant-copy span { color: #4c4f51; font-size: 14px; font-weight: 850; line-height: 1.6; }
.hps-invoice-tax-notice {
    margin: 0;
    color: #716000;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.75;
}
.hps-detail-invoice-tax-notice {
    margin: -2px 2px 0;
}
.hps-detail-order-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 9px 13px 9px 10px;
    border: 1px solid var(--hps-primary);
    border-radius: 11px;
    background: var(--hps-primary);
    color: #fff !important;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    box-shadow: 0 8px 18px rgba(41, 41, 41, .14);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.hps-detail-order-button svg { width: 27px; height: 27px; padding: 5px; border-radius: 8px; background: var(--hps-accent); color: var(--hps-primary); }
.hps-detail-order-button:hover { background: #151515; color: #fff !important; transform: translateY(-1px); box-shadow: 0 11px 24px rgba(41,41,41,.2); }
.hps-detail-back { display: inline-flex; align-items: center; gap: 7px; margin-top: 20px; color: #55595b; font-size: 13.5px; font-weight: 800; }
.hps-detail-back svg { color: var(--hps-primary); }
.hps-detail-back:hover { color: #111; }
.hps-detail-content-section,
.hps-detail-related { margin-top: clamp(30px, 5vw, 54px); }
.hps-detail-content-section {
    padding: clamp(24px, 4vw, 42px);
    border: 1px solid var(--hps-line);
    border-radius: calc(var(--hps-radius) + 5px);
    background: #fff;
    box-shadow: 0 12px 34px rgba(28,28,28,.055);
}
.hps-detail-section-heading { display: flex; align-items: center; gap: 11px; margin-bottom: 18px; }
.hps-detail-section-heading > span { width: 7px; height: 29px; flex: 0 0 7px; border-radius: 999px; background: var(--hps-accent); }
.hps-detail-section-heading h2 { margin: 0; color: var(--hps-primary); font: inherit; font-size: clamp(21px, 2.3vw, 28px); font-weight: 950; line-height: 1.5; }
.hps-detail-richtext { color: #505456; font-size: 15.5px; line-height: 2.15; }
.hps-detail-richtext > :first-child { margin-top: 0; }
.hps-detail-richtext > :last-child { margin-bottom: 0; }
.hps-detail-richtext h2, .hps-detail-richtext h3, .hps-detail-richtext h4 { margin: 1.7em 0 .65em; color: var(--hps-primary); font-family: inherit; font-weight: 900; line-height: 1.6; }
.hps-detail-richtext ul, .hps-detail-richtext ol { padding-right: 1.25em; }
.hps-detail-richtext li { margin-bottom: .35em; }
.hps-detail-related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.hps-detail-related-card {
    position: relative;
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 13px;
    min-width: 0;
    padding: 17px;
    border: 1px solid var(--hps-line);
    border-radius: var(--hps-radius);
    background: #fff;
    color: var(--hps-primary) !important;
    box-shadow: 0 8px 22px rgba(28,28,28,.05);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.hps-detail-related-icon { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 14px; background: var(--hps-primary); color: var(--hps-accent); }
.hps-detail-related-icon svg { width: 25px; height: 25px; }
.hps-detail-related-card h3 { margin: 0; color: var(--hps-primary); font: inherit; font-size: 15px; font-weight: 900; line-height: 1.65; }
.hps-detail-related-card p { margin: 4px 0 0; color: #747779; font-size: 12.5px; line-height: 1.75; }
.hps-related-arrow { color: #6d7072; }
.hps-detail-related-card:hover { transform: translateY(-3px); border-color: rgba(41,41,41,.23); box-shadow: 0 14px 32px rgba(28,28,28,.09); }
.hps-detail-page a:focus-visible { outline: 3px solid var(--hps-accent); outline-offset: 3px; }
@media (max-width: 991px) {
    .hps-detail-hero { grid-template-columns: minmax(300px, .9fr) minmax(0, 1.1fr); gap: 28px; }
    .hps-detail-icon { min-height: 320px; }
    .hps-detail-related-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
    .hps-detail-page { padding-top: 18px; }
    .hps-detail-hero { grid-template-columns: minmax(0, 1fr); padding: 17px; border-radius: 20px; }
    .hps-detail-image { aspect-ratio: 1 / 1; padding: 8px; }
    .hps-detail-icon { min-height: 240px; }
    .hps-detail-summary h1, .hps-detail-summary .hps-detail-title { font-size: clamp(26px, 8vw, 35px); }
    .hps-detail-variant { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .hps-detail-order-button { width: 100%; justify-content: space-between; }
    .hps-detail-content-section { padding: 21px 18px; border-radius: 18px; }
}
@media (max-width: 420px) {
    .hps-detail-container { width: calc(100% - 24px) !important; }
    .hps-detail-related-card { grid-template-columns: 46px minmax(0, 1fr) 18px; padding: 14px; }
    .hps-detail-related-icon { width: 46px; height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
    .hps-detail-order-button, .hps-detail-related-card { transition: none; }
}


/* Optional sticky ordering panel - 1.7.2 */
.hps-sticky-order[hidden],
.hps-sticky-order-reopen[hidden] { display: none !important; }
.hps-sticky-order {
    position: fixed;
    z-index: 99920;
    right: 0;
    bottom: 16px;
    left: 0;
    padding: 0 18px;
    pointer-events: none;
    transition: opacity .24s ease, transform .24s ease;
}
.hps-sticky-order-shell {
    position: relative;
    display: grid;
    width: min(1400px, 100%);
    grid-template-columns: minmax(185px, .62fr) minmax(0, 2.38fr);
    gap: 14px;
    align-items: center;
    margin: 0 auto;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.66);
    border-radius: 19px;
    background: rgba(255,255,255,.90);
    box-shadow: 0 20px 62px rgba(22,22,22,.20), 0 3px 10px rgba(22,22,22,.08);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    pointer-events: auto;
}
.hps-sticky-invoice-tax-notice {
    display: none;
    min-width: 0;
    white-space: nowrap;
}
.hps-sticky-option-invoice-tax-notice {
    grid-column: 1 / -1;
    white-space: normal;
}
@media (min-width: 900px) {
    .hps-sticky-order-shell {
        grid-template-columns: minmax(185px, .62fr) auto minmax(0, 2.38fr);
    }
    .hps-sticky-invoice-tax-notice {
        display: block;
        max-width: 360px;
        overflow: hidden;
        padding-inline: 2px;
        font-size: 11.5px;
        text-overflow: ellipsis;
    }
    .hps-sticky-option-invoice-tax-notice { display: none; }
}
.hps-sticky-order-heading {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 4px 6px 4px 2px;
}
.hps-sticky-order-heading-copy { min-width: 0; }
.hps-sticky-order-heading span {
    display: block;
    margin-bottom: 3px;
    color: #76797a;
    font-size: 11px;
    font-weight: 750;
}
.hps-sticky-order-heading strong {
    display: block;
    overflow: hidden;
    color: var(--hps-primary, #292929);
    font-size: 13px;
    font-weight: 950;
    line-height: 1.55;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hps-sticky-order-close {
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(41,41,41,.07);
    color: #292929;
    font: inherit;
    font-size: 23px;
    line-height: 1;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}
.hps-sticky-order-close:hover,
.hps-sticky-order-close:focus-visible { background: var(--hps-accent, #EDE621); transform: rotate(5deg); outline: none; }
.hps-sticky-order-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 9px;
    min-width: 0;
}
.hps-sticky-order-option {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 8px 9px;
    border: 1px solid rgba(41,41,41,.09);
    border-radius: 13px;
    background: rgba(249,249,246,.88);
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.hps-sticky-order-option:hover {
    border-color: rgba(41,41,41,.2);
    background: rgba(255,255,255,.99);
    transform: translateY(-1px);
}
.hps-sticky-order-copy { min-width: 0; text-align: right; }
.hps-sticky-order-copy strong,
.hps-sticky-order-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hps-sticky-order-copy strong { color: #292929; font-size: 12px; font-weight: 900; }
.hps-sticky-order-copy span { margin-top: 2px; color: #55595b; font-size: 12px; font-weight: 800; }
.hps-sticky-order-button {
    min-height: 39px;
    padding: 7px 10px 7px 7px;
    font-size: 12px;
    white-space: nowrap;
    box-shadow: none;
}
.hps-sticky-order-button svg { width: 24px; height: 24px; }
.hps-sticky-order.is-dismissed { opacity: 0; transform: translateY(calc(100% + 35px)); }
.hps-sticky-order-reopen {
    position: fixed;
    z-index: 99921;
    right: 18px;
    bottom: 18px;
    display: inline-flex;
    min-height: 43px;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 999px;
    background: rgba(41,41,41,.93);
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    box-shadow: 0 12px 32px rgba(20,20,20,.22);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    cursor: pointer;
}
.hps-sticky-order-reopen svg { color: var(--hps-accent, #EDE621); }
.hps-product-detail-page.hps-sticky-order-active .hps-detail-page {
    padding-bottom: calc(var(--hps-sticky-height, 118px) + 28px);
}
@media (min-width: 768px) {
    .hps-sticky-no-desktop { display: none !important; }
}
@media (max-width: 767px) {
    .hps-sticky-no-mobile { display: none !important; }
    .hps-sticky-order {
        bottom: 0 !important;
        padding: 0;
    }
    .hps-sticky-order-shell {
        display: block;
        width: 100%;
        max-height: min(50vh, 430px);
        overflow: visible;
        margin: 0;
        padding: 10px 10px max(10px, env(safe-area-inset-bottom));
        border-width: 1px 0 0;
        border-radius: 18px 18px 0 0;
        background: rgba(255,255,255,.96);
        box-shadow: 0 -12px 34px rgba(22,22,22,.18);
    }
    .hps-sticky-order-heading {
        position: absolute;
        top: -14px;
        left: 10px;
        z-index: 2;
        display: block;
        padding: 0;
    }
    .hps-sticky-order-heading-copy { display: none; }
    .hps-sticky-order-close {
        width: 31px;
        height: 31px;
        border: 1px solid rgba(41,41,41,.10);
        background: #fff;
        box-shadow: 0 6px 18px rgba(20,20,20,.14);
    }
    .hps-sticky-order-options {
        display: grid;
        grid-template-columns: 1fr;
        gap: 7px;
        max-height: calc(min(50vh, 430px) - max(20px, env(safe-area-inset-bottom)));
        overflow-y: auto;
        padding: 0;
        scrollbar-width: thin;
    }
    .hps-sticky-order-option {
        width: 100%;
        min-width: 0;
        grid-template-columns: minmax(0, 1fr) minmax(118px, auto);
        gap: 8px;
        padding: 8px;
        border-radius: 12px;
    }
    .hps-sticky-order-copy strong { font-size: 11.5px; }
    .hps-sticky-order-copy span { font-size: 12px; }
    .hps-sticky-order-button {
        width: auto;
        min-width: 118px;
        min-height: 40px;
        justify-content: space-between;
        padding: 7px 9px 7px 7px;
    }
    .hps-sticky-order-reopen {
        right: 10px;
        bottom: max(8px, env(safe-area-inset-bottom));
    }
    .hps-product-detail-page.hps-sticky-order-active .hps-detail-page {
        padding-bottom: calc(var(--hps-sticky-height, 86px) + 18px);
    }
}
@media (max-width: 390px) {
    .hps-sticky-order-option { grid-template-columns: minmax(0, 1fr) 108px; }
    .hps-sticky-order-button { min-width: 108px; font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) {
    .hps-sticky-order, .hps-sticky-order-option, .hps-sticky-order-close { transition: none; }
}

/* ---- 3.8.4: pre-purchase review request (درخواست بررسی اولیه) ---- */
.hps-detail-consult {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px dashed rgba(41, 41, 41, .22);
    border-radius: 14px;
    background: #fff;
}
.hps-detail-consult p { margin: 0; color: #55595b; font-size: 12.5px; font-weight: 650; line-height: 1.95; }
.hps-detail-consult p strong { display: block; color: var(--hps-primary); font-size: 13.5px; font-weight: 900; }
.hps-detail-consult-button,
.hps-sticky-consult-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--hps-primary, #292929);
    border-radius: 11px;
    background: #fff;
    color: var(--hps-primary, #292929) !important;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
    transition: background .18s ease, transform .18s ease;
}
.hps-detail-consult-button { min-height: 44px; padding: 9px 14px; font-size: 13px; }
.hps-detail-consult-button svg { flex: 0 0 auto; }
.hps-detail-consult-button:hover,
.hps-sticky-consult-button:hover { background: var(--hps-accent, #EDE621); transform: translateY(-1px); }
.hps-sticky-order-actions { display: flex; align-items: center; gap: 7px; min-width: 0; }
.hps-sticky-order-actions form { margin: 0; }
.hps-sticky-consult-button { min-height: 39px; padding: 7px 11px; font-size: 12px; }
@media (max-width: 767px) {
    .hps-detail-consult { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .hps-detail-consult-button { width: 100%; }
    .hps-sticky-order-option { grid-template-columns: minmax(0, 1fr); }
    .hps-sticky-order-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .hps-sticky-order-actions .hps-sticky-order-button,
    .hps-sticky-order-actions form,
    .hps-sticky-order-actions form button { width: 100%; min-width: 0; }
    .hps-sticky-consult-button { min-height: 40px; }
}
@media (max-width: 390px) {
    .hps-sticky-order-option { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .hps-detail-consult-button, .hps-sticky-consult-button { transition: none; }
}
