/* 全站左侧悬浮联系方式 */
/* 注意：外层不能带 transform，否则会成为内部 fixed 弹窗的定位基准 */
.swyfy-floating-contact {
    font-family: "Source Han Sans", "Microsoft YaHei", sans-serif;
}

.swyfy-floating-bar {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 99990;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 6px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid #e5e5e5;
    border-left: none;
    border-radius: 0 8px 8px 0;
    box-shadow: 2px 2px 12px rgba(0, 0, 0, 0.1);
}

.swyfy-fc-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 56px;
    min-height: 56px;
    padding: 8px 4px;
    border: none;
    border-radius: 6px;
    background: #f7f7f7;
    color: #333;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    box-sizing: border-box;
}

.swyfy-fc-btn:hover,
.swyfy-fc-btn:focus {
    background: #eef8e8;
    color: #4a8f1f;
    outline: none;
}

.swyfy-fc-whatsapp {
    background: #e8f8ec;
    color: #128c7e;
}

.swyfy-fc-whatsapp:hover {
    background: #25d366;
    color: #fff;
}

.swyfy-fc-phone {
    background: #eef6ff;
    color: #1a6fb5;
}

.swyfy-fc-phone:hover {
    background: #1a6fb5;
    color: #fff;
}

.swyfy-fc-facebook {
    background: #eaf0fb;
    color: #1877f2;
}

.swyfy-fc-facebook:hover {
    background: #1877f2;
    color: #fff;
}

.swyfy-fc-facebook .swyfy-fc-icon {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    font-style: italic;
}

.swyfy-fc-message {
    background: #fff5e8;
    color: #d97706;
}

.swyfy-fc-message:hover,
.swyfy-fc-message.is-active {
    background: #68b030;
    color: #fff;
}

.swyfy-fc-icon {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.swyfy-fc-label {
    font-size: 10px;
    line-height: 1.2;
    text-align: center;
    word-break: break-all;
}

/* 询单面板：屏幕居中弹窗 */
.swyfy-floating-panel {
    position: fixed;
    left: 50%;
    top: 50%;
    width: 380px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 48px);
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.22s ease, opacity 0.22s ease, visibility 0.22s;
    z-index: 99991;
    overflow-y: auto;
}

body.swyfy-fc-open .swyfy-floating-panel {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}

.swyfy-floating-panel-inner {
    padding: 20px 16px 24px;
    position: relative;
}

.swyfy-fc-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    color: #666;
    cursor: pointer;
}

.swyfy-fc-close:hover {
    background: #e0e0e0;
    color: #333;
}

.swyfy-fc-title {
    margin: 0 0 6px;
    font-size: 18px;
    color: #333;
}

.swyfy-fc-subtitle {
    margin: 0 0 16px;
    font-size: 13px;
    color: #888;
}

.swyfy-floating-form .swyfy-fc-field {
    margin-bottom: 12px;
}

.swyfy-floating-form input,
.swyfy-floating-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    font-family: inherit;
}

.swyfy-floating-form input:focus,
.swyfy-floating-form textarea:focus {
    border-color: #68b030;
    outline: none;
}

.swyfy-fc-captcha {
    display: flex;
    gap: 8px;
    align-items: center;
}

.swyfy-fc-captcha input {
    flex: 1;
}

.swyfy-fc-captcha-img {
    width: 90px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    object-fit: cover;
}

.swyfy-fc-error {
    margin: 0 0 10px;
    font-size: 13px;
    color: #c0392b;
}

.swyfy-fc-submit {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 4px;
    background: #68b030;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
}

.swyfy-fc-submit:hover {
    background: #5a9a28;
}

.swyfy-fc-submit:disabled {
    background: #aaa;
    cursor: not-allowed;
}

.swyfy-floating-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 99989;
}

body.swyfy-fc-open .swyfy-floating-backdrop {
    display: block;
}

/* 阿拉伯语：悬浮栏改到右侧 */
html[lang="ar"] .swyfy-floating-bar {
    left: auto;
    right: 0;
    border-left: 1px solid #e5e5e5;
    border-right: none;
    border-radius: 8px 0 0 8px;
}

html[lang="ar"] .swyfy-floating-panel {
    direction: rtl;
    text-align: right;
}

html[lang="ar"] .swyfy-fc-close {
    right: auto;
    left: 10px;
}

/* 移动端 H5 */
@media (max-width: 991px) {
    .swyfy-floating-bar {
        top: auto;
        bottom: 80px;
        transform: none;
        flex-direction: row;
        gap: 6px;
        border-left: 1px solid #e5e5e5;
        border-radius: 8px;
        margin-left: 8px;
        padding: 6px;
    }

    .swyfy-fc-btn {
        width: 44px;
        min-height: 44px;
        padding: 6px 2px;
    }

    .swyfy-fc-label {
        display: none;
    }

    /* 居中弹窗在小屏下留出顶栏空间，可滚动 */
    .swyfy-floating-panel {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 72px);
        top: calc(50% + 16px);
    }

    .swyfy-floating-panel-inner {
        padding: 16px 14px 20px;
    }

    .swyfy-floating-form input,
    .swyfy-floating-form textarea {
        font-size: 16px; /* 避免 iOS 聚焦时自动放大 */
    }

    .swyfy-fc-submit {
        padding: 13px;
    }

    html[lang="ar"] .swyfy-floating-bar {
        right: auto;
        left: 0;
        margin-left: 8px;
        margin-right: 0;
    }
}

@media (max-width: 575px) {
    .swyfy-floating-bar {
        bottom: 64px;
    }

    .swyfy-fc-btn {
        width: 42px;
        min-height: 42px;
    }
}
