/* Container */
.hbc-float-container {
    position: fixed;
    display: flex;
    flex-direction: column;
    gap: 25px;
    z-index: 9999;
    transition: transform .2s ease;
    max-width: 90vw;
    max-height: 90vh;
    will-change: transform;
}

/* ===== POSITIONS ===== */
.hbc-float-container.pos-bottom-left {
    left: 20px;
    bottom: 40px;
    transform-origin: bottom left;
}

.hbc-float-container.pos-bottom-right {
    right: 20px;
    bottom: 40px;
    transform-origin: bottom right;
}

.hbc-float-container.pos-top-left {
    left: 20px;
    top: 60px;
    transform-origin: top left;
}

.hbc-float-container.pos-top-right {
    right: 20px;
    top: 60px;
    transform-origin: top right;
}

/* Mobile */
@media (max-width: 768px) {

    .hbc-float-container.pos-bottom-left,
    .hbc-float-container.pos-bottom-right {
        bottom: 90px;
    }
}

/* Button shared */
.hbc-float-btn {
    position: relative;
    width: 50px;
    height: 50px;
    aspect-ratio: 1/1;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow:
        0 0 0 8px color-mix(in srgb, currentColor 35%, transparent),
        0 6px 16px rgba(0, 0, 0, 0.25);

    animation: pulseZoom 1.2s infinite;
    overflow: visible;
}

/* ware area */
.hbc-float-btn::before {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: color-mix(in srgb, currentColor 35%, transparent);
    opacity: 0.35;
    animation: ripple 1.2s infinite;
}

/* Icon */
.hbc-float-btn::after {
    content: "";
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 60%;
    animation: iconShake 0.8s infinite;
}

button.hbc-float-btn {
    -webkit-appearance: none;
    appearance: none;
    border: 5px solid currentColor !important;
    line-height: 1 !important;
    font-size: 0 !important;
}

/* ICON */
.hbc-phone-btn::after {
    background-image: url('../images/phone.png');
    background-size: 30px;
}

.hbc-zalo-btn::after {
    background-image: url('../images/zalo.png');
    background-size: 30px;
}

.hbc-contact-btn::after {
    background-image: url('../images/mail.png');
    background-size: 30px;
}

.hbc-telegram-btn::after {
    background-image: url('../images/telegram.png');
    background-size: 30px;
}

.hbc-instagram-btn::after {
    background-image: url('../images/instagram.png');
    background-size: 30px;
}

.hbc-youtube-btn::after {
    background-image: url('../images/youtube.png');
    background-size: 30px;
}

.hbc-tiktok-btn::after {
    background-image: url('../images/tiktok.png');
    background-size: 30px;
}

.hbc-fanpage-btn::after {
    background-image: url('../images/facebook.png');
    background-size: 30px;
}

.hbc-messenger-btn::after {
    background-image: url('../images/messenger.png');
    background-size: 30px;
}

.hbc-email-btn::after {
    background-image: url('../images/mail.png');
    background-size: 30px;
}

.hbc-viber-btn::after {
    background-image: url('../images/viber.png');
    background-size: 30px;
}

.hbc-whatsapp-btn::after {
    background-image: url('../images/whatsapp.png');
    background-size: 30px;
}

/* Text Button Support */
.hbc-btn-has-text::after {
    display: none !important;
}

.hbc-btn-text {
    font-size: 11px;
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
    padding: 2px;
    text-transform: uppercase;
    color: #fff;
    z-index: 2;
}

/* Popup form */
.hbc-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .7);
    display: none;
    z-index: 99999;
    backdrop-filter: blur(5px);
    padding: 20px;
}

.hbc-popup-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.hbc-popup {
    background: #fff;
    width: 100%;
    max-width: 500px;
    padding: 0;
    border-radius: 16px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: popupFadeIn 0.3s ease-out;
    overflow: hidden;
    /* Ensure content follows popup border radius */
}

.hbc-popup-close {
    position: absolute;
    right: 10px;
    top: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 28px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    line-height: 1;
    padding: 0;
    transition: all 0.2s;
}

.hbc-popup-close:hover {
    color: #000;
    transform: scale(1.1);
}

/* Template 1: Premium Blue/White */
.hbc-form-template_1 {
    max-width: 850px;
}

.hbc-tpl-1-wrapper {
    display: flex;
    min-height: 450px;
}

.hbc-tpl-1-left {
    flex: 6;
    padding: 40px;
}

.hbc-tpl-1-right {
    flex: 4;
    background: #f8fafc;
    padding: 40px;
    border-left: 1px solid #edf2f7;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.hbc-tpl-1-right::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 20px;
    height: 20px;
    background: #fff;
    border-left: 1px solid #edf2f7;
    border-bottom: 1px solid #edf2f7;
}

.hbc-tpl-logo {
    max-width: 120px;
    margin-bottom: 25px;
}

.hbc-tpl-heading {
    margin: 0 0 5px 0;
    font-size: 24px;
    color: var(--primary-color, #0068ff);
    font-weight: 700;
}

.hbc-tpl-subheading {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: var(--primary-color, #0068ff);
    opacity: 0.8;
    font-weight: 600;
}

.hbc-tpl-desc {
    font-size: 15px;
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 30px;
}

.hbc-tpl-contact-btns {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hbc-tpl-btn-zalo,
.hbc-tpl-btn-phone {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hbc-tpl-btn-zalo {
    background: #0068ff;
    color: #fff;
}

.hbc-tpl-btn-zalo:hover {
    color: #fff !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 104, 255, 0.3);
}

.hbc-tpl-btn-zalo img {
    width: 24px;
    height: 24px;
    transition: transform 0.3s;
}

.hbc-tpl-btn-zalo:hover img {
    transform: scale(1.1);
}

.hbc-tpl-btn-phone {
    background: #e53e3e;
    color: #fff;
}

.hbc-tpl-btn-phone:hover {
    color: #fff !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(229, 62, 62, 0.3);
}

.hbc-tpl-btn-phone i {
    font-size: 20px;
    transition: transform 0.3s;
}

.hbc-tpl-btn-phone:hover i {
    transform: rotate(15deg) scale(1.1);
}

/* Template 2: Gray Sidebar */
.hbc-form-template_2 {
    max-width: 800px;
}

.hbc-tpl-2-wrapper {
    display: flex;
}

.hbc-tpl-2-sidebar {
    flex: 4;
    background: #f3f4f6;
    padding: 40px;
}

.hbc-tpl-2-main {
    flex: 6;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    /* Stretch to full width for alignment control */
}

.hbc-tpl-2-main .wpcf7 {
    width: 100%;
}

.hbc-tpl-2-main .wpcf7-form-control.wpcf7-submit {
    width: 100% !important;
    margin-top: 20px !important;
}

.hbc-tpl-2-main .wpcf7-form-control-wrap {
    text-align: left;
}

.hbc-tpl-2-sidebar .hbc-tpl-heading {
    font-size: 26px;
    text-transform: uppercase;
    color: var(--primary-color, #0068ff);
    margin-bottom: 15px;
    line-height: 1.2;
}

.hbc-tpl-contact-list {
    list-style: none;
    padding: 0;
    margin: 30px 0 0 0;
}

.hbc-tpl-contact-list li {
    margin-bottom: 15px;
    font-size: 14px;
    color: #444;
}

/* Default popup padding if no template used */
.hbc-form-default {
    padding: 30px;
}

/* CF7 Common styles in popup */
.hbc-popup .wpcf7-form-control-wrap {
    display: block;
    margin-bottom: 15px;
}

.hbc-popup input:not([type="submit"]),
.hbc-popup textarea,
.hbc-popup select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.hbc-popup input:focus,
.hbc-popup textarea:focus {
    border-color: var(--primary-color, #0068ff);
    box-shadow: 0 0 0 3px rgba(0, 104, 255, 0.2);
}

.hbc-popup input[type="submit"] {
    width: 100%;
    background: var(--primary-color, #0068ff);
    color: #fff;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Templates */
@media (max-width: 768px) {

    .hbc-tpl-1-wrapper,
    .hbc-tpl-2-wrapper {
        flex-direction: column;
    }

    .hbc-tpl-1-right::before {
        display: none;
    }

    .hbc-tpl-1-left,
    .hbc-tpl-1-right,
    .hbc-tpl-2-sidebar,
    .hbc-tpl-2-main {
        padding: 25px;
    }

    /* Mobile Height Optimization */
    .hbc-popup {
        max-height: 80vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .hbc-popup-overlay {
        padding: 15px;
        align-items: center;
        /* Center the 80% height popup */
    }
}

/* Hide on devices */

/* Hide on Desktop */
@media (min-width: 1025px) {
    .hbc-hide-desktop {
        display: none !important;
    }
}

/* Hide on Tablet */
@media (min-width: 768px) and (max-width: 1024px) {
    .hbc-hide-tablet {
        display: none !important;
    }
}

/* Hide on Mobile */
@media (max-width: 767px) {
    .hbc-hide-mobile {
        display: none !important;
    }
}


/* Animations */
@keyframes pulseZoom {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes ripple {
    0% {
        transform: scale(0.9);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

@keyframes iconShake {

    0%,
    100% {
        transform: rotate(0);
    }

    25% {
        transform: rotate(-10deg);
    }

    50% {
        transform: rotate(10deg);
    }

    75% {
        transform: rotate(-10deg);
    }
}

/* Mobile size */
/* Mobile size */
@media(max-width: 768px) {
    .hbc-float-btn {
        width: 45px;
        height: 45px;
        box-shadow:
            0 0 0 6px color-mix(in srgb, currentColor 35%, transparent),
            0 4px 12px rgba(0, 0, 0, 0.2);
    }
}