/**
 * 全局悬浮按钮样式
 */

/* 悬浮按钮容器 */
.floating-buttons {
    position: fixed;
    bottom: 45px;
    right: 30px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 主按钮 */
.floating-main-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: #bebebe;
    color: #000000;
    cursor: pointer;
    box-shadow: 0px 2px 6px 1px rgba(0, 0, 0, 0.20);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.floating-main-btn:hover {
    background: #bebebe !important;
    color: #000000 !important;
}

.floating-main-btn:active{
    background: #bebebe !important;
    color: #000000 !important;
    transform: translateY(0);
    outline: none !important;
}
.floating-main-btn:focus {
  background: #bebebe !important;
  color: #000000 !important;
}

.floating-main-btn svg {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

.floating-main-btn.active {
    background: #bebebe;
    transform: rotate(90deg);
}

.floating-main-btn .main-icon {
    opacity: 1;
    transform: scale(1.1);
}

.floating-main-btn .close-icon {
    opacity: 0;
    transform: scale(0.8);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
}

.floating-main-btn.active .main-icon {
    opacity: 0;
    transform: scale(0.8);
}

.floating-main-btn.active .close-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* 子按钮容器 */
.floating-sub-buttons {
    position: absolute;
    bottom: 66px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transform: scale(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-sub-buttons.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

/* 子按钮 */
.floating-sub-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #bebebe;
    color: #000000;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 2px 6px 1px rgba(0, 0, 0, 0.20);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: scale(0);
}

.floating-sub-btn:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: #000000;
}

.floating-sub-btn:active {
    transform: translateY(-1px) scale(1.05);
}

.floating-sub-btn svg {
    width: 24px;
    height: 24px;
    transition: all 0.3s ease;
}

/* 各个子按钮的特殊样式 - 统一使用灰色背景和黑色图标 */
.floating-sub-btn-line {
    background: #bebebe;
    color: #000000;
}

.floating-sub-btn-line:hover {
    background: #a8a8a8;
    color: #000000;
}

.floating-sub-btn-whatsapp {
    background: #bebebe;
    color: #000000;
}

.floating-sub-btn-whatsapp:hover {
    background: #a8a8a8;
    color: #000000;
}

.floating-sub-btn-email {
    background: #bebebe;
    color: #000000;
}

.floating-sub-btn-email:hover {
    background: #a8a8a8;
    color: #000000;
}

.floating-sub-btn-chat {
    background: #bebebe;
    color: #000000;
}

.floating-sub-btn-chat:hover {
    background: #a8a8a8;
    color: #000000;
}

/* 工具提示 */
.floating-sub-btn::before {
    content: attr(aria-label);
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

.floating-sub-btn::after {
    content: '';
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: rgba(0, 0, 0, 0.8);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.floating-sub-btn:hover::before,
.floating-sub-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

/* 响应式设计 */
/* @media (max-width: 768px) {
    .floating-buttons {
        bottom: 20px;
        right: 20px;
    }
    
    .floating-main-btn {
        width: 50px;
        height: 50px;
    }
    
    .floating-main-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .floating-sub-btn {
        width: 50px;
        height: 50px;
    }
    
    .floating-sub-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .floating-sub-buttons {
        bottom: 60px;
        gap: 12px;
    }
    
    .floating-sub-btn::before {
        font-size: 11px;
        padding: 6px 10px;
        right: 55px;
    }
    
    .floating-sub-btn::after {
        right: 45px;
    }
}

@media (max-width: 480px) {
    .floating-buttons {
        bottom: 15px;
        right: 15px;
    }
    
    .floating-main-btn {
        width: 48px;
        height: 48px;
    }
    
    .floating-main-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .floating-sub-btn {
        width: 48px;
        height: 48px;
    }
    
    .floating-sub-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .floating-sub-buttons {
        bottom: 58px;
        gap: 10px;
    }
} */

.floating-sub-btn.clicked {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

/* 子按钮动画类 */
.floating-sub-btn.animate-in {
    opacity: 1;
    transform: scale(1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-sub-btn.animate-out {
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}


/* 隐藏工具提示在小屏幕上 */
@media (max-width: 640px) {
    .floating-sub-btn::before,
    .floating-sub-btn::after {
        display: none;
    }
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
    .floating-main-btn,
    .floating-sub-btn,
    .floating-sub-buttons {
        transition: none;
    }
    
    .floating-main-btn:not(.active) {
        animation: none;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .floating-main-btn {
        border: 2px solid #000;
    }
    
    .floating-sub-btn {
        border: 1px solid #000;
    }
}
