/* AELAB Product Showcase — کارت سفید: تصویر + ابزارها روی تصویر؛ عنوان → گالری → مدل/توضیح؛ دکمه‌ها */

.aelab-ps {
    --aelab-ps-accent: #ef7b5f;
    --aelab-ps-wa: #075e54;
    --aelab-ps-mail: #007bb5;
    --aelab-ps-outline: #007bb5;
    --aelab-ps-radius: 10px;
    --aelab-ps-bg: #f3f4f6;
    --aelab-ps-title-color: #111827;
    box-sizing: border-box;
}

.aelab-ps *,
.aelab-ps *::before,
.aelab-ps *::after {
    box-sizing: border-box;
}

.aelab-ps-inner {
    display: grid;
    grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.22fr);
    gap: 16px;
    align-items: start;
    background: #fff;
    padding: 14px 16px 16px;
    border-radius: var(--aelab-ps-radius);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    border: 1px solid #e5e7eb;
}

.aelab-ps-media {
    position: relative;
}

.aelab-ps-logo {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    line-height: 0;
    max-width: 120px;
    max-height: 36px;
    pointer-events: none;
}

.aelab-ps-logo img {
    display: block;
    max-width: 120px;
    max-height: 36px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.aelab-ps-main {
    border: 1px solid #e5e7eb;
    border-radius: var(--aelab-ps-radius);
    background-color: #fff;
    overflow: hidden;
    /* موبایل؛ دسکتاپ ارتفاع با JS به .aelab-ps-content (تا ته دکمه‌ها) هم‌تراز می‌شود */
    aspect-ratio: 4 / 3;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aelab-ps-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background-color: #fff;
}

.aelab-ps-main video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.aelab-ps-main .aelab-ps-main-youtube {
    display: none;
    width: 100%;
    height: 100%;
    min-height: 0;
    align-self: stretch;
    background: #000;
}

.aelab-ps-title-row {
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #e5e7eb;
}

.aelab-ps-title {
    margin: 0;
    font-size: clamp(1rem, 2.8vw, 1.2rem);
    font-weight: 700;
    line-height: 1.35;
    color: var(--aelab-ps-title-color);
    text-align: start;
}

/* QR / favorite / copy — دو نسخه: overlay (موبایل روی تصویر) + inline (دسکتاپ کنار عنوان) */
.aelab-ps-tools {
    display: flex;
    pointer-events: auto;
    z-index: 4;
}

.aelab-ps-tools--overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.aelab-ps-tools--inline {
    display: none;
    position: relative;
    top: auto;
    right: auto;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.aelab-ps-tool {
    width: 34px;
    height: 34px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    color: #374151;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.aelab-ps button.aelab-ps-tool:hover,
.aelab-ps button.aelab-ps-tool:focus,
.aelab-ps button.aelab-ps-tool:focus-visible {
    background-color: #f3f4f6 !important;
    border-color: #d1d5db !important;
    color: #6b7280 !important;
    text-decoration: none !important;
}

/* آیکن‌ها از currentColor / fill استفاده می‌کنند؛ بدون این روی هاور «بی‌رنگ» می‌شوند */
.aelab-ps button.aelab-ps-tool:hover svg,
.aelab-ps button.aelab-ps-tool:focus svg,
.aelab-ps button.aelab-ps-tool:focus-visible svg {
    color: #6b7280;
}

.aelab-ps button.aelab-ps-tool--qr:hover svg,
.aelab-ps button.aelab-ps-tool--qr:focus svg,
.aelab-ps button.aelab-ps-tool--qr:focus-visible svg,
.aelab-ps button.aelab-ps-tool--favorite:hover svg,
.aelab-ps button.aelab-ps-tool--favorite:focus svg,
.aelab-ps button.aelab-ps-tool--favorite:focus-visible svg {
    fill: currentColor;
}

.aelab-ps button.aelab-ps-tool--copy:hover svg,
.aelab-ps button.aelab-ps-tool--copy:focus svg,
.aelab-ps button.aelab-ps-tool--copy:focus-visible svg {
    fill: none;
    stroke: currentColor;
}

/* بعد از کپی موفق: پس‌زمینه سبز ملایم + آیکن stroke سبز (اولویت بالاتر از :hover عمومی دکمه) */
.aelab-ps button.aelab-ps-tool--copy.aelab-ps-copied,
.aelab-ps button.aelab-ps-tool--copy.aelab-ps-copied:hover,
.aelab-ps button.aelab-ps-tool--copy.aelab-ps-copied:focus,
.aelab-ps button.aelab-ps-tool--copy.aelab-ps-copied:focus-visible {
    background-color: #ecfdf5 !important;
    border-color: #6ee7b7 !important;
    color: #059669 !important;
}

.aelab-ps button.aelab-ps-tool--copy.aelab-ps-copied svg,
.aelab-ps button.aelab-ps-tool--copy.aelab-ps-copied:hover svg,
.aelab-ps button.aelab-ps-tool--copy.aelab-ps-copied:focus svg,
.aelab-ps button.aelab-ps-tool--copy.aelab-ps-copied:focus-visible svg {
    fill: none !important;
    stroke: #059669 !important;
    color: #059669;
}

.aelab-ps-tool svg {
    width: 18px;
    height: 18px;
    display: block;
}

.aelab-ps-tool.is-favorited,
.aelab-ps-tool.is-favorited svg {
    color: #e74c3c;
    fill: #e74c3c;
}

.aelab-ps button.aelab-ps-tool.is-favorited:hover,
.aelab-ps button.aelab-ps-tool.is-favorited:focus,
.aelab-ps button.aelab-ps-tool.is-favorited:focus-visible {
    background-color: #fff !important;
    border-color: #fecaca !important;
    color: #e74c3c !important;
    text-decoration: none !important;
}

.aelab-ps button.aelab-ps-tool.is-favorited:hover {
    color: #c0392b !important;
}

.aelab-ps button.aelab-ps-tool.is-favorited:hover svg,
.aelab-ps button.aelab-ps-tool.is-favorited:focus svg,
.aelab-ps button.aelab-ps-tool.is-favorited:focus-visible svg {
    fill: currentColor;
}

.aelab-ps-models {
    margin: 14px 0 8px;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.45;
}

.aelab-ps-models .aelab-ps-models-label {
    font-weight: 600;
    margin-inline-end: 6px;
}

.aelab-ps-short {
    margin: 0 0 12px;
    font-size: 0.9rem;
    line-height: 1.55;
    color: #4b5563;
}

.aelab-ps-short p:last-child {
    margin-bottom: 0;
}

.aelab-ps-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 12px;
    margin-bottom: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.aelab-ps-thumb {
    width: 60px;
    height: 60px;
    padding: 0;
    border: 1px solid #dddddd;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background-color: #fff;
    flex: 0 0 auto;
    position: relative;
    /* بدون transition روی border تا بین تامب‌ها رنگ وسطی (قرمزگون) دیده نشود */
    transition: background-color 0.15s ease;
}

/* تامب انتخاب‌شده: بوردر نارنجی ۱px */
.aelab-ps .aelab-ps-thumb.is-active {
    border: 1px solid #f97316;
}

/* تم/ووکامرس: [type=button]:focus,:hover → #c36 — خنثی با !important */
.aelab-ps button.aelab-ps-thumb:hover:not(.is-active),
.aelab-ps button.aelab-ps-thumb:focus:not(.is-active),
.aelab-ps button.aelab-ps-thumb:focus-visible:not(.is-active) {
    background-color: #f3f4f6 !important;
    border-color: #d1d5db !important;
    color: #374151 !important;
    text-decoration: none !important;
}

.aelab-ps button.aelab-ps-thumb.is-active:hover,
.aelab-ps button.aelab-ps-thumb.is-active:focus,
.aelab-ps button.aelab-ps-thumb.is-active:focus-visible {
    background-color: #fff !important;
    border-color: #f97316 !important;
    color: #374151 !important;
    text-decoration: none !important;
}

.aelab-ps-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.aelab-ps-thumb-vid {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 48px;
    background: linear-gradient(135deg, #1f2937, #374151);
}

.aelab-ps-thumb--video:not(.aelab-ps-thumb--youtube)::after {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent rgba(255, 255, 255, 0.95);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
    pointer-events: none;
}

/* تامب ویدیوی YouTube (متا «YouTube Video URLs») */
.aelab-ps-thumb--youtube .aelab-ps-thumb-youtube {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 48px;
    background: linear-gradient(165deg, #c4c8d0 0%, #6b7280 42%, #374151 100%);
    pointer-events: none;
}

.aelab-ps-thumb-youtube-label {
    font-size: clamp(0.35rem, 0.9vw, 0.5rem);
    font-weight: 800;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.98);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
    line-height: 1.05;
    text-align: center;
    padding: 0 3px;
    margin-bottom: 4px;
    text-transform: none;
}

.aelab-ps-thumb-youtube-play {
    position: relative;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.88);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}

.aelab-ps-thumb-youtube-play::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-38%, -50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 6px 0 6px 10px;
    border-color: transparent transparent transparent #fff;
}

.aelab-ps-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: stretch;
    max-width: 100%;
    margin-top: 14px;
    /* فونت و پدینگ کمی فشرده‌تر + متن چندخطی بدون … */
    --aelab-ps-act-fs: clamp(0.56rem, 0.5vw + 0.48rem, 0.78rem);
    --aelab-ps-act-fs-wa: clamp(0.58rem, 0.55vw + 0.48rem, 0.82rem);
    --aelab-ps-act-pad-y: clamp(3px, 0.55vw, 6px);
    --aelab-ps-act-pad-x: clamp(3px, 0.65vw, 8px);
}

/* یک ردیف تمام‌عرض: پیشنهاد قیمت، outline، یا دکمهٔ سبد/استعلام */
.aelab-ps-actions > [data-ps-btn-type="primary"],
.aelab-ps-actions > [data-ps-btn-type="outline"],
.aelab-ps-actions > [data-ps-btn-type="inquiry"] {
    grid-column: 1 / -1;
}

.aelab-ps-actions .aelab-ps-btn,
.aelab-ps-actions a.aelab-ps-btn--whatsapp.custom-whatsapp-button {
    flex: unset;
    width: 100%;
    min-width: 0;
    justify-content: center;
    align-items: center;
    gap: clamp(2px, 0.45vw, 5px);
    white-space: normal;
    line-height: 1.2;
    text-align: center;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
}

.aelab-ps-actions a.aelab-ps-btn:not(.custom-whatsapp-button) {
    overflow: visible;
}

.aelab-ps-actions .aelab-ps-btn--inquiry .aelab-ps-btn-txt {
    min-width: 0;
    overflow: visible;
    white-space: normal;
}

/* انیمیشن پالس (فعال از تنظیمات هر دکمه در ریپیتر) — نام keyframes scoped تا با تم تداخل نکند */
@keyframes aelab-ps-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(107, 114, 128, 0.45);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(107, 114, 128, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(107, 114, 128, 0);
    }
}

.aelab-ps .aelab-ps-btn--pulse {
    animation: aelab-ps-pulse 1.5s infinite ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .aelab-ps .aelab-ps-btn--pulse {
        animation: none;
    }
}

.aelab-ps .aelab-ps-btn .aelab-ps-btn-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: block;
    object-fit: contain;
}

/* Raster icons: mask + fill color (Elementor «Icon color» per button type) */
.aelab-ps .aelab-ps-btn .aelab-ps-btn-icon--mask {
    object-fit: unset;
    background-color: currentcolor;
    -webkit-mask-image: var(--aelab-ps-icon-mask);
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-image: var(--aelab-ps-icon-mask);
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-mode: alpha;
    mask-mode: alpha;
}

/* Elementor Icons (wrapped in .aelab-ps-btn-icon--elementor) */
.aelab-ps .aelab-ps-btn .aelab-ps-btn-icon--elementor {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.aelab-ps .aelab-ps-btn .aelab-ps-btn-icon--elementor svg {
    width: 100%;
    height: 100%;
    display: block;
}

.aelab-ps .aelab-ps-btn .aelab-ps-btn-icon--elementor .elementor-icon {
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.aelab-ps .aelab-ps-btn .aelab-ps-btn-icon--elementor > i {
    font-size: 18px;
    line-height: 1;
}

.aelab-ps .aelab-ps-actions .aelab-ps-btn .aelab-ps-btn-icon {
    width: clamp(12px, 2vw, 16px);
    height: clamp(12px, 2vw, 16px);
}

.aelab-ps .aelab-ps-actions .aelab-ps-btn .aelab-ps-btn-icon--mask {
    width: clamp(12px, 2vw, 16px);
    height: clamp(12px, 2vw, 16px);
}

.aelab-ps .aelab-ps-actions .aelab-ps-btn .aelab-ps-btn-icon--elementor .elementor-icon {
    font-size: clamp(12px, 2vw, 16px);
}

.aelab-ps .aelab-ps-actions .aelab-ps-btn .aelab-ps-btn-icon--elementor > i {
    font-size: clamp(12px, 2vw, 16px);
}

.aelab-ps-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none !important;
    border: none;
    cursor: pointer;
    line-height: 1.2;
    letter-spacing: normal;
    text-transform: none;
    font-style: normal;
    transition: background 0.2s, border-color 0.2s, color 0.2s, opacity 0.2s, filter 0.2s;
}

.aelab-ps-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

.aelab-ps .aelab-ps-btn--primary,
.aelab-ps a.aelab-ps-btn--primary,
.aelab-ps button.aelab-ps-btn--primary {
    background-color: var(--aelab-ps-btn-primary-bg, var(--aelab-ps-accent)) !important;
    color: var(--aelab-ps-btn-primary-color, #fff) !important;
    border-width: var(--aelab-ps-btn-primary-bd-w, 0px);
    border-style: solid;
    border-color: var(--aelab-ps-btn-primary-bd-color, transparent);
}

.aelab-ps .aelab-ps-btn--whatsapp,
.aelab-ps a.aelab-ps-btn--whatsapp {
    background-color: var(--aelab-ps-btn-wa-bg, var(--aelab-ps-wa)) !important;
    color: var(--aelab-ps-btn-wa-color, #fff) !important;
    border-width: var(--aelab-ps-btn-wa-bd-w, 0px);
    border-style: solid;
    border-color: var(--aelab-ps-btn-wa-bd-color, transparent) !important;
}

.aelab-ps a.aelab-ps-btn--whatsapp.custom-whatsapp-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--aelab-ps-btn-wa-bg, var(--aelab-ps-wa)) !important;
    color: var(--aelab-ps-btn-wa-color, #fff) !important;
    border-width: var(--aelab-ps-btn-wa-bd-w, 0px);
    border-style: solid;
    border-color: var(--aelab-ps-btn-wa-bd-color, transparent) !important;
    border-radius: 12px;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.2;
    letter-spacing: normal;
    text-transform: none;
    font-style: normal;
    text-decoration: none !important;
    transition: background-color 0.3s ease, color 0.2s, border-color 0.2s, opacity 0.2s, filter 0.2s;
}

.aelab-ps a.aelab-ps-btn--whatsapp.custom-whatsapp-button .aelab-ps-btn-icon--mask.whatsapp-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: block;
}

.aelab-ps .aelab-ps-actions a.aelab-ps-btn--whatsapp.custom-whatsapp-button .aelab-ps-btn-icon--mask.whatsapp-icon {
    width: clamp(12px, 2vw, 16px);
    height: clamp(12px, 2vw, 16px);
}

/* نسخهٔ قدیمی HTML با <img> (قبل از ماسک) */
.aelab-ps a.aelab-ps-btn--whatsapp.custom-whatsapp-button img.whatsapp-icon,
.aelab-ps a.aelab-ps-btn--whatsapp.custom-whatsapp-button img.aelab-ps-btn-icon.whatsapp-icon {
    filter: brightness(0) invert(1);
}

/* بعد از استایل عمومی دکمه‌ها — ردیف actions با پدینگ/فونت فشرده و متن چندخطی */
.aelab-ps .aelab-ps-actions .aelab-ps-btn:not(.custom-whatsapp-button),
.aelab-ps .aelab-ps-actions button.aelab-ps-btn {
    padding: var(--aelab-ps-act-pad-y) var(--aelab-ps-act-pad-x);
    font-size: var(--aelab-ps-act-fs);
}

.aelab-ps .aelab-ps-actions a.aelab-ps-btn--whatsapp.custom-whatsapp-button {
    padding: var(--aelab-ps-act-pad-y) var(--aelab-ps-act-pad-x);
    font-size: var(--aelab-ps-act-fs-wa);
    font-weight: 400;
}

.aelab-ps .aelab-ps-btn--email,
.aelab-ps a.aelab-ps-btn--email,
.aelab-ps button.aelab-ps-btn--email {
    background-color: var(--aelab-ps-btn-email-bg, var(--aelab-ps-mail)) !important;
    color: var(--aelab-ps-btn-email-color, #fff) !important;
    border-width: var(--aelab-ps-btn-email-bd-w, 0px);
    border-style: solid;
    border-color: var(--aelab-ps-btn-email-bd-color, transparent);
}

.aelab-ps .aelab-ps-btn--outline,
.aelab-ps a.aelab-ps-btn--outline,
.aelab-ps button.aelab-ps-btn--outline {
    background-color: var(--aelab-ps-btn-outline-bg, #fff) !important;
    color: var(--aelab-ps-btn-outline-color, var(--aelab-ps-outline)) !important;
    border-width: var(--aelab-ps-btn-outline-bd-w, 1px);
    border-style: solid;
    border-color: var(--aelab-ps-btn-outline-bd-color, var(--aelab-ps-outline)) !important;
}

.aelab-ps .aelab-ps-btn--custom,
.aelab-ps a.aelab-ps-btn--custom,
.aelab-ps button.aelab-ps-btn--custom {
    background-color: var(--aelab-ps-btn-custom-bg, #374151) !important;
    color: var(--aelab-ps-btn-custom-color, #fff) !important;
    border-width: var(--aelab-ps-btn-custom-bd-w, 0px);
    border-style: solid;
    border-color: var(--aelab-ps-btn-custom-bd-color, transparent);
}

/* رنگ آیکن (ماسک، آیکن المنتور، ایموجی سبد خرید) */
.aelab-ps .aelab-ps-btn--primary .aelab-ps-btn-icon--mask,
.aelab-ps a.aelab-ps-btn--primary .aelab-ps-btn-icon--mask,
.aelab-ps button.aelab-ps-btn--primary .aelab-ps-btn-icon--mask {
    background-color: var(--aelab-ps-btn-primary-icon, var(--aelab-ps-btn-primary-color, #fff));
}

.aelab-ps .aelab-ps-btn--primary .aelab-ps-btn-icon--elementor,
.aelab-ps a.aelab-ps-btn--primary .aelab-ps-btn-icon--elementor,
.aelab-ps button.aelab-ps-btn--primary .aelab-ps-btn-icon--elementor {
    color: var(--aelab-ps-btn-primary-icon, var(--aelab-ps-btn-primary-color, #fff));
}

.aelab-ps .aelab-ps-btn--primary .aelab-ps-btn-icon--elementor svg,
.aelab-ps a.aelab-ps-btn--primary .aelab-ps-btn-icon--elementor svg,
.aelab-ps button.aelab-ps-btn--primary .aelab-ps-btn-icon--elementor svg {
    fill: currentcolor;
}

.aelab-ps .aelab-ps-btn--whatsapp .aelab-ps-btn-icon--mask,
.aelab-ps a.aelab-ps-btn--whatsapp .aelab-ps-btn-icon--mask {
    background-color: var(--aelab-ps-btn-wa-icon, var(--aelab-ps-btn-wa-color, #fff));
}

.aelab-ps .aelab-ps-btn--whatsapp .aelab-ps-btn-icon--elementor,
.aelab-ps a.aelab-ps-btn--whatsapp .aelab-ps-btn-icon--elementor {
    color: var(--aelab-ps-btn-wa-icon, var(--aelab-ps-btn-wa-color, #fff));
}

.aelab-ps .aelab-ps-btn--whatsapp .aelab-ps-btn-icon--elementor svg,
.aelab-ps a.aelab-ps-btn--whatsapp .aelab-ps-btn-icon--elementor svg {
    fill: currentcolor;
}

.aelab-ps .aelab-ps-btn--email .aelab-ps-btn-icon--mask,
.aelab-ps a.aelab-ps-btn--email .aelab-ps-btn-icon--mask {
    background-color: var(--aelab-ps-btn-email-icon, var(--aelab-ps-btn-email-color, #fff));
}

.aelab-ps .aelab-ps-btn--email .aelab-ps-btn-icon--elementor,
.aelab-ps a.aelab-ps-btn--email .aelab-ps-btn-icon--elementor {
    color: var(--aelab-ps-btn-email-icon, var(--aelab-ps-btn-email-color, #fff));
}

.aelab-ps .aelab-ps-btn--email .aelab-ps-btn-icon--elementor svg,
.aelab-ps a.aelab-ps-btn--email .aelab-ps-btn-icon--elementor svg {
    fill: currentcolor;
}

.aelab-ps .aelab-ps-btn--outline .aelab-ps-btn-icon--mask,
.aelab-ps a.aelab-ps-btn--outline .aelab-ps-btn-icon--mask,
.aelab-ps button.aelab-ps-btn--outline .aelab-ps-btn-icon--mask {
    background-color: var(--aelab-ps-btn-outline-icon, var(--aelab-ps-btn-outline-color, var(--aelab-ps-outline, #007bb5)));
}

.aelab-ps .aelab-ps-btn--outline .aelab-ps-btn-icon--elementor,
.aelab-ps a.aelab-ps-btn--outline .aelab-ps-btn-icon--elementor,
.aelab-ps button.aelab-ps-btn--outline .aelab-ps-btn-icon--elementor {
    color: var(--aelab-ps-btn-outline-icon, var(--aelab-ps-btn-outline-color, var(--aelab-ps-outline, #007bb5)));
}

.aelab-ps .aelab-ps-btn--outline .aelab-ps-btn-icon--elementor svg,
.aelab-ps a.aelab-ps-btn--outline .aelab-ps-btn-icon--elementor svg,
.aelab-ps button.aelab-ps-btn--outline .aelab-ps-btn-icon--elementor svg {
    fill: currentcolor;
}

.aelab-ps .aelab-ps-btn--custom .aelab-ps-btn-icon--mask,
.aelab-ps a.aelab-ps-btn--custom .aelab-ps-btn-icon--mask {
    background-color: var(--aelab-ps-btn-custom-icon, var(--aelab-ps-btn-custom-color, #fff));
}

.aelab-ps .aelab-ps-btn--custom .aelab-ps-btn-icon--elementor,
.aelab-ps a.aelab-ps-btn--custom .aelab-ps-btn-icon--elementor {
    color: var(--aelab-ps-btn-custom-icon, var(--aelab-ps-btn-custom-color, #fff));
}

.aelab-ps .aelab-ps-btn--custom .aelab-ps-btn-icon--elementor svg,
.aelab-ps a.aelab-ps-btn--custom .aelab-ps-btn-icon--elementor svg {
    fill: currentcolor;
}

.aelab-ps .aelab-ps-btn--inquiry .aelab-ps-btn-icon--mask,
.aelab-ps button.aelab-ps-btn--inquiry .aelab-ps-btn-icon--mask {
    background-color: var(--aelab-ps-btn-outline-icon, var(--aelab-ps-btn-outline-color, var(--aelab-ps-outline, #007bb5)));
}

.aelab-ps .aelab-ps-btn--inquiry .aelab-ps-btn-icon--elementor,
.aelab-ps button.aelab-ps-btn--inquiry .aelab-ps-btn-icon--elementor {
    color: var(--aelab-ps-btn-outline-icon, var(--aelab-ps-btn-outline-color, var(--aelab-ps-outline, #007bb5)));
}

.aelab-ps .aelab-ps-btn--inquiry .aelab-ps-btn-icon--elementor svg,
.aelab-ps button.aelab-ps-btn--inquiry .aelab-ps-btn-icon--elementor svg {
    fill: currentcolor;
}

.aelab-ps .aelab-ps-btn--inquiry .aelab-ps-btn-cart:not(.aelab-ps-btn-cart--custom),
.aelab-ps button.aelab-ps-btn--inquiry .aelab-ps-btn-cart:not(.aelab-ps-btn-cart--custom) {
    color: var(--aelab-ps-btn-outline-icon, var(--aelab-ps-btn-outline-color, var(--aelab-ps-outline, #007bb5)));
}

/* غلبه بر button:hover/focus تم (مثلاً #c36) — همان رنگ‌های تب استایل + کمی روشن/تیره */
.aelab-ps a.aelab-ps-btn--primary:hover,
.aelab-ps a.aelab-ps-btn--primary:focus,
.aelab-ps a.aelab-ps-btn--primary:focus-visible,
.aelab-ps button.aelab-ps-btn--primary:hover,
.aelab-ps button.aelab-ps-btn--primary:focus,
.aelab-ps button.aelab-ps-btn--primary:focus-visible {
    background-color: var(--aelab-ps-btn-primary-bg, var(--aelab-ps-accent)) !important;
    color: var(--aelab-ps-btn-primary-color, #fff) !important;
    border-color: var(--aelab-ps-btn-primary-bd-color, transparent) !important;
    text-decoration: none !important;
    opacity: 1;
    filter: brightness(0.94);
}

.aelab-ps a.aelab-ps-btn--outline:hover,
.aelab-ps a.aelab-ps-btn--outline:focus,
.aelab-ps a.aelab-ps-btn--outline:focus-visible,
.aelab-ps button.aelab-ps-btn--outline:hover,
.aelab-ps button.aelab-ps-btn--outline:focus,
.aelab-ps button.aelab-ps-btn--outline:focus-visible {
    background-color: var(--aelab-ps-btn-outline-bg, #fff) !important;
    color: var(--aelab-ps-btn-outline-color, var(--aelab-ps-outline)) !important;
    border-color: var(--aelab-ps-btn-outline-bd-color, var(--aelab-ps-outline)) !important;
    text-decoration: none !important;
    opacity: 1;
    filter: brightness(0.96);
}

.aelab-ps a.aelab-ps-btn--custom:hover,
.aelab-ps a.aelab-ps-btn--custom:focus,
.aelab-ps a.aelab-ps-btn--custom:focus-visible,
.aelab-ps button.aelab-ps-btn--custom:hover,
.aelab-ps button.aelab-ps-btn--custom:focus,
.aelab-ps button.aelab-ps-btn--custom:focus-visible {
    background-color: var(--aelab-ps-btn-custom-bg, #374151) !important;
    color: var(--aelab-ps-btn-custom-color, #fff) !important;
    border-color: var(--aelab-ps-btn-custom-bd-color, transparent) !important;
    text-decoration: none !important;
    opacity: 1;
    filter: brightness(0.94);
}

.aelab-ps a.aelab-ps-btn--whatsapp.custom-whatsapp-button:hover,
.aelab-ps a.aelab-ps-btn--whatsapp.custom-whatsapp-button:focus,
.aelab-ps a.aelab-ps-btn--whatsapp.custom-whatsapp-button:focus-visible {
    background-color: var(--aelab-ps-btn-wa-bg, var(--aelab-ps-wa)) !important;
    color: var(--aelab-ps-btn-wa-color, #fff) !important;
    border-color: var(--aelab-ps-btn-wa-bd-color, transparent) !important;
    text-decoration: none !important;
    opacity: 1;
    filter: brightness(1.06);
}

.aelab-ps .aelab-ps-btn--whatsapp:hover,
.aelab-ps .aelab-ps-btn--whatsapp:focus,
.aelab-ps .aelab-ps-btn--whatsapp:focus-visible {
    background-color: var(--aelab-ps-btn-wa-bg, var(--aelab-ps-wa)) !important;
    color: var(--aelab-ps-btn-wa-color, #fff) !important;
    border-color: var(--aelab-ps-btn-wa-bd-color, transparent) !important;
    filter: brightness(1.06);
}

.aelab-ps a.aelab-ps-btn--email:hover,
.aelab-ps a.aelab-ps-btn--email:focus,
.aelab-ps a.aelab-ps-btn--email:focus-visible,
.aelab-ps button.aelab-ps-btn--email:hover,
.aelab-ps button.aelab-ps-btn--email:focus,
.aelab-ps button.aelab-ps-btn--email:focus-visible {
    background-color: var(--aelab-ps-btn-email-bg, var(--aelab-ps-mail)) !important;
    color: var(--aelab-ps-btn-email-color, #fff) !important;
    border-color: var(--aelab-ps-btn-email-bd-color, transparent) !important;
    text-decoration: none !important;
    opacity: 1;
    filter: brightness(0.94);
}

/* قفل تایپوگرافی روی هاور تا تم font-size / font-weight / underline عوض نکند */
.aelab-ps-actions .aelab-ps-btn:hover,
.aelab-ps-actions .aelab-ps-btn:focus,
.aelab-ps-actions .aelab-ps-btn:focus-visible {
    font-size: var(--aelab-ps-act-fs);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: normal;
    text-transform: none;
    font-style: normal;
    text-decoration: none !important;
    transform: none;
    box-shadow: none;
}

.aelab-ps-actions a.aelab-ps-btn--whatsapp.custom-whatsapp-button:hover,
.aelab-ps-actions a.aelab-ps-btn--whatsapp.custom-whatsapp-button:focus,
.aelab-ps-actions a.aelab-ps-btn--whatsapp.custom-whatsapp-button:focus-visible {
    font-size: var(--aelab-ps-act-fs-wa);
    font-weight: 400;
}

.aelab-ps-actions .aelab-ps-btn--inquiry:hover .aelab-ps-btn-txt,
.aelab-ps-actions .aelab-ps-btn--inquiry:focus .aelab-ps-btn-txt,
.aelab-ps-actions .aelab-ps-btn--inquiry:focus-visible .aelab-ps-btn-txt,
.aelab-ps-actions .aelab-ps-btn--inquiry:hover .aelab-ps-btn-cart,
.aelab-ps-actions .aelab-ps-btn--inquiry:focus .aelab-ps-btn-cart,
.aelab-ps-actions .aelab-ps-btn--inquiry:focus-visible .aelab-ps-btn-cart {
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    font-style: inherit;
}

/* آیکن سفارشی جای ایموجی سبد — همان سمت راست متن (در LTR) */
.aelab-ps .aelab-ps-btn--inquiry .aelab-ps-btn-cart--custom {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.aelab-ps-editor-note {
    padding: 16px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    color: #92400e;
    font-size: 14px;
}

.aelab-ps-qr-overlay {
    position: fixed;
    inset: 0;
    z-index: 100050;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.aelab-ps-qr-overlay.aelab-ps-qr-active {
    opacity: 1;
}

.aelab-ps-qr-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    border-radius: 10px;
    padding: 12px 16px 20px;
    max-width: 96vw;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
}

/* ردیف بالا: فقط دکمه بستن داخل حاشیه سفید کارت (روی QR نمی‌افتد) */
.aelab-ps-qr-chrome {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 0 4px;
}

.aelab-ps-qr-close {
    position: static;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #4b5563;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.aelab-ps-qr-close:hover,
.aelab-ps-qr-close:focus-visible {
    background: #f3f4f6;
    color: #111827;
    border-color: #d1d5db;
}

.aelab-ps-qr-close:focus-visible {
    outline: 2px solid rgba(15, 23, 42, 0.2);
    outline-offset: 2px;
}

/* حاشیه سفید دور تصویر QR — دکمه ضربدر بیرون این بلوک است */
.aelab-ps-qr-frame {
    flex: 0 0 auto;
    align-self: center;
    margin: 0 auto;
    padding: 14px;
    background: #fff;
    border-radius: 8px;
    box-sizing: border-box;
    box-shadow: inset 0 0 0 1px #e5e7eb;
}

.aelab-ps-qr-code {
    line-height: 0;
}

.aelab-ps-qr-code img {
    display: block;
}

.aelab-ps-qr-title {
    text-align: center;
    margin-top: 14px;
    font-size: 14px;
    color: #374151;
}

/*
 * دسکتاپ (≥769px): بدون پس‌زمینه/بوردر کارت؛ ابزارها افقی کنار عنوان؛
 * ترتیب ستون راست: عنوان → مدل → توضیح کوتاه → گالری → دکمه‌ها.
 */
@media (min-width: 769px) {
    .aelab-ps-inner {
        display: grid;
        grid-template-columns: minmax(0, 0.88fr) minmax(0, 1.22fr);
        gap: 20px;
        align-items: start;
        background: transparent;
        border: none;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
    }

    .aelab-ps-content {
        display: flex;
        flex-direction: column;
        min-width: 0;
        gap: 0;
    }

    .aelab-ps-title-row {
        order: 1;
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
    }

    .aelab-ps-models {
        order: 2;
        margin-top: 12px;
    }

    .aelab-ps-short {
        order: 3;
        margin-top: 0;
        margin-bottom: 12px;
        padding-top: 0;
        border-top: none;
    }

    .aelab-ps-thumbs {
        order: 4;
        margin-top: 14px;
        padding-top: 12px;
        border-top: 1px solid #e5e7eb;
    }

    .aelab-ps-actions {
        order: 5;
        display: grid !important;
        grid-template-columns: 1fr 1fr;
    }

    .aelab-ps-tools--overlay {
        display: none !important;
    }

    .aelab-ps-tools--inline {
        display: flex !important;
    }

    .aelab-ps-title {
        flex: 1 1 auto;
        min-width: 0;
        font-size: clamp(1.05rem, 0.85vw + 0.75rem, 1.35rem);
    }
}

/* موبایل: یک ستون؛ ردیف اول تصویر، ردیف دوم محتوا */
@media (max-width: 768px) {
    .aelab-ps-inner {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: 14px;
    }

    .aelab-ps-media {
        max-width: 100%;
        margin: 0;
        width: 100%;
    }

    .aelab-ps-tools--inline {
        display: none !important;
    }

    .aelab-ps-tools--overlay {
        display: flex;
    }

    /* CTA: حداقل ~۴۸px ارتفاع لمسی، فونت خوانا (جایگزین clamp فشردهٔ دسکتاپ) */
    .aelab-ps .aelab-ps-actions {
        gap: 10px;
        --aelab-ps-act-fs: 0.9375rem;
        --aelab-ps-act-fs-wa: 0.9375rem;
        --aelab-ps-act-pad-y: 12px;
        --aelab-ps-act-pad-x: 14px;
    }

    .aelab-ps .aelab-ps-actions .aelab-ps-btn:not(.custom-whatsapp-button),
    .aelab-ps .aelab-ps-actions button.aelab-ps-btn {
        min-height: 48px;
        box-sizing: border-box;
    }

    .aelab-ps .aelab-ps-actions a.aelab-ps-btn--whatsapp.custom-whatsapp-button {
        min-height: 48px;
        box-sizing: border-box;
    }

    .aelab-ps .aelab-ps-actions .aelab-ps-btn .aelab-ps-btn-icon,
    .aelab-ps .aelab-ps-actions .aelab-ps-btn .aelab-ps-btn-icon--mask {
        width: 20px;
        height: 20px;
    }

    .aelab-ps .aelab-ps-actions .aelab-ps-btn .aelab-ps-btn-icon--elementor .elementor-icon,
    .aelab-ps .aelab-ps-actions .aelab-ps-btn .aelab-ps-btn-icon--elementor > i {
        font-size: 20px;
    }

    .aelab-ps .aelab-ps-actions a.aelab-ps-btn--whatsapp.custom-whatsapp-button .aelab-ps-btn-icon--mask.whatsapp-icon {
        width: 20px;
        height: 20px;
    }

    /*
     * Product Showcase + Download: one continuous white panel (mobile).
     * Classes aelab-ps-dl-merge-* are set by showcase-download-merge-widget.js.
     * White surface + border live on .elementor-widget-container; inner blocks go transparent.
     * Inline margin-top on the download widget pulls it up over column/widget gaps (measured in JS).
     */
    .elementor-element.aelab-ps-dl-merge-showcase {
        margin-bottom: 0 !important;
    }

    .elementor-element.aelab-ps-dl-merge-showcase > .elementor-widget-container {
        margin-bottom: 0;
        padding-bottom: 0;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-bottom: none;
        border-radius: var(--aelab-ps-radius, 10px) var(--aelab-ps-radius, 10px) 0 0;
        box-shadow: none;
    }

    .elementor-element.aelab-ps-dl-merge-showcase .aelab-ps-inner {
        background: transparent;
        border: none;
        box-shadow: none;
        border-radius: 0;
    }

    .elementor-element.aelab-ps-dl-merge-target {
        margin-bottom: 0 !important;
    }

    .elementor-element.aelab-ps-dl-merge-target > .elementor-widget-container {
        margin-top: 0;
        padding-top: 0;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-top: none;
        border-radius: 0 0 var(--aelab-ps-radius, 10px) var(--aelab-ps-radius, 10px);
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
    }

    .elementor-element.aelab-ps-dl-merge-target .aelab-dl-stack {
        gap: 12px;
    }

    .elementor-element.aelab-ps-dl-merge-target .aelab-dl-stack > .product-download-buttons {
        margin: 0 !important;
    }

    .elementor-element.aelab-ps-dl-merge-target .product-download-buttons.aelab-style-compact_list {
        margin: 0 0 16px !important;
    }

    .elementor-element.aelab-ps-dl-merge-target .aelab-dl-compact {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 12px 16px 16px;
    }

    .elementor-element.aelab-ps-dl-merge-target .aelab-dl-compact-heading {
        border-bottom-color: #e5e7eb;
    }

    .elementor-element.aelab-ps-dl-merge-target .aelab-dl-compact-li {
        border-bottom-color: #e5e7eb;
    }

    .elementor-element.aelab-ps-dl-merge-target .product-download-buttons.aelab-style-classic {
        margin: 0 0 16px !important;
        padding: 12px 16px 16px;
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
}
