/* پاپ‌آپ گوشه: ارزیابی پایین چپ، بله پایین راست */

.corner-promos {
    position: fixed;
    z-index: 1040;
    pointer-events: none;
    inset: auto auto 0 0;
    width: 0;
    height: 0;
}

.corner-promo {
    position: fixed;
    bottom: calc(0.75rem + var(--corner-stack-offset, 0px) + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: min(20.5rem, calc(100vw - 1.5rem));
    pointer-events: auto;
    transition: bottom 0.25s ease, opacity 0.2s ease, transform 0.25s ease;
}

.corner-promo--eval {
    left: max(0.75rem, env(safe-area-inset-left, 0px));
    right: auto;
    align-items: flex-start;
}

.corner-promo--bale {
    left: auto;
    right: max(0.75rem, env(safe-area-inset-right, 0px));
    align-items: flex-end;
}

.corner-promo.is-hidden {
    display: none !important;
}

.corner-promo__fab {
    display: none;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(15, 23, 42, 0.06);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.corner-promo__fab:hover,
.corner-promo__fab:focus-visible {
    transform: scale(1.06);
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.22);
}

.corner-promo__fab:focus-visible {
    outline: 2px solid var(--color-primary, #0d6efd);
    outline-offset: 2px;
}

.corner-promo__fab-img {
    width: 1.75rem;
    height: 1.75rem;
    object-fit: contain;
    border-radius: 0.35rem;
}

.corner-promo__fab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-size: 1.35rem;
    color: #fff;
}

.corner-promo__fab-icon--eval {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--color-primary, #0c2e60);
    color: var(--color-on-primary, #fff);
}

.corner-promo--bale .corner-promo__fab {
    background: #ecfdf5;
    box-shadow: 0 6px 22px rgba(22, 163, 74, 0.22);
}

.corner-promo.is-minimized .corner-promo__fab {
    display: flex;
}

.corner-promo.is-minimized .corner-promo__panel {
    display: none;
}

.corner-promo__panel {
    position: relative;
    width: min(18.5rem, calc(100vw - 1.5rem));
    padding: 1rem 1rem 0.85rem;
    border-radius: 1rem;
    background: #fff;
    color: #1e293b;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.16), 0 0 0 1px rgba(15, 23, 42, 0.06);
    animation: corner-promo-in 0.35s ease;
}

@keyframes corner-promo-in {
    from {
        opacity: 0;
        transform: translateY(0.75rem) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.corner-promo__close {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.corner-promo__close:hover,
.corner-promo__close:focus-visible {
    background: #e2e8f0;
    color: #0f172a;
}

.corner-promo__head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.5rem;
    padding-left: 1.75rem;
}

.corner-promo__panel-img {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    object-fit: contain;
    border-radius: 0.4rem;
}

.corner-promo__panel-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.55rem;
    font-size: 1.1rem;
    color: #fff;
    background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
}

/* ─── ارزیابی هوشمند — مینیمال و هم‌رنگ برند ─── */
.corner-promo--eval .corner-promo__fab--eval-text {
    display: flex;
    width: auto;
    height: auto;
    min-height: 2.5rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm, 10px);
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
    color: var(--color-on-primary, #fff);
    background: var(--color-primary, #0c2e60);
    box-shadow: 0 5px 18px rgba(12, 46, 96, 0.24);
}

.corner-promo--eval .corner-promo__fab--eval-text:hover,
.corner-promo--eval .corner-promo__fab--eval-text:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(12, 46, 96, 0.26);
}

.corner-promo--eval .corner-promo__close {
    top: 0.4rem;
    inset-inline-start: 0.4rem;
    inset-inline-end: auto;
    left: auto;
    right: auto;
    width: 1.35rem;
    height: 1.35rem;
    font-size: 0.65rem;
}

.corner-promo--eval .corner-promo__panel--eval,
.corner-promo--eval .corner-promo__panel {
    width: min(18.5rem, calc(100vw - 1.25rem));
    padding: 0.75rem 0.75rem 0.7rem;
    border: 1px solid rgba(12, 46, 96, 0.1);
    background: linear-gradient(165deg, #f4f7fb 0%, #fff 55%);
    box-shadow: 0 10px 36px rgba(12, 46, 96, 0.12);
    direction: rtl;
    text-align: right;
}

.corner-promo__head--eval {
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.45rem;
    padding-inline-start: 1.35rem;
    padding-inline-end: 0;
    padding-left: 0;
}

.corner-promo--eval .corner-promo__panel-icon--eval {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-size: 1.15rem;
    line-height: 1;
    color: var(--color-primary, #0c2e60);
    background: rgba(12, 46, 96, 0.08);
    border: 1px solid rgba(12, 46, 96, 0.1);
}

.corner-promo__head-text {
    flex: 1;
    min-width: 0;
    text-align: right;
}

.corner-promo__eyebrow {
    margin: 0 0 0.15rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-primary-light, #2e65a5);
    letter-spacing: 0.01em;
}

.corner-promo--eval .corner-promo__title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--color-heading, #0c2e60);
    line-height: 1.3;
}

.corner-promo__text--eval {
    margin-bottom: 0.55rem;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--color-text-muted, #555);
    text-align: right;
}

.corner-promo__cta--eval {
    display: block;
    width: 100%;
    min-height: 0;
    padding: 0.42rem 0.55rem;
    border-radius: var(--radius-sm, 8px);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: right;
    text-decoration: none !important;
    white-space: nowrap;
    color: var(--color-on-primary, #fff) !important;
    background: var(--color-primary, #0c2e60);
    box-shadow: 0 2px 10px rgba(12, 46, 96, 0.18);
    box-sizing: border-box;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.corner-promo__cta--eval:hover,
.corner-promo__cta--eval:focus-visible {
    color: var(--color-on-primary, #fff) !important;
    text-decoration: none !important;
    background: var(--color-primary-dark, #002147);
    box-shadow: 0 4px 12px rgba(12, 46, 96, 0.24);
    transform: translateY(-1px);
    filter: none;
}

.corner-promo--eval .corner-promo__dismiss {
    justify-content: flex-start;
    margin-top: 0.4rem;
    font-size: 0.68rem;
    text-align: right;
}

.corner-promo__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
}

.corner-promo__text {
    margin: 0 0 0.75rem;
    font-size: 0.82rem;
    line-height: 1.55;
    color: #475569;
}

.corner-promo__cta {
    display: block;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 0.55rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    color: #fff;
    background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
    transition: filter 0.15s ease, transform 0.15s ease;
}

.corner-promo__cta:hover,
.corner-promo__cta:focus-visible {
    color: #fff;
    filter: brightness(1.06);
    transform: translateY(-1px);
}

/* ─── کانال بله — گوشه راست ─── */
.corner-promo--bale .corner-promo__close {
    top: 0.4rem;
    inset-inline-start: 0.4rem;
    inset-inline-end: auto;
    left: auto;
    right: auto;
    width: 1.35rem;
    height: 1.35rem;
    font-size: 0.65rem;
}

.corner-promo--bale .corner-promo__panel--bale,
.corner-promo--bale .corner-promo__panel {
    width: min(18.5rem, calc(100vw - 1.25rem));
    padding: 0.75rem 0.75rem 0.7rem;
    border: 1px solid rgba(22, 163, 74, 0.14);
    background: linear-gradient(165deg, #f0fdf4 0%, #fff 55%);
    box-shadow: 0 10px 36px rgba(22, 101, 52, 0.12);
    direction: rtl;
    text-align: right;
}

.corner-promo__head--bale {
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.45rem;
    padding-inline-start: 1.35rem;
    padding-inline-end: 0;
    padding-left: 0;
}

.corner-promo__eyebrow--bale {
    color: #15803d;
}

.corner-promo--bale .corner-promo__title {
    color: #14532d;
}

.corner-promo__text--bale {
    margin-bottom: 0.55rem;
    font-size: 0.75rem;
    line-height: 1.5;
    text-align: right;
}

.corner-promo__cta--bale {
    display: block;
    width: 100%;
    min-height: 0;
    padding: 0.42rem 0.55rem;
    border-radius: var(--radius-sm, 8px);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: right;
    text-decoration: none !important;
    white-space: nowrap;
    color: #fff !important;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    box-shadow: 0 2px 10px rgba(22, 101, 52, 0.18);
    box-sizing: border-box;
    transition: filter 0.15s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.corner-promo__cta--bale:hover,
.corner-promo__cta--bale:focus-visible {
    color: #fff !important;
    text-decoration: none !important;
    filter: brightness(1.05);
    box-shadow: 0 4px 12px rgba(22, 101, 52, 0.24);
    transform: translateY(-1px);
}

.corner-promo--bale .corner-promo__dismiss {
    justify-content: flex-start;
    margin-top: 0.4rem;
    font-size: 0.68rem;
    text-align: right;
}

.corner-promo__dismiss {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.65rem 0 0;
    font-size: 0.75rem;
    color: #64748b;
    cursor: pointer;
    user-select: none;
}

.corner-promo__dismiss input {
    margin: 0;
    cursor: pointer;
}

@media (max-width: 480px) {
    .corner-promo--eval {
        left: max(0.5rem, env(safe-area-inset-left, 0px));
        bottom: calc(0.5rem + var(--corner-stack-offset, 0px) + env(safe-area-inset-bottom, 0px));
        max-width: calc(100vw - 1rem);
    }

    .corner-promo--bale {
        right: max(0.5rem, env(safe-area-inset-right, 0px));
        bottom: calc(0.5rem + var(--corner-stack-offset, 0px) + env(safe-area-inset-bottom, 0px));
        max-width: calc(100vw - 1rem);
    }

    .corner-promo--eval .corner-promo__panel {
        width: min(20.5rem, calc(100vw - 1rem));
    }

    .corner-promo--bale .corner-promo__panel {
        width: min(19.5rem, calc(100vw - 1rem));
    }

    .corner-promo--eval .corner-promo__fab--eval-text {
        font-size: 0.74rem;
        min-height: 2.35rem;
        padding: 0.45rem 0.7rem;
    }

}

@media (prefers-reduced-motion: reduce) {
    .corner-promo__panel {
        animation: none;
    }

    .corner-promo,
    .corner-promo__fab,
    .corner-promo__cta {
        transition: none;
    }
}
