/**
 * Announcement Banner - Infinite Scrolling Promotional Banner
 * Appears above header for sales, promotions, and important announcements
 */

.announcement-banner {
    position: relative;
    width: 100%;
    height: 28px;
    background: #ff6b35; /* Orange for sales/promotions */
    color: white;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.announcement-banner__content {
    flex: 1;
    overflow: hidden;
    height: 100%;
    display: flex;
    align-items: center;
}

.announcement-banner__scroll {
    display: flex;
    animation: scroll-left 40s linear infinite;
    will-change: transform;
}

/* Pause animation on hover so users can read */
.announcement-banner:hover .announcement-banner__scroll {
    animation-play-state: paused;
}

.announcement-banner__track {
    flex-shrink: 0;
    min-width: 100vw;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding-right: 40px;
}

/* Infinite scroll animation - moves first track completely off, second track takes its place */
@keyframes scroll-left {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/* Close button */
.announcement-banner__close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.announcement-banner__close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.announcement-banner__close svg {
    display: block;
}

/* Hidden state */
.announcement-banner.hidden {
    display: none;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .announcement-banner {
        height: 26px;
    }

    .announcement-banner__track {
        font-size: 10px;
    }

    .announcement-banner__close {
        width: 18px;
        height: 18px;
        right: 6px;
    }

    .announcement-banner__close svg {
        width: 10px;
        height: 10px;
    }
}

/* Smooth fade-in on page load */
.announcement-banner {
    animation: fadeInBanner 0.3s ease-out;
}

@keyframes fadeInBanner {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
