.rw-site-announcement {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 10000;
    width: 100%;
    min-height: 64px;
    display: none;
    overflow: hidden;

    background:
        radial-gradient(
            circle at 10% 50%,
            rgba(255,235,59,.28) 0,
            rgba(255,235,59,0) 28%
        ),
        radial-gradient(
            circle at 88% 50%,
            rgba(255,255,255,.14) 0,
            rgba(255,255,255,0) 28%
        ),
        linear-gradient(
            110deg,
            #b45309 0%,
            #d97706 32%,
            #f59e0b 68%,
            #ea580c 100%
        );

    color: #fff;

    box-shadow:
        0 3px 16px rgba(217,119,6,.25),
        inset 0 -1px 0 rgba(255,255,255,.18);

    transition:
        opacity .25s ease,
        transform .25s ease;
}

.rw-site-announcement.is-ready {
    display: block;
}

.rw-site-announcement.is-closing {
    opacity: 0;
    transform: translateY(-100%);
}


/* Shine */

.rw-site-announcement::before {
    content: "";
    position: absolute;
    top: 0;
    left: -25%;
    width: 28%;
    height: 100%;

    background: linear-gradient(
        90deg,
        transparent,
        rgba(255,255,255,.16),
        transparent
    );

    transform: skewX(-20deg);
    animation: rw-announcement-shine 5s ease-in-out infinite;

    pointer-events: none;
}

@keyframes rw-announcement-shine {
    0%,
    65% {
        left: -25%;
    }

    100% {
        left: 120%;
    }
}


/*
|--------------------------------------------------------------------------
| Header
|--------------------------------------------------------------------------
|
| ارتفاع هدر توسط JS داخل متغیر --rw-announcement-height قرار می‌گیرد.
| اگر متغیر وجود نداشته باشد مقدار 0 استفاده می‌شود.
|
*/

#header.fixed-top {
    top: var(--rw-announcement-height, 0px);
    transition: top .25s ease;
}


/*
|--------------------------------------------------------------------------
| Container
|--------------------------------------------------------------------------
*/

.rw-site-announcement__container {
    position: relative;
    z-index: 1;

    width: 100%;
    min-height: 64px;

    margin: 0 auto;
    padding: 0 58px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 16px;

    box-sizing: border-box;
}


/*
|--------------------------------------------------------------------------
| Content
|--------------------------------------------------------------------------
*/

.rw-site-announcement__content {
    flex: 1 1 auto;

    min-width: 0;
    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: hidden;

    box-sizing: border-box;
}


/*
|--------------------------------------------------------------------------
| Item
|--------------------------------------------------------------------------
*/

.rw-site-announcement__item {
    display: none;

    width: 100%;
    max-width: 100%;
    min-width: 0;

    min-height: 64px;

    align-items: center;
    justify-content: center;

    gap: 16px;

    box-sizing: border-box;

    animation: rwAnnouncementFade .28s ease;
}

.rw-site-announcement__item.is-active {
    display: flex;
}


/*
|--------------------------------------------------------------------------
| Text
|--------------------------------------------------------------------------
*/

.rw-site-announcement__text {
    flex: 1 1 auto;

    min-width: 0;
    max-width: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 9px;

    line-height: 1.6;

    text-align: center;

    overflow: hidden;

    box-sizing: border-box;
}


/*
|--------------------------------------------------------------------------
| Title
|--------------------------------------------------------------------------
*/

.rw-site-announcement__title {
    flex: 0 1 auto;

    min-width: 0;
    max-width: 40%;

    display: block;

    color: #fff;

    font-size: 14px;
    font-weight: 800;
    line-height: 1.6;

    text-shadow: 0 1px 8px rgba(0,0,0,.16);

    white-space: nowrap;

    overflow: hidden;
    text-overflow: ellipsis;
}


/*
|--------------------------------------------------------------------------
| Message
|--------------------------------------------------------------------------
*/

.rw-site-announcement__message {
    flex: 0 1 auto;

    min-width: 0;
    max-width: 100%;

    display: block;

    color: rgba(255,255,255,.96);

    font-size: 13px;
    font-weight: 500;
    line-height: 1.6;

    white-space: nowrap;

    overflow: hidden;
    text-overflow: ellipsis;
}


/*
|--------------------------------------------------------------------------
| Button
|--------------------------------------------------------------------------
*/

.rw-site-announcement__button {
    flex: 0 0 auto;

    max-width: 180px;
    height: 33px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    padding: 5px 15px;

    border: 1px solid rgba(255,255,255,.58);
    border-radius: 9px;

    background: rgba(255,255,255,.18);

    color: #fff;

    margin-left: 20px;

    font-size: 14px;
    font-weight: 800;
    line-height: 1.5;

    text-align: center;
    text-decoration: none;

    white-space: nowrap;

    overflow: hidden;
    text-overflow: ellipsis;

    box-shadow:
        0 4px 12px rgba(120,53,15,.12),
        inset 0 1px 0 rgba(255,255,255,.18);

    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);

    transition:
        background-color .2s ease,
        color .2s ease,
        border-color .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}

.rw-site-announcement__button:hover {
    background: #fff;
    border-color: #fff;
    color: #b45309;

    transform: translateY(-1px);

    box-shadow:
        0 6px 18px rgba(120,53,15,.18);
}

.rw-site-announcement__button i {
    flex: 0 0 auto;

    font-size: 15px;
    line-height: 1;
}


/*
|--------------------------------------------------------------------------
| Close
|--------------------------------------------------------------------------
*/

.rw-site-announcement__close {
    position: absolute;

    left: 12px;
    top: 50%;

    width: 32px;
    height: 32px;

    padding: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    transform: translateY(-50%);

    border: 1px solid rgba(255,255,255,.22);
    border-radius: 8px;

    background: rgba(120,53,15,.12);

    color: rgba(255,255,255,.94);

    cursor: pointer;

    box-sizing: border-box;

    transition:
        background-color .2s ease,
        color .2s ease,
        transform .2s ease,
        border-color .2s ease;
}

.rw-site-announcement__close:hover {
    background: rgba(120,53,15,.24);

    border-color: rgba(255,255,255,.35);

    color: #fff;

    transform: translateY(-50%) scale(1.05);
}

.rw-site-announcement__close i {
    font-size: 18px;
    line-height: 1;
}


/*
|--------------------------------------------------------------------------
| Animation
|--------------------------------------------------------------------------
*/

@keyframes rwAnnouncementFade {
    from {
        opacity: 0;
        transform: translateY(3px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 991px) {

    .rw-site-announcement {
        min-height: 74px;
    }

    .rw-site-announcement__container {
        min-height: 74px;

        padding:
            8px
            54px
            8px
            46px;
    }

    .rw-site-announcement__content {
        height: auto;
        min-height: 58px;

        overflow: visible;
    }

    .rw-site-announcement__item {
        min-height: 58px;
        height: auto;

        gap: 10px;
    }

    .rw-site-announcement__text {
        flex-direction: column;

        align-items: flex-start;
        justify-content: center;

        gap: 2px;

        text-align: right;

        overflow: visible;
    }

    .rw-site-announcement__title {
        width: 100%;
        max-width: 100%;

        font-size: 13px;
        line-height: 1.6;

        white-space: normal;

        overflow: visible;
        text-overflow: unset;
    }

    .rw-site-announcement__message {
        width: 100%;
        max-width: 100%;

        font-size: 12px;
        line-height: 1.8;

        white-space: normal;

        overflow: visible;
        text-overflow: unset;

        overflow-wrap: break-word;
        word-break: normal;
    }

    .rw-site-announcement__button {
        flex: 0 0 auto;

        max-width: 130px;
        height: 32px;

        margin-left: 0;

        padding: 5px 10px;

        font-size: 11px;
    }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 768px) {

    .rw-site-announcement {
        min-height: 0;
        height: auto;

        overflow: visible;
    }

    .rw-site-announcement__container {
        min-height: 0;
        height: auto;

        padding:
            10px
            45px
            10px
            40px;

        display: flex;
        align-items: center;
    }

    .rw-site-announcement__content {
        height: auto;
        min-height: 0;

        overflow: visible;
    }

    .rw-site-announcement__item {
        width: 100%;

        min-height: 0;
        height: auto;

        flex-direction: column;

        align-items: stretch;
        justify-content: center;

        gap: 7px;

        overflow: visible;
    }

    .rw-site-announcement__text {
        width: 100%;

        min-width: 0;
        max-width: 100%;

        flex: none;

        flex-direction: column;

        align-items: flex-start;
        justify-content: center;

        gap: 2px;

        text-align: right;

        overflow: visible;
    }

    .rw-site-announcement__title {
        width: 100%;
        max-width: 100%;

        font-size: 12px;
        line-height: 1.7;

        white-space: normal;

        overflow: visible;
        text-overflow: unset;
    }

    .rw-site-announcement__message {
        width: 100%;
        max-width: 100%;

        font-size: 11.5px;
        line-height: 1.9;

        /*
         * متن کامل نمایش داده می‌شود.
         */
        white-space: normal;

        overflow: visible;
        text-overflow: unset;

        overflow-wrap: break-word;
        word-break: normal;
    }

    .rw-site-announcement__button {
        align-self: flex-start;

        width: auto;
        max-width: 100%;

        height: 30px;
        min-height: 30px;

        margin: 2px 0 0;

        padding: 4px 11px;

        font-size: 10.5px;
    }

    .rw-site-announcement__close {
        left: 6px;
        top: 10px;

        width: 29px;
        height: 29px;

        transform: none;
    }

    .rw-site-announcement__close:hover {
        transform: scale(1.05);
    }

    .rw-site-announcement__close i {
        font-size: 17px;
    }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 576px) {

    .rw-site-announcement__container {
        padding:
            9px
            41px
            9px
            36px;
    }

    .rw-site-announcement__item {
        gap: 5px;
    }

    .rw-site-announcement__title {
        font-size: 11.5px;
    }

    .rw-site-announcement__message {
        font-size: 11px;
        line-height: 1.9;
    }

    .rw-site-announcement__button {
        height: 29px;
        min-height: 29px;

        padding: 4px 9px;

        font-size: 10px;
    }

    .rw-site-announcement__close {
        left: 5px;
        top: 9px;

        width: 28px;
        height: 28px;
    }
}


/* =========================================================
   VERY SMALL MOBILE
   ========================================================= */

@media (max-width: 400px) {

    .rw-site-announcement__container {
        padding-right: 38px;
        padding-left: 34px;
    }

    .rw-site-announcement__title {
        font-size: 11px;
    }

    .rw-site-announcement__message {
        font-size: 10.5px;
        line-height: 1.9;

        white-space: normal;

        overflow: visible;
        text-overflow: unset;
    }

    .rw-site-announcement__button {
        font-size: 10px;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .rw-site-announcement,
    .rw-site-announcement__button,
    .rw-site-announcement__close,
    .rw-site-announcement__item {
        transition: none;
        animation: none;
    }

    .rw-site-announcement::before {
        animation: none;
    }
}
