/**
 * CSS for BK Liên Hệ (Contact Floating Widget)
 * Author: Bùi Đức Hạnh (https://buhaweb.com/)
 * Compatible with Kit 4 Global Design System
 */

.bdh-bk-contact-wrap {
    position: fixed;
    bottom: var(--bdh-contact-bottom-desktop, 114px);
    right: 0;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.3;
}

@media (max-width: 767px) {
    .bdh-bk-contact-wrap {
        bottom: var(--bdh-contact-bottom-mobile, 60px);
        right: 12px;
    }
}

/* ==========================================================================
   Desktop Panel
   ========================================================================== */
.bdh-bk-contact-desktop {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    user-select: none;
}

.bdh-bk-contact-panel {
    position: relative;
    width: 245px;
    background: #ffffff;
    border: 1px solid rgba(229, 231, 235, 0.95);
    border-right: none;
    border-radius: 18px 0 0 18px;
    padding: 8px;
    color: #111827;
    box-shadow: -6px 4px 24px rgba(0, 0, 0, 0.12), -2px 2px 8px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transform: translateX(0);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsed State: Slide to the right, showing only the 3 round icons (66px visible) */
.bdh-bk-contact-wrap.is-collapsed .bdh-bk-contact-panel {
    transform: translateX(calc(100% - 66px));
}

/* Toggle Arrow Button */
.bdh-bk-contact-toggle-btn {
    position: absolute;
    left: -12px;
    top: 16px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #64748b;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.2s ease;
    outline: none;
    padding: 0;
}

.bdh-bk-contact-toggle-btn:hover {
    transform: scale(1.12);
    color: #0f172a;
    border-color: #cbd5e1;
}

.bdh-bk-contact-toggle-btn i {
    font-size: 10px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When expanded: icon points right (chevron-right). When collapsed: icon points left (rotated) */
.bdh-bk-contact-wrap.is-collapsed .bdh-bk-contact-toggle-btn i {
    transform: rotate(180deg);
}

/* ==========================================================================
   Item Row Link
   ========================================================================== */
.bdh-bk-contact-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px;
    border-radius: 12px;
    text-decoration: none !important;
    color: inherit;
    transition: background-color 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.bdh-bk-contact-item:hover {
    background-color: #f8fafc;
}

/* Icon Wrap 42x42 */
.bdh-bk-contact-icon-wrap {
    position: relative;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bdh-bk-contact-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease;
}

.bdh-bk-contact-item:hover .bdh-bk-contact-icon {
    transform: scale(1.06);
}

/* Messenger Icon */
.bdh-bk-contact-icon--messenger {
    background: radial-gradient(circle at 30% 107%, #0099ff 0%, #a033ff 60%, #ff5280 90%, #ff7061 100%);
}

.bdh-bk-contact-icon--messenger svg {
    width: 22px;
    height: 22px;
    fill: #ffffff;
}

/* Red status dot on messenger */
.bdh-bk-contact-status-dot {
    position: absolute;
    top: -1px;
    right: -1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ff3b30;
    border: 2px solid #ffffff;
}

/* Zalo Icon */
.bdh-bk-contact-icon--zalo {
    border-radius: 16px;
    background-color: #0068ff;
}

.bdh-bk-contact-icon--zalo span {
    color: #ffffff;
    font-size: 15px;
    font-weight: 900;
    letter-spacing: -0.5px;
    font-family: Inter, system-ui, -apple-system, sans-serif;
}

/* Phone Icon */
.bdh-bk-contact-icon--phone {
    background-color: #feebe8;
}

.bdh-bk-contact-icon--phone i {
    font-size: 18px;
    color: #e5262b;
}

.bdh-bk-contact-icon--phone svg {
    width: 20px;
    height: 20px;
    fill: #e5262b;
}

.bdh-bk-contact-icon--zalo svg {
    width: 22px;
    height: 22px;
    fill: #ffffff;
}

.bdh-bk-contact-icon--zalo i {
    font-size: 20px;
    color: #ffffff;
}

.bdh-bk-contact-icon .elementor-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.bdh-bk-contact-toggle-btn svg {
    width: 10px;
    height: 10px;
    fill: currentColor;
    display: block;
}

.bdh-bk-contact-btn-headset svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    display: block;
}

.bdh-bk-contact-btn-scrolltop svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    display: block;
}

/* Info Text */
.bdh-bk-contact-info {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
}

.bdh-bk-contact-title {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.2px;
    transition: color 0.2s ease;
}

.bdh-bk-contact-desc {
    margin-top: 2px;
    font-size: 12px;
    font-weight: 400;
    color: #64748b;
}

.bdh-bk-contact-item:hover .bdh-bk-contact-title.title-fb {
    color: #0084ff;
}

.bdh-bk-contact-item:hover .bdh-bk-contact-title.title-phone {
    color: #e5262b;
}

/* ==========================================================================
   Zalo Accordion Submenu
   ========================================================================== */
.bdh-bk-contact-zalo-block {
    display: flex;
    flex-direction: column;
}

.bdh-bk-contact-zalo-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px;
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.bdh-bk-contact-zalo-trigger:hover {
    background-color: #f8fafc;
}

.bdh-bk-contact-zalo-block.is-open .bdh-bk-contact-zalo-trigger {
    border-color: #0068ff;
    background-color: #ffffff;
}

.bdh-bk-contact-zalo-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bdh-bk-contact-zalo-block.is-open .title-zalo {
    color: #0068ff;
}

.bdh-bk-contact-zalo-chevron {
    padding-right: 4px;
    color: #94a3b8;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.bdh-bk-contact-zalo-chevron svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
    display: inline-block;
    vertical-align: middle;
    transition: fill 0.2s ease;
}

.bdh-bk-contact-zalo-chevron i {
    font-size: 12px;
    line-height: 1;
}

.bdh-bk-contact-zalo-block.is-open .bdh-bk-contact-zalo-chevron {
    transform: rotate(180deg);
    color: #0068ff;
}

.bdh-bk-contact-zalo-sub {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid #f1f5f9;
    border-radius: 14px;
    padding: 0 4px;
    margin-top: 0;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, margin 0.25s ease, padding 0.25s ease;
}

.bdh-bk-contact-zalo-block.is-open .bdh-bk-contact-zalo-sub {
    max-height: 280px;
    opacity: 1;
    padding: 4px 6px;
    margin-top: 4px;
}

.bdh-bk-contact-zalo-sub-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 8px;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.bdh-bk-contact-zalo-sub-link:hover {
    background-color: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.bdh-bk-contact-zalo-mini-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background-color: #0068ff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bdh-bk-contact-zalo-mini-icon span {
    color: #ffffff;
    font-size: 9.5px;
    font-weight: 900;
    font-family: Inter, system-ui, -apple-system, sans-serif;
}

.bdh-bk-contact-zalo-sub-name {
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.bdh-bk-contact-zalo-sub-link:hover .bdh-bk-contact-zalo-sub-name {
    color: #0068ff;
}

/* ==========================================================================
   Mobile Elements
   ========================================================================== */
.bdh-bk-contact-mobile {
    display: none;
}

@media (max-width: 767px) {
    .bdh-bk-contact-desktop {
        display: none !important;
    }

    .bdh-bk-contact-mobile {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .bdh-bk-contact-btn-headset {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: #e5262b;
        color: #ffffff;
        box-shadow: 0 4px 14px rgba(229, 38, 43, 0.4);
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        cursor: pointer;
        font-size: 20px;
        transition: transform 0.2s ease;
        outline: none;
    }

    .bdh-bk-contact-btn-headset:active {
        transform: scale(0.92);
    }

    .bdh-bk-contact-btn-scrolltop {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: #111827;
        color: #ffffff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        cursor: pointer;
        font-size: 16px;
        transition: all 0.3s ease;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        outline: none;
    }

    .bdh-bk-contact-btn-scrolltop.is-visible {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .bdh-bk-contact-btn-scrolltop:hover {
        background: #000000;
    }

    /* Mobile Popup Modal */
    .bdh-bk-contact-mobile-modal {
        position: fixed;
        bottom: 75px;
        right: 15px;
        width: 250px;
        background: #ffffff;
        border-radius: 18px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
        border: 1px solid #e2e8f0;
        padding: 8px;
        display: flex;
        flex-direction: column;
        gap: 4px;
        opacity: 0;
        visibility: hidden;
        transform: scale(0.9) translateY(10px);
        transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 100000;
    }

    .bdh-bk-contact-mobile-modal.is-open {
        opacity: 1;
        visibility: visible;
        transform: scale(1) translateY(0);
    }
}
