/**
 * کامپوننت نوتیفیکیشن و toast
 * برای پیام‌های ووکامرس، انتخاب رنگ محصول و toast افزودن به سبد.
 */

/* ==========================================================================
   01. toast افزودن به سبد خرید موبایل
   ========================================================================== */
@media (max-width: 768px) {
    .rp-mobile-cart-toast {
        top: calc(14px + env(safe-area-inset-top, 0px)) !important;
        bottom: auto !important;
        transform: translateY(-12px) scale(.98) !important;
        z-index: 999999 !important;
    }

    .rp-mobile-cart-toast.is-visible {
        transform: translateY(0) scale(1) !important;
    }

    body.rp-cart-sidebar-open .rp-mobile-cart-toast {
        z-index: 1000001 !important;
    }
}

/* ==========================================================================
   02. toast عمومی ووکامرس
   ========================================================================== */
body.rp-wc-notice-modal-open,
body.rp-wc-notice-toast-open {
    overflow: auto !important;
    overflow-y: auto !important;
}

.rp-wc-notice-modal.rp-wc-notice-toast,
.rp-wc-notice-modal {
    position: fixed !important;
    top: calc(14px + env(safe-area-inset-top, 0px)) !important;
    right: 16px !important;
    left: 16px !important;
    bottom: auto !important;
    inset: auto 16px auto 16px !important;
    z-index: 1000002 !important;
    width: auto !important;
    max-width: 760px !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    direction: rtl !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(-12px) scale(.98) !important;
    transition: opacity .18s ease, visibility .18s ease, transform .18s ease !important;
    box-sizing: border-box !important;
}

.rp-wc-notice-modal.rp-wc-notice-toast.is-open,
.rp-wc-notice-modal.is-open {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: none !important;
    transform: translateY(0) scale(1) !important;
}

.rp-wc-notice-modal__box,
.rp-wc-notice-toast__box {
    width: min(100%, 760px) !important;
    min-height: 52px !important;
    padding: 10px 12px 10px 14px !important;
    border: 1px solid rgba(255, 255, 255, .18) !important;
    border-radius: 16px !important;
    background: #00c99b !important;
    color: #fff !important;
    box-shadow: 0 18px 42px rgba(0, 126, 96, .26) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    text-align: right !important;
    pointer-events: auto !important;
    box-sizing: border-box !important;
}


/* v0.1.636: WooCommerce notices are type-aware toast notifications. */
.rp-wc-notice-modal.rp-wc-notice-toast.is-success .rp-wc-notice-modal__box,
.rp-wc-notice-modal.is-success .rp-wc-notice-modal__box,
.rp-wc-notice-modal.rp-wc-notice-toast.is-success .rp-wc-notice-toast__box {
    background: #00c99b !important;
    background-color: #00c99b !important;
    box-shadow: 0 18px 42px rgba(0, 126, 96, .26) !important;
}

.rp-wc-notice-modal.rp-wc-notice-toast.is-error .rp-wc-notice-modal__box,
.rp-wc-notice-modal.is-error .rp-wc-notice-modal__box,
.rp-wc-notice-modal.rp-wc-notice-toast.is-error .rp-wc-notice-toast__box {
    background: #ff4d3d !important;
    background-color: #ff4d3d !important;
    box-shadow: 0 18px 42px rgba(255, 77, 61, .24) !important;
}

.rp-wc-notice-modal.rp-wc-notice-toast.is-warning .rp-wc-notice-modal__box,
.rp-wc-notice-modal.is-warning .rp-wc-notice-modal__box,
.rp-wc-notice-modal.rp-wc-notice-toast.is-warning .rp-wc-notice-toast__box {
    background: #ff9f1c !important;
    background-color: #ff9f1c !important;
    box-shadow: 0 18px 42px rgba(255, 159, 28, .24) !important;
}

.rp-wc-notice-modal.rp-wc-notice-toast.is-error .rp-wc-notice-modal__close,
.rp-wc-notice-modal.rp-wc-notice-toast.is-error .rp-wc-notice-toast__close {
    color: #e33425 !important;
}

.rp-wc-notice-modal.rp-wc-notice-toast.is-warning .rp-wc-notice-modal__close,
.rp-wc-notice-modal.rp-wc-notice-toast.is-warning .rp-wc-notice-toast__close {
    color: #b86700 !important;
}

.rp-wc-notice-toast__icon {
    width: 24px !important;
    min-width: 24px !important;
    height: 24px !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, .22) !important;
    color: #fff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
}

.rp-wc-notice-modal__content,
.rp-wc-notice-toast__content {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.9 !important;
    text-align: right !important;
}

.rp-wc-notice-modal__content *,
.rp-wc-notice-toast__content * {
    color: #fff !important;
}

.rp-wc-notice-modal__content ul,
.rp-wc-notice-modal__content ol,
.rp-wc-notice-toast__content ul,
.rp-wc-notice-toast__content ol {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.rp-wc-notice-modal__content li,
.rp-wc-notice-toast__content li {
    margin: 0 !important;
    padding: 0 !important;
}

.rp-wc-notice-modal__content a,
.rp-wc-notice-toast__content a {
    color: #fff !important;
    font-weight: 800 !important;
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
}

.rp-wc-notice-toast__separator {
    display: block !important;
    width: 100% !important;
    height: 1px !important;
    margin: 8px 0 !important;
    background: rgba(255, 255, 255, .22) !important;
}

.rp-wc-notice-modal__close,
.rp-wc-notice-toast__close {
    flex: 0 0 auto !important;
    min-height: 34px !important;
    padding: 0 14px !important;
    border: 0 !important;
    border-radius: 11px !important;
    background: #fff !important;
    color: #009874 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 34px !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    box-shadow: none !important;
}

.rp-wc-notice-modal__close:hover,
.rp-wc-notice-toast__close:hover {
    background: rgba(255, 255, 255, .92) !important;
    color: #007f62 !important;
}

.woocommerce-notices-wrapper [data-rp-wc-notice-consumed="true"],
.woocommerce [data-rp-wc-notice-consumed="true"],
[data-rp-wc-notice-consumed="true"] {
    display: none !important;
}

/* ==========================================================================
   03. toast انتخاب گزینه محصول
   ========================================================================== */
body.rp-product-modal-open,
body.rp-product-option-toast-open,
body.woocommerce-shop.rp-product-modal-open,
body.post-type-archive-product.rp-product-modal-open,
body.tax-product_cat.rp-product-modal-open,
body.tax-product_tag.rp-product-modal-open,
body.single-product.rp-product-modal-open,
body.woocommerce-cart.rp-product-modal-open {
    overflow: auto !important;
    overflow-y: auto !important;
}

.rp-product-option-required-modal.rp-product-option-required-toast,
body.woocommerce-shop .rp-product-option-required-modal.rp-product-option-required-toast,
body.post-type-archive-product .rp-product-option-required-modal.rp-product-option-required-toast,
body.tax-product_cat .rp-product-option-required-modal.rp-product-option-required-toast,
body.tax-product_tag .rp-product-option-required-modal.rp-product-option-required-toast,
body.single-product .rp-product-option-required-modal.rp-product-option-required-toast,
body.woocommerce-cart .rp-product-option-required-modal.rp-product-option-required-toast,
.rp-shop-archive .rp-product-option-required-modal.rp-product-option-required-toast {
    position: fixed !important;
    top: calc(14px + env(safe-area-inset-top, 0px)) !important;
    right: 16px !important;
    left: 16px !important;
    bottom: auto !important;
    inset: auto 16px auto 16px !important;
    z-index: 1000003 !important;
    width: auto !important;
    max-width: 760px !important;
    min-height: 0 !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    direction: rtl !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateY(-12px) scale(.98) !important;
    transition: opacity .18s ease, visibility .18s ease, transform .18s ease !important;
    box-sizing: border-box !important;
}

.rp-product-option-required-modal.rp-product-option-required-toast.is-open,
body.woocommerce-shop .rp-product-option-required-modal.rp-product-option-required-toast.is-open,
body.post-type-archive-product .rp-product-option-required-modal.rp-product-option-required-toast.is-open,
body.tax-product_cat .rp-product-option-required-modal.rp-product-option-required-toast.is-open,
body.tax-product_tag .rp-product-option-required-modal.rp-product-option-required-toast.is-open,
body.single-product .rp-product-option-required-modal.rp-product-option-required-toast.is-open,
body.woocommerce-cart .rp-product-option-required-modal.rp-product-option-required-toast.is-open,
.rp-shop-archive .rp-product-option-required-modal.rp-product-option-required-toast.is-open {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: none !important;
    transform: translateY(0) scale(1) !important;
}

.rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__box,
.rp-product-option-required-toast__box,
body.woocommerce-shop .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__box,
body.post-type-archive-product .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__box,
body.tax-product_cat .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__box,
body.tax-product_tag .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__box,
body.single-product .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__box,
body.woocommerce-cart .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__box,
.rp-shop-archive .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__box {
    width: min(100%, 760px) !important;
    min-height: 52px !important;
    padding: 10px 12px 10px 14px !important;
    border: 1px solid rgba(255, 255, 255, .18) !important;
    border-radius: 16px !important;
    background: #00c99b !important;
    color: #fff !important;
    box-shadow: 0 18px 42px rgba(0, 126, 96, .26) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    text-align: right !important;
    pointer-events: auto !important;
    box-sizing: border-box !important;
}

.rp-product-option-required-toast__icon {
    width: 24px !important;
    min-width: 24px !important;
    height: 24px !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, .22) !important;
    color: #fff !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
}

.rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__message,
.rp-product-option-required-toast__message,
body.woocommerce-shop .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__message,
body.post-type-archive-product .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__message,
body.tax-product_cat .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__message,
body.tax-product_tag .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__message,
body.single-product .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__message,
body.woocommerce-cart .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__message,
.rp-shop-archive .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__message {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.9 !important;
    text-align: right !important;
}

.rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__close,
.rp-product-option-required-toast__close,
body.woocommerce-shop .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__close,
body.post-type-archive-product .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__close,
body.tax-product_cat .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__close,
body.tax-product_tag .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__close,
body.single-product .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__close,
body.woocommerce-cart .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__close,
.rp-shop-archive .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__close {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    min-height: 34px !important;
    padding: 0 14px !important;
    border: 0 !important;
    border-radius: 11px !important;
    background: #fff !important;
    color: #009874 !important;
    font-family: var(--rp-font) !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    line-height: 34px !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    box-shadow: none !important;
}

.rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__close:hover,
.rp-product-option-required-toast__close:hover {
    background: rgba(255, 255, 255, .92) !important;
    color: #007f62 !important;
}

/* ==========================================================================
   04. موبایل
   ========================================================================== */
@media (max-width: 768px) {
    .rp-wc-notice-modal.rp-wc-notice-toast,
    .rp-wc-notice-modal,
    .rp-product-option-required-modal.rp-product-option-required-toast,
    body.woocommerce-shop .rp-product-option-required-modal.rp-product-option-required-toast,
    body.post-type-archive-product .rp-product-option-required-modal.rp-product-option-required-toast,
    body.tax-product_cat .rp-product-option-required-modal.rp-product-option-required-toast,
    body.tax-product_tag .rp-product-option-required-modal.rp-product-option-required-toast,
    body.single-product .rp-product-option-required-modal.rp-product-option-required-toast,
    body.woocommerce-cart .rp-product-option-required-modal.rp-product-option-required-toast,
    .rp-shop-archive .rp-product-option-required-modal.rp-product-option-required-toast {
        right: 12px !important;
        left: 12px !important;
        inset: auto 12px auto 12px !important;
        max-width: none !important;
    }

    .rp-wc-notice-modal__box,
    .rp-wc-notice-toast__box,
    .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__box,
    .rp-product-option-required-toast__box {
        width: 100% !important;
        padding: 10px 10px 10px 12px !important;
        gap: 8px !important;
    }

    .rp-wc-notice-modal__content,
    .rp-wc-notice-toast__content,
    .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__message,
    .rp-product-option-required-toast__message {
        font-size: 12.5px !important;
        line-height: 1.8 !important;
    }

    .rp-wc-notice-modal__close,
    .rp-wc-notice-toast__close,
    .rp-product-option-required-modal.rp-product-option-required-toast .rp-product-option-required-modal__close,
    .rp-product-option-required-toast__close {
        min-height: 32px !important;
        padding: 0 11px !important;
        font-size: 11.5px !important;
        line-height: 32px !important;
    }
}
