/* Topbar Style Studio — storefront + admin preview (.tb-bar) */

.tb-bar {
    background-color: var(--tb-bg, #2563EB);
    color: var(--tb-text, #fff);
    min-height: var(--tb-height, 40px);
    height: auto;
    line-height: 1.5;
    text-align: center;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 40px;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.tb-bar.tb-bg--gradient {
    background: linear-gradient(90deg, var(--tb-bg, #2563EB), var(--tb-bg-2, #1D4ED8));
    background-size: 200% 100%;
}

.tb-bar.tb-bar-anim--gradient_shift {
    animation: tb-gradient-shift 8s ease infinite;
}

.tb-bar.tb-bar-anim--slide_in {
    animation: tb-slide-in 0.55s ease-out;
}

.tb-bar .tb-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.tb-bar.tb-layout--split .tb-inner {
    justify-content: space-between;
}

.tb-bar .tb-content-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.tb-bar.tb-layout--split .tb-content-wrap {
    justify-content: flex-start;
}

.tb-bar .tb-content {
    flex: 1;
    padding: 10px 0;
    line-height: 1.6;
    word-wrap: break-word;
    min-width: 0;
}

.tb-bar.tb-text--sm { font-size: 13px; }
.tb-bar.tb-text--md { font-size: 14px; }
.tb-bar.tb-text--lg { font-size: 16px; }

.tb-bar.tb-weight--normal { font-weight: 400; }
.tb-bar.tb-weight--semibold { font-weight: 600; }
.tb-bar.tb-weight--bold { font-weight: 700; }

.tb-bar .tb-beacon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--tb-beacon, var(--tb-accent, #FBBF24));
    flex-shrink: 0;
    display: inline-block;
}

.tb-bar.tb-beacon-intensity--soft .tb-beacon { opacity: 0.75; }
.tb-bar.tb-beacon-intensity--strong .tb-beacon { box-shadow: 0 0 0 0 var(--tb-beacon, #FBBF24); }

.tb-bar.tb-beacon--pulse .tb-beacon {
    animation: tb-beacon-pulse 1.6s ease-in-out infinite;
}

.tb-bar.tb-beacon--breathe .tb-beacon {
    animation: tb-beacon-breathe 2.4s ease-in-out infinite;
}

.tb-bar.tb-beacon--ripple .tb-beacon {
    animation: tb-beacon-ripple 2s ease-out infinite;
}

.tb-bar.tb-beacon--glow .tb-beacon {
    animation: tb-beacon-glow 2s ease-in-out infinite;
    box-shadow: 0 0 8px var(--tb-beacon, #FBBF24);
}

.tb-bar.tb-beacon--blink_soft .tb-beacon {
    animation: tb-beacon-blink 2.5s step-end infinite;
}

.tb-bar.tb-text-anim--shimmer .tb-content {
    background: linear-gradient(90deg, var(--tb-text) 0%, #fff 50%, var(--tb-text) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: tb-text-shimmer 3s linear infinite;
}

.tb-bar.tb-bar-anim--marquee .tb-marquee {
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.tb-bar.tb-bar-anim--marquee .tb-marquee-track {
    display: inline-flex;
    white-space: nowrap;
    animation: tb-marquee 18s linear infinite;
    gap: 2rem;
}

.tb-bar .topbar-cta-btn,
.tb-bar #topbar-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.2s;
}

.tb-bar.tb-cta--pill .topbar-cta-btn,
.tb-bar.tb-cta--pill #topbar-cta-btn {
    background-color: rgba(255, 255, 255, 0.2);
    color: inherit;
}

.tb-bar.tb-cta--outline .topbar-cta-btn,
.tb-bar.tb-cta--outline #topbar-cta-btn {
    background: transparent;
    border: 1px solid currentColor;
    color: inherit;
}

.tb-bar.tb-cta--solid .topbar-cta-btn,
.tb-bar.tb-cta--solid #topbar-cta-btn {
    background: var(--tb-accent, #FBBF24);
    color: #111;
}

.tb-bar.tb-cta-color--accent .topbar-cta-btn,
.tb-bar.tb-cta-color--accent #topbar-cta-btn {
    background: var(--tb-accent, #FBBF24);
    color: #111;
}

.tb-bar.tb-cta-anim--pulse .topbar-cta-btn,
.tb-bar.tb-cta-anim--pulse #topbar-cta-btn {
    animation: tb-cta-pulse 2s ease-in-out infinite;
}

.tb-bar .topbar-cta-btn:hover,
.tb-bar #topbar-cta-btn:hover {
    filter: brightness(1.08);
}

.tb-bar .topbar-close-btn,
.tb-bar #topbar-close-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: none;
    color: inherit;
    padding: 0;
}

.tb-bar .topbar-close-btn svg,
.tb-bar #topbar-close-btn svg {
    display: block;
    width: 14px;
    height: 14px;
    color: inherit;
    stroke: currentColor;
}

/* Storefront-only: hidden state */
#topbar-notification.topbar-closed {
    display: none !important;
}

@media (max-width: 768px) {
    .tb-bar {
        font-size: 14px;
        padding: 12px 40px 12px 10px;
        min-height: auto;
    }

    .tb-bar.tb-show-desktop-only {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .tb-bar.tb-show-mobile-only {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tb-bar.tb-respect-reduced-motion,
    .tb-bar.tb-respect-reduced-motion * {
        animation: none !important;
        transition: none !important;
    }

    .tb-bar.tb-respect-reduced-motion.tb-text-anim--shimmer .tb-content {
        -webkit-text-fill-color: var(--tb-text);
        background: none;
    }
}

@keyframes tb-gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes tb-slide-in {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes tb-beacon-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.65; }
}

@keyframes tb-beacon-breathe {
    0%, 100% { opacity: 1; filter: brightness(1); }
    50% { opacity: 0.45; filter: brightness(0.85); }
}

@keyframes tb-beacon-ripple {
    0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.55); }
    70% { box-shadow: 0 0 0 10px rgba(251, 191, 36, 0); }
    100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
}

@keyframes tb-beacon-glow {
    0%, 100% { box-shadow: 0 0 6px var(--tb-beacon), 0 0 12px var(--tb-beacon); }
    50% { box-shadow: 0 0 12px var(--tb-beacon), 0 0 22px var(--tb-beacon); }
}

@keyframes tb-beacon-blink {
    0%, 45%, 100% { opacity: 1; }
    50%, 95% { opacity: 0.25; }
}

@keyframes tb-text-shimmer {
    to { background-position: 200% center; }
}

@keyframes tb-marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes tb-cta-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
