/*!
 * CloudOps Theme - layout.css
 * 顶部 promo-bar / 导航 / footer / 右侧悬浮联系栏
 */

/* ============ Top Promo Bar ============ */
.promo-bar {
    background: #FAFBFD;
    border-bottom: 1px solid var(--line);
    font-size: 12.5px;
    color: var(--ink-soft);
}
.promo-bar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 36px;
    gap: 24px;
}
.promo-bar a { color: var(--ink-soft); transition: color var(--t-fast); }
.promo-bar a:hover { color: var(--blue); }
.promo-bar .pb-left { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.promo-bar .pb-right { display: flex; gap: 18px; align-items: center; }
.promo-bar .pb-status::before {
    content: '';
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--success);
    margin-right: 6px;
    vertical-align: middle;
    box-shadow: 0 0 0 0 rgba(0, 185, 118, 0.5);
    animation: livePulse 2s infinite;
}
@keyframes livePulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 185, 118, 0.5); }
    70% { box-shadow: 0 0 0 7px rgba(0, 185, 118, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 185, 118, 0); }
}

/* 货币切换下拉 */
.pb-currency { position: relative; }
.pb-currency-toggle { cursor: pointer; user-select: none; }
.pb-currency-menu {
    position: absolute;
    top: 100%; right: 0;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-2);
    min-width: 120px;
    padding: 4px;
    z-index: 100;
    display: none;
}
.pb-currency:hover .pb-currency-menu { display: block; }
.pb-currency-menu li a {
    display: block;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: var(--radius-xs);
    color: var(--ink-2);
}
.pb-currency-menu li a:hover { background: var(--bg-soft); color: var(--blue); }

/* ============ Navigation Bar ============ */
.nav-bar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
}
.nav-bar .container {
    display: flex;
    align-items: center;
    height: 64px;
    gap: 40px;
}

/* logo */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.02em;
    color: var(--ink);
    text-decoration: none;
    flex-shrink: 0;
}
.brand:hover { color: var(--ink); }
.brand img { max-height: 32px; width: auto; }
.brand-mark {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, #0066FF 0%, #4D8FFF 100%);
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
    flex-shrink: 0;
}
.brand-mark::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background:
        linear-gradient(135deg, transparent 50%, rgba(255, 255, 255, 0.3) 50%),
        linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.2) 50%);
    background-size: 50% 50%;
    background-repeat: no-repeat;
    background-position: top right, bottom left;
}

/* 主导航菜单 */
.nav-menu {
    display: flex;
    gap: 2px;
    flex: 1;
    list-style: none;
    margin: 0;
    padding: 0;
}
.nav-menu > li { position: relative; }
.nav-menu > li > a {
    padding: 8px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--ink-2);
    font-weight: 500;
    transition: all var(--t-base);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
}
.nav-menu > li > a:hover { color: var(--blue); background: var(--bg-blue-soft); }
.nav-menu .caret { font-size: 9px; opacity: 0.5; transition: transform var(--t-fast); }
.nav-menu > li:hover .caret { transform: rotate(180deg); }

/* mega menu 下拉 */
.nav-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-3);
    padding: 12px;
    margin-top: 8px;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all var(--t-base);
    z-index: 60;
}
.nav-menu > li:hover .nav-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.nav-submenu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    color: var(--ink-2);
    transition: all var(--t-fast);
    text-decoration: none;
}
.nav-submenu li a:hover { background: var(--bg-blue-soft); color: var(--blue); }
.nav-submenu-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-md);
    background: var(--bg-blue-soft);
    color: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.nav-submenu li a:hover .nav-submenu-icon { background: var(--blue); color: #fff; }
.nav-submenu-text { flex: 1; min-width: 0; }
.nav-submenu-title { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.nav-submenu-desc { font-size: 12px; color: var(--ink-dim); margin-top: 2px; line-height: 1.4; }

/* 导航右侧动作按钮 */
.nav-actions { display: flex; gap: 8px; align-items: center; }
.nav-cart {
    position: relative;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    color: var(--ink-2);
    border: 1px solid var(--line);
    background: #fff;
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--t-base);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.nav-cart:hover { color: var(--blue); border-color: var(--blue); }
.nav-cart-badge {
    position: absolute;
    top: -6px; right: -6px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    border: 2px solid #fff;
}

/* 移动端汉堡 */
.nav-toggle {
    display: none;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 8px;
    color: var(--ink);
}

/* ============ Footer ============ */
.footer {
    background: var(--bg-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 60px 0 28px;
    position: relative;
    overflow: hidden;
}
.footer::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 600px; height: 400px;
    background: radial-gradient(ellipse, rgba(0, 102, 255, 0.18), transparent 65%);
    pointer-events: none;
    filter: blur(40px);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr repeat(4, 1fr);
    gap: 48px;
    margin-bottom: 48px;
    position: relative;
    z-index: 1;
}
.footer-col h5 {
    font-size: 14px;
    color: #fff;
    margin: 0 0 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.footer-col a {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.6);
    transition: color var(--t-fast);
    text-decoration: none;
}
.footer-col a:hover { color: #fff; }

.footer-brand .brand { color: #fff; }
.footer-brand p {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.6);
    margin: 18px 0;
    line-height: 1.6;
    max-width: 300px;
}
.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}
.footer-contact a:hover { color: #fff; }
.footer-contact i, .footer-contact .fas {
    color: rgba(255, 255, 255, 0.5);
    margin-right: 6px;
    font-size: 12px;
}

.footer-bottom {
    padding-top: 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    position: relative;
    z-index: 1;
    flex-wrap: wrap;
    gap: 12px;
}
.footer-bottom a { color: rgba(255, 255, 255, 0.7); }
.footer-bottom a:hover { color: #fff; }

.footer-social { display: flex; gap: 10px; }
.footer-social a {
    width: 34px; height: 34px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t-base);
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}
.footer-social a:hover {
    background: var(--blue);
    color: #fff;
    transform: translateY(-2px);
}

/* 回到顶部按钮 */
.scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 44px; height: 44px;
    background: var(--blue);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-blue);
    cursor: pointer;
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: all var(--t-base);
    border: 0;
}
.scroll-top.visible { opacity: 1; pointer-events: auto; }
.scroll-top:hover { background: var(--blue-hover); transform: translateY(-2px); box-shadow: var(--shadow-blue-strong); }

/* ============ 右侧悬浮联系栏 ============ */
.contact-bar {
    position: fixed;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 8px;
    box-shadow: var(--shadow-2);
}
.contact-bar-item {
    position: relative;
    width: 44px; height: 44px;
    border-radius: var(--radius-md);
    background: var(--bg-soft);
    color: var(--ink-2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--t-base);
    text-decoration: none;
}
.contact-bar-item:hover {
    background: var(--blue);
    color: #fff;
}
.contact-bar-item img { width: 22px; height: 22px; }
.contact-bar-item .cb-tip {
    position: absolute;
    right: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--ink);
    color: #fff;
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--t-fast);
    box-shadow: var(--shadow-2);
}
.contact-bar-item .cb-tip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: var(--ink);
    border-right: 0;
}
.contact-bar-item:hover .cb-tip { opacity: 1; }

/* contact-bar 弹出气泡（用于显示二维码/电话等多内容） */
.contact-bar-item .cb-pop {
    position: absolute;
    right: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 16px;
    min-width: 180px;
    box-shadow: var(--shadow-3);
    opacity: 0;
    visibility: hidden;
    transition: all var(--t-base);
}
.contact-bar-item:hover .cb-pop { opacity: 1; visibility: visible; }
.cb-pop-title { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 8px; text-align: center; }
.cb-pop-content { font-size: 13px; color: var(--ink-2); text-align: center; line-height: 1.6; }
.cb-pop img { max-width: 140px; }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
    .nav-menu { display: none; }
    .nav-toggle { display: inline-flex; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 640px) {
    .promo-bar .pb-left { display: none; }
    .nav-bar .container { gap: 16px; height: 56px; }
    .nav-actions .btn span { display: none; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .contact-bar { right: 8px; gap: 6px; padding: 6px; }
    .contact-bar-item { width: 38px; height: 38px; }
    .scroll-top { bottom: 16px; right: 16px; width: 40px; height: 40px; }
}
