

.promotion-bar {
    width: 100%;
    z-index: 1000;
    background-color: $promotion-bar-bg-color;
    color: $promotion-bar-text-color;
    padding: 20px 24px;
    box-sizing: border-box;
    transition: transform 0.4s ease-out, opacity 0.3s ease-out;
    transform: translateY(0);
    opacity: 1;

    &.closing {
        transform: translateY(-100%);
        opacity: 0;
    }

    &.promotion-bar-fixed {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
    }

    &.promotion-bar-static {
        position: relative;
    }

    // Container (first direct child div)
    > div {
        max-width: 1400px;
        margin: 0 auto;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        position: relative;
        overflow: visible;

        // Content (first child div of container)
        > div:first-child {
            display: flex;
            align-items: center;
            gap: 20px;
            flex: 1;

            // Icon (first child div of content)
            > div:first-child {
                display: flex;
                align-items: center;
                justify-content: center;
                flex-shrink: 0;

                img {
                    width: 22px;
                    height: 25px;
                    object-fit: contain;
                    filter: brightness(0) invert(1);
                }
            }

            // Message (second child div of content, or first if no icon)
            > div:last-child {
                font-size: 16px;
                line-height: 1.4;
                flex: 1;
                font-weight: 400;
                display: flex;
                align-items: center;
                min-width: 0;

                p {
                    margin: 0;
                    padding: 0;
                    line-height: 1.4;
                    display: block;

                    br:last-child {
                        display: none;
                    }
                }

                strong,
                b {
                    font-weight: 700;
                    font-size: 18px;
                    letter-spacing: 0.5px;
                }

                a {
                    color: inherit;
                    text-decoration: underline;
                    text-underline-offset: 3px;
                    text-decoration-thickness: 2px;
                    font-weight: 700;

                    &:hover {
                        text-decoration-thickness: 3px;
                    }
                }
            }
        }

        // Close button (button child of container)
        > button {
            background: transparent;
            border: none;
            color: inherit;
            cursor: pointer;
            padding: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            transition: background-color 0.2s ease;
            flex-shrink: 0;
            min-width: 40px;
            min-height: 40px;
            position: relative;
            z-index: 10;

            &:hover {
                background-color: $promotion-bar-close-hover-bg;
            }

            &:focus {
                outline: 2px solid currentColor;
                outline-offset: 2px;
            }

            svg {
                width: 24px;
                height: 24px;
            }
        }
    }
}

.promotion-bar-link {
    color: inherit;
    text-decoration: none;

    &:hover {
        text-decoration: underline;
    }
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .promotion-bar {
        padding: 16px 20px;

        > div > div:first-child > div:last-child {
            font-size: 15px;

            strong,
            b {
                font-size: 17px;
            }
        }
    }
}

@media (max-width: 768px) {
    .promotion-bar {
        padding: 14px 16px;

        > div {
            gap: 12px;

            > div:first-child {
                gap: 12px;
                min-width: 0;
                flex: 1;

                > div:last-child {
                    font-size: 16px;
                    min-width: 0;

                    strong,
                    b {
                        font-size: 18px;
                    }
                }
            }

            > button {
                min-width: 36px;
                min-height: 36px;
                padding: 6px;
            }
        }
    }
}

@media (max-width: 480px) {
    .promotion-bar {
        padding: 12px 12px;

        > div {
            gap: 8px;

            > div:first-child {
                gap: 10px;
                min-width: 0;
                flex: 1;

                > div:last-child {
                    min-width: 0;

                    strong,
                    b {
                        font-size: 16px;
                    }
                }
            }

            > button {
                min-width: 32px;
                min-height: 32px;
                padding: 4px;

                svg {
                    width: 20px;
                    height: 20px;
                }
            }
        }
    }
}

/* Body padding adjustment when bar is fixed */
body:has(.promotion-bar-fixed) {
    padding-top: 80px;
    transition: padding-top 0.4s ease-out;
}

@media (max-width: 1024px) {
    body:has(.promotion-bar-fixed) {
        padding-top: 70px;
    }
}

@media (max-width: 768px) {
    body:has(.promotion-bar-fixed) {
        padding-top: 60px;
    }
}

@media (max-width: 480px) {
    body:has(.promotion-bar-fixed) {
        padding-top: 52px;
    }
}
