/* پاپ آپ محصولات منتخب صفحه اصلی (فیلد ShowInPopup_bit) */

.offer-popup {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    direction: rtl;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
    font-family: inherit;
}

.offer-popup.is-visible {
    opacity: 1;
    visibility: visible;
}

.offer-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, .55);
}

.offer-popup__box {
    position: relative;
    width: min(430px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 16px 14px 14px;
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .3);
    transform: translateY(18px) scale(.96);
    transition: transform .3s cubic-bezier(.2, .9, .25, 1);
}

.offer-popup.is-visible .offer-popup__box {
    transform: translateY(0) scale(1);
}

.offer-popup__close {
    position: absolute;
    top: 8px;
    inset-inline-start: 8px;
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, .06);
    color: #6b7280;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, color .2s ease;
}

.offer-popup__close:hover,
.offer-popup__close:focus-visible {
    background: rgba(239, 68, 68, .15);
    color: #ef4444;
    outline: none;
}

.offer-popup__title {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
    color: #c2410c;
}

.offer-popup__products {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.offer-card {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 24px 7px 7px;
    border-radius: 16px;
    background: linear-gradient(170deg, #ff9243 0%, #f2620f 100%);
    box-shadow: 0 8px 18px rgba(242, 98, 15, .28);
}

.offer-card__badge {
    position: absolute;
    top: -6px;
    inset-inline-end: -4px;
    padding: 3px 9px;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #1f2937;
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1.6;
    transform: rotate(-8deg);
    white-space: nowrap;
}

.offer-card__image {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}

.offer-card__image img {
    display: block;
    width: 100%;
    height: 66px;
    object-fit: contain;
}

.offer-card__title {
    margin: 7px 0 8px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.7;
    text-align: center;
    color: #ffffff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.offer-card__title a {
    color: inherit;
    text-decoration: none;
}

.offer-card__prices {
    margin-top: auto;
    padding: 5px 4px;
    border-radius: 10px;
    background: #ffffff;
    text-align: center;
}

.offer-card__price {
    font-size: 12px;
    font-weight: 800;
    color: #111827;
}

.offer-card__price small {
    font-size: 9px;
    font-weight: 500;
    color: #6b7280;
}

.offer-card__old-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 2px;
    font-size: 10px;
    color: #9ca3af;
}

.offer-card__percent {
    padding: 1px 4px;
    border-radius: 4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 9px;
    font-weight: 700;
}

.offer-popup__desc {
    margin: 14px 0;
    font-size: 12.5px;
    line-height: 1.9;
    text-align: center;
    color: #374151;
}

.offer-popup__actions {
    display: flex;
    gap: 8px;
}

.offer-popup__dismiss,
.offer-popup__cta {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 8px;
    border: 0;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.offer-popup__dismiss {
    background: #f1f2f4;
    color: #374151;
}

.offer-popup__dismiss:hover {
    background: #e5e7eb;
}

.offer-popup__cta {
    background: linear-gradient(90deg, #ff6a00 0%, #ff9243 100%);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(255, 106, 0, .32);
}

.offer-popup__cta:hover {
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(255, 106, 0, .38);
}

@media (max-width: 420px) {
    .offer-popup {
        padding: 10px;
    }

    .offer-popup__box {
        padding: 14px 10px 12px;
        border-radius: 18px;
    }

    .offer-popup__products {
        gap: 7px;
    }

    .offer-card {
        padding: 22px 5px 6px;
        border-radius: 14px;
    }

    .offer-card__image img {
        height: 56px;
    }

    .offer-card__title {
        font-size: 10px;
    }

    .offer-card__price {
        font-size: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .offer-popup,
    .offer-popup__box,
    .offer-popup__cta,
    .offer-popup__close {
        transition: none;
    }
}

/* صفحه /popup-products با حالت شگفت‌انگیز (نارنجی، هماهنگ با پاپ‌آپ) */
.popup-products-page {
    position: relative;
    margin: -4px -4px 0;
    padding: 14px 14px 8px;
    border: 3px solid #f2620f;
    border-radius: 22px;
    background: linear-gradient(180deg, #fff7ed 0%, #ffffff 140px);
    box-shadow: 0 0 0 4px rgba(242, 98, 15, .12), 0 18px 40px rgba(242, 98, 15, .14);
}

.popup-products-page::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 19px;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .75);
}

.popup-products-page__header {
    position: relative;
    margin: 0 0 16px;
    padding: 14px 16px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, #ff9243 0%, #f2620f 55%, #ff6a00 100%);
    color: #ffffff;
    text-align: center;
    box-shadow: 0 10px 22px rgba(242, 98, 15, .28);
    overflow: hidden;
}

.popup-products-page__header::after {
    content: "";
    position: absolute;
    top: -30px;
    inset-inline-end: -20px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .14);
    pointer-events: none;
}

.popup-products-page__badge {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 14px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-radius: 999px;
    background: #1f2937;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.7;
    box-shadow: 0 4px 10px rgba(15, 23, 42, .2);
}

.popup-products-page__title {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.5;
    color: #ffffff;
}

.popup-products-page__subtitle {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.8;
    color: rgba(255, 255, 255, .92);
}

.popup-products-page .ticket-card {
    border: 2px solid #ffd7b5;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(242, 98, 15, .08);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.popup-products-page .ticket-card:hover {
    border-color: #ff9243;
    box-shadow: 0 14px 28px rgba(242, 98, 15, .16);
    transform: translateY(-2px);
}

.popup-products-page .ticket-discount {
    background: linear-gradient(135deg, #ff9243 0%, #f2620f 100%);
    color: #ffffff;
}

.popup-products-page .ticket-price {
    color: #c2410c;
}

.popup-products-page .btn-primary {
    border-color: #f2620f;
    background: linear-gradient(90deg, #ff6a00 0%, #ff9243 100%);
    box-shadow: 0 6px 14px rgba(255, 106, 0, .24);
}

.popup-products-page .btn-primary:hover,
.popup-products-page .btn-primary:focus {
    border-color: #ea580c;
    background: linear-gradient(90deg, #f2620f 0%, #ff9243 100%);
    box-shadow: 0 10px 18px rgba(255, 106, 0, .3);
}

@media (max-width: 768px) {
    .popup-products-page {
        margin: 0;
        padding: 10px 10px 6px;
        border-width: 2px;
        border-radius: 16px;
    }

    .popup-products-page__header {
        padding: 12px 12px 14px;
        border-radius: 14px;
    }

    .popup-products-page__title {
        font-size: 18px;
    }
}
