/* ============================================================
   Vn4u Contact Widget — v2.0.0
   ============================================================ */

/* ── DESKTOP: Sidebar cố định bên phải ── */
#hdev-remote-widget {
    display: flex;
    flex-direction: column;
    position: fixed;
    padding: 5px;
    bottom: 18%;
    right: 5px;
    background: #ddd;
    border: 1px solid #f2f2f2;
    border-radius: 10px;
    z-index: 9990;
    max-width: 90px;
}

.hdev-remote-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    margin: 7px 0;
    color: #515151;
    font-weight: 600;
    font-size: 12px;
    text-decoration: none !important;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.hdev-remote-item:hover {
    opacity: 0.8;
    transform: scale(1.08);
    color: #515151;
    text-decoration: none !important;
}

.hdev-remote-item img {
    width: 40px;
    height: auto;
    margin-bottom: 2px;
}

/* ── Nút ĐĂNG KÝ TƯ VẤN (Desktop) ── */
.hdev-cta-btn {
    right: 5px;
    width: 200px;
    position: fixed;
    background: #e53935;
    border: none;
    cursor: pointer;
    text-align: center;
    bottom: 12%;
    border-radius: 20px;
    padding: 9px 8px;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    font-family: inherit;
    z-index: 9990;
    letter-spacing: 0.3px;
    line-height: 1.4;
    margin: 0;
    text-decoration: none !important;
    transition: background 0.25s ease, transform 0.2s ease;
    box-shadow: 0 3px 10px rgba(229, 57, 53, 0.45);
}

.hdev-cta-btn:hover {
    background: #c62828;
    color: #fff;
    transform: scale(1.04);
}

/* ── MOBILE (≤ 549px): Bottom bar ngang ── */
@media (max-width: 549px) {
    #hdev-remote-widget {
        bottom: 0;
        right: 0;
        width: 100%;
        flex-direction: row;
        max-width: 100%;
        border-radius: 0;
        padding: 4px 0;
        padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px));
    }

    .hdev-remote-item {
        width: 25%;
        margin: 0;
        padding: 4px 0;
    }

    .hdev-remote-item img {
        width: 40px;
    }
}

/* ── Animation nút CTA mobile ── */
@keyframes hdev-cta-pulse {

    0%,
    100% {
        box-shadow: 0 4px 14px rgba(229, 57, 53, 0.45);
    }

    50% {
        box-shadow: 0 6px 24px rgba(229, 57, 53, 0.75);
    }
}

/* ════════════════════════════════════════
   POPUP MODAL
════════════════════════════════════════ */
.hdev-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.hdev-modal-overlay.hdev-open {
    display: flex;
}

.hdev-modal-box {
    background: #fff;
    border-radius: 14px;
    padding: 32px 28px 28px;
    max-width: 480px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: hdev-modal-in 0.25s ease;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes hdev-modal-in {
    from {
        opacity: 0;
        transform: translateY(-18px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Nút đóng — sát góc trên phải */
.hdev-modal-close {
    position: absolute;
    top: 2px;
    right: 6px;
    background: none;
    border: none;
    font-size: 28px;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s;
}

.hdev-modal-close:hover {
    color: #333;
}

/* Tiêu đề & mô tả */
.hdev-modal-title {
    color: #2e7d32;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    margin: 0 0 8px;
    letter-spacing: 0.5px;
}

.hdev-modal-subtitle {
    color: #888;
    font-size: 13px;
    text-align: center;
    margin-bottom: 20px;
}

/* ── CF7 form bên trong popup ── */
.hdev-modal-form .wpcf7-form {
    margin: 0;
}

.hdev-modal-form .wpcf7-form p {
    margin-bottom: 12px;
}

.hdev-modal-form input[type="text"],
.hdev-modal-form input[type="email"],
.hdev-modal-form input[type="tel"],
.hdev-modal-form textarea {
    width: 100% !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    padding: 11px 14px !important;
    font-size: 14px !important;
    box-shadow: none !important;
    outline: none !important;
    transition: border-color 0.2s !important;
    box-sizing: border-box !important;
}

/* Select riêng — native + Flatsome nice-select */
.hdev-modal-form select {
    width: 100% !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    color: #333 !important;
    box-shadow: none !important;
    outline: none !important;
    box-sizing: border-box !important;
}

/* Flatsome nice-select wrapper */
.hdev-modal-form .nice-select {
    width: 100% !important;
    border: 1px solid #ddd !important;
    border-radius: 6px !important;
    padding: 0 36px 0 14px !important;
    height: 44px !important;
    line-height: 44px !important;
    font-size: 14px !important;
    color: #333 !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    float: none !important;
}

/* Chữ hiển thị trong nice-select */
.hdev-modal-form .nice-select .current {
    display: block !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    color: #333 !important;
    line-height: 44px !important;
}

/* Danh sách option khi mở */
.hdev-modal-form .nice-select .list {
    width: 100% !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
}

.hdev-modal-form .nice-select .option {
    font-size: 14px !important;
    padding: 8px 14px !important;
}

.hdev-modal-form input:focus,
.hdev-modal-form select:focus,
.hdev-modal-form textarea:focus {
    border-color: #2e7d32 !important;
}

.hdev-modal-form input[type="submit"] {
    width: 100% !important;
    background: #2e7d32 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 30px !important;
    padding: 4px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    letter-spacing: 0.5px !important;
    transition: background 0.25s !important;
    margin-top: 4px !important;
}

.hdev-modal-form input[type="submit"]:hover {
    background: #1b5e20 !important;
}

/* ── Responsive popup ── */
@media (max-width: 549px) {
    .hdev-modal-box {
        padding: 24px 18px 20px;
        border-radius: 10px;
    }

    .hdev-modal-title {
        font-size: 18px;
    }
}