/**
 * Holistiq Arc Canvas Announcement Bar Styles
 */

/* ============================================
   基本構造
============================================ */
.arc-bar {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 99999;
    width: 100%;
    padding: 10px 16px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.arc-bar-top    { top: 0; }
.arc-bar-bottom { bottom: 0; }

.arc-bar.is-hidden {
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
}

.arc-bar-bottom.is-hidden {
    transform: translateY(110%);
}

.arc-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.arc-bar-text {
    font-weight: 500;
}

.arc-bar-close {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px 8px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.arc-bar-close:hover {
    opacity: 1;
}

/* タイマー部分 */
.arc-bar-timer {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-variant-numeric: tabular-nums;
}

.arc-bar-unit {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
}

.arc-bar-count {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.arc-bar-unit small {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.75;
}

.arc-bar-sep {
    font-size: 18px;
    font-weight: 300;
    opacity: 0.5;
    margin: 0 2px;
}

/* CTAボタン */
.arc-bar-cta {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s, transform 0.2s;
}

.arc-bar-cta:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}


/* ============================================
   Style: Dark（デフォルト）
============================================ */
.arc-bar-dark {
    background: #1a1a2e;
    color: #e2e8f0;
    border-bottom: 1px solid #0f3460;
}

.arc-bar-dark.arc-bar-bottom {
    border-bottom: none;
    border-top: 1px solid #0f3460;
}

.arc-bar-dark .arc-bar-close {
    color: #e2e8f0;
}

.arc-bar-dark .arc-bar-cta {
    background: #667eea;
    color: #fff;
}


/* ============================================
   Style: Light
============================================ */
.arc-bar-light {
    background: #f8fafc;
    color: #334155;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.arc-bar-light.arc-bar-bottom {
    border-bottom: none;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}

.arc-bar-light .arc-bar-close {
    color: #64748b;
}

.arc-bar-light .arc-bar-cta {
    background: #334155;
    color: #fff;
}


/* ============================================
   Style: Brand（CSS変数で色を注入）
============================================ */
.arc-bar-brand {
    background: var(--ac-brand-color, #667eea);
    color: #fff;
}

.arc-bar-brand .arc-bar-close {
    color: #fff;
}

.arc-bar-brand .arc-bar-cta {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
}


/* ============================================
   Style: Soft
============================================ */
.arc-bar-soft {
    background: #f8f4ff;
    color: #4c1d95;
    border-bottom: 1px solid #e9d8fd;
}

.arc-bar-soft.arc-bar-bottom {
    border-bottom: none;
    border-top: 1px solid #e9d8fd;
}

.arc-bar-soft .arc-bar-close {
    color: #6b46c1;
}

.arc-bar-soft .arc-bar-cta {
    background: #6b46c1;
    color: #fff;
}


/* ============================================
   ページ上部固定時のbody padding調整
   JSから動的に付与
============================================ */
body.arc-bar-offset-top {
    padding-top: var(--ac-bar-height, 48px);
}

body.arc-bar-offset-bottom {
    padding-bottom: var(--ac-bar-height, 48px);
}


/* ============================================
   レスポンシブ
============================================ */
@media (max-width: 600px) {
    .arc-bar-inner {
        gap: 8px;
        justify-content: center;
        padding-right: 32px;
    }

    .arc-bar-text {
        font-size: 12px;
    }

    .arc-bar-count {
        font-size: 16px;
    }

    .arc-bar-cta {
        font-size: 12px;
        padding: 5px 12px;
    }
}

/* CSS変数でbody paddingを制御（float-bar.jsとannouncemennt.jsの競合防止）
 * !important を外してテーマ競合リスクを下げる。
 * テーマ側のpadding-topが強い場合はユーザーがSWELL等の設定で調整。
 */
body {
    padding-top: calc(
        var(--ac-announce-top-height, 0px) +
        var(--ac-float-top-height, 0px)
    );
    padding-bottom: var(--ac-announce-bottom-height, 0px);
}
