/* ==========================================================================
   HVD CONTACT BUTTONS & SYSTEMS CSS
   ========================================================================== */

/* 1. Desktop Contact Bar (Float Right Bottom) */
.hvd-contact-desktop {
    position: fixed;
    right: 20px;
    bottom: 80px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hvd-contact-desktop .contact-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    position: relative;
}

.hvd-contact-desktop .contact-btn:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.hvd-contact-desktop .contact-btn svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
    transition: transform 0.3s ease;
}

.hvd-contact-desktop .contact-btn:hover svg {
    transform: rotate(15deg);
}

/* 2. Color System for Contact Buttons (Float Layouts on Desktop & Mobile Layout 2) */
.hvd-contact-desktop .btn-zalo,
.hvd-mobile-float-right .m-zalo {
    background-color: #89cbff !important;
}

.hvd-contact-desktop .btn-phone-main,
.hvd-mobile-float-right .m-phone-main {
    background-color: #2ecc71 !important;
}

.hvd-contact-desktop .btn-phone-sub,
.hvd-mobile-float-right .m-phone-sub {
    background-color: #10b981 !important;
}

.hvd-contact-desktop .btn-maps,
.hvd-mobile-float-right .m-maps {
    background-color: #e67e22 !important;
}

.hvd-contact-desktop .btn-email,
.hvd-mobile-float-right .m-email {
    background-color: #ea4335 !important;
}

.hvd-contact-desktop .btn-contact,
.hvd-mobile-float-right .m-contact-toggle,
.hvd-mobile-float-right .m-form-toggle {
    background-color: #446084 !important;
    /* Base color or CSS variable fallback */
}


/* 3. Pulse Animation for Main Interactive Buttons (Desktop) */
@keyframes hvd-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.6);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(46, 204, 113, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
    }
}

@keyframes hvd-zalo-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 104, 255, 0.6);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(0, 104, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 104, 255, 0);
    }
}

.btn-phone-main {
    animation: hvd-pulse 2s infinite;
}

.btn-zalo {
    animation: hvd-zalo-pulse 2s infinite;
}

/* 4. Mobile Bottom Bar Layout (Layout 1) */
.hvd-contact-mobile {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #ffffff;
    box-shadow: 0 -3px 20px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
}

@media (min-width: 768px) {
    .hvd-contact-mobile {
        display: none !important;
    }
}

.hvd-mobile-col {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-around;
}

.hvd-mobile-left {
    padding-right: 10px;
}

.hvd-mobile-right {
    padding-left: 10px;
}

.hvd-mobile-center {
    flex: 0 0 65px;
    justify-content: center;
    position: relative;
}

/* Floating Center Phone Button on Mobile Bottom Bar */
.hvd-mobile-center .m-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #2ecc71;
    color: #fff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(-16px);
    border: 3px solid #fff;
    transition: transform 0.2s ease;
}

.hvd-mobile-center .m-btn:active {
    transform: translateY(-16px) scale(0.92);
}

.hvd-mobile-center .m-btn svg {
    width: 26px;
    height: 26px;
    stroke: #fff;
}

/* Outer buttons (left and right columns) on Mobile */
.hvd-mobile-left .m-btn,
.hvd-mobile-right .m-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #475569;
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
    flex: 1;
    line-height: 1.2;
}

.hvd-mobile-left .m-btn svg,
.hvd-mobile-right .m-btn svg {
    margin-bottom: 3px;
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.hvd-mobile-left .m-btn:active,
.hvd-mobile-right .m-btn:active {
    transform: scale(0.95);
}

/* Mobile highlights matching actions */
.hvd-mobile-left .m-btn.m-zalo,
.hvd-mobile-right .m-btn.m-zalo {
    color: #0068ff;
}

.hvd-mobile-left .m-btn.m-phone-sub,
.hvd-mobile-right .m-btn.m-phone-sub {
    color: #10b981;
}

.hvd-mobile-left .m-btn.m-maps,
.hvd-mobile-right .m-btn.m-maps {
    color: #e67e22;
}

.hvd-mobile-left .m-btn.m-email,
.hvd-mobile-right .m-btn.m-email {
    color: #ea4335;
}

.hvd-mobile-left .m-btn.m-contact-toggle,
.hvd-mobile-right .m-btn.m-contact-toggle {
    color: #446084;
}

.hvd-mobile-left .m-btn.m-form-toggle,
.hvd-mobile-right .m-btn.m-form-toggle {
    color: #446084;
}

/* Adjust default spacing for flatsome footer to avoid overlap with bottom menu */
@media (max-width: 767px) {
    body {
        padding-bottom: 60px !important;
    }
}

/* 5. Popup Dialogs System */
.hvd-contact-popup {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.hvd-contact-popup.active {
    opacity: 1;
    visibility: visible;
}

.hvd-popup-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}

.hvd-popup-content {
    background: #ffffff;
    width: 90%;
    max-width: 420px;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 2;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hvd-contact-popup.active .hvd-popup-content {
    transform: scale(1);
}

.hvd-popup-header {
    background: #446084;
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hvd-popup-header h4 {
    margin: 0;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hvd-popup-close {
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    color: rgba(255, 255, 255, 0.8);
    transition: color 0.2s ease;
}

.hvd-popup-close:hover {
    color: #ffffff;
}

.hvd-popup-body {
    padding: 24px;
}

.hvd-popup-body p {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #475569;
}

.hvd-popup-body p:last-child {
    margin-bottom: 0;
}

.hvd-popup-body p svg {
    flex-shrink: 0;
}

.hvd-popup-body p a {
    color: #0f172a;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.hvd-popup-body p a:hover {
    color: #0068ff;
}

/* 6. Form inside Popup */
.theme-contact-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
    width: 100%;
}

.theme-contact-form label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
    display: block;
}

.theme-contact-form input[type="text"],
.theme-contact-form input[type="tel"],
.theme-contact-form input[type="email"],
.theme-contact-form textarea {
    width: 100% !important;
    padding: 10px 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    color: #1e293b !important;
    background: #ffffff !important;
    box-shadow: none !important;
    transition: all 0.2s ease !important;
    margin-bottom: 0 !important;
}

.theme-contact-form input:focus,
.theme-contact-form textarea:focus {
    border-color: #446084 !important;
    box-shadow: 0 0 0 3px rgba(68, 96, 132, 0.15) !important;
    outline: none !important;
}

.theme-contact-form textarea {
    resize: vertical;
    min-height: 80px;
}

.submit-contact-btn {
    background: #446084 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 12px 20px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.3s ease !important;
    width: 100% !important;
    height: auto !important;
    line-height: 1.5 !important;
}

.submit-contact-btn:hover {
    background: #354a66 !important;
    transform: translateY(-1px);
}

.submit-contact-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Spinner for Loading State */
.submit-contact-btn .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: none;
}

.submit-contact-btn.is-loading .spinner {
    display: block;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 7. Toast Alerts System */
#theme-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.theme-toast {
    background: #1e293b;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
}

.theme-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.theme-toast.success {
    background: #10b981;
}

.theme-toast.error {
    background: #ef4444;
}

/* ==========================================================================
   8. Mobile Float Right Layout (Layout 2)
   ========================================================================== */
.hvd-mobile-float-right {
    position: fixed;
    right: 16px;
    bottom: 80px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
    width: auto !important;
    left: auto !important;
    background: transparent !important;
    box-shadow: none !important;
    height: auto !important;
    padding: 0 !important;
}

@media (min-width: 768px) {
    .hvd-mobile-float-right {
        display: none !important;
    }
}

.hvd-mobile-float-right .float-m-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    position: relative;
}

.hvd-mobile-float-right .float-m-btn:hover,
.hvd-mobile-float-right .float-m-btn:active {
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.hvd-mobile-float-right .float-m-btn svg {
    width: 22px;
    height: 22px;
    stroke: #ffffff;
    transition: transform 0.3s ease;
}

.hvd-mobile-float-right .float-m-btn:hover svg,
.hvd-mobile-float-right .float-m-btn:active svg {
    transform: rotate(15deg);
}

/* Animations for Mobile Float Right (Layout 2) */
.hvd-mobile-float-right .float-m-btn.btn-phone-main {
    animation: hvd-pulse 2s infinite;
}

.hvd-mobile-float-right .float-m-btn.btn-zalo {
    animation: hvd-zalo-pulse 2s infinite;
}