/* --- ÉP LAYER CAO NHẤT CHO CẢ CỤM BAR-FIXED VÀ POPUP --- */
.bar-fixed {
    z-index: 9999999 !important;
}
.cb-widget-wrapper {
    position: relative;
    z-index: 9999999 !important;
    margin-bottom: 10px;
}

/* Nút bấm tròn trên bar-fixed */
.cb-toggle-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #2A3D77;
    color: #EBC13B !important;
    border: 2px solid #EBC13B;
    box-shadow: 0 4px 12px rgba(42, 61, 119, 0.35);
    transition: all 0.3s ease;
    cursor: pointer;
}
.cb-toggle-btn:hover {
    transform: scale(1.06);
    background: #EBC13B;
    color: #2A3D77 !important;
}
.cb-toggle-btn .cb-ic-close { display: none; }
.cb-toggle-btn.active .cb-ic-open { display: none; }
.cb-toggle-btn.active .cb-ic-close { display: block; }

/* Khung Popup chính - Rộng rãi, chữ to, thoáng trên máy tính */
.cb-popup {
    position: fixed;
    bottom: 20px;
    right: 85px;
    width: 350px;
    background: #f4f6fb;
    border-radius: 16px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px) scale(0.95);
    transform-origin: bottom right;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    font-family: inherit;
    z-index: 9999999 !important;
}
.cb-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Header thoáng hơn */
.cb-header {
    background: linear-gradient(135deg, #2A3D77 0%, #1b2852 100%);
    color: #fff;
    padding: 20px 20px 42px;
    position: relative;
}
.cb-title {
    font-size: 20px;
    font-weight: 700;
    color: #EBC13B;
    margin-bottom: 6px;
}
.cb-desc {
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.95);
}

/* Body & Card kéo giãn khoảng cách */
.cb-body {
    padding: 0 14px;
    margin-top: -26px;
    position: relative;
    z-index: 2;
}
.cb-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    margin-bottom: 14px;
}
.cb-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #2A3D77;
    margin-bottom: 14px;
}

/* Reset & Style cho CF7 bên trong Popup */
.cb-form-card .wpcf7-form p {
    margin: 0 !important;
}
.cb-form-card .wpcf7-form br {
    display: none;
}
.cb-field {
    margin-bottom: 12px;
}
.cb-input, 
.cb-textarea {
    width: 100%;
    border: 1px solid #d9e0ea;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: #333;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
    box-sizing: border-box;
}
.cb-input:focus, 
.cb-textarea:focus {
    border-color: #2A3D77;
    box-shadow: 0 0 0 2px rgba(235, 193, 59, 0.25);
}
.cb-textarea {
    height: 76px;
    resize: none;
}

/* Dấu tích tròn cho Radio Order / Ký gửi */
.cb-radio-group .wpcf7-radio {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 4px 0;
}
.cb-radio-group .wpcf7-list-item {
    margin: 0 !important;
    display: inline-flex;
    align-items: center;
}
.cb-radio-group label {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #222;
    cursor: pointer;
    font-weight: 500;
    margin: 0 !important;
}
.cb-radio-group input[type="radio"] {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    border: 2px solid #2A3D77 !important;
    border-radius: 50% !important;
    margin: 0 !important;
    padding: 0 !important;
    cursor: pointer;
    position: relative;
    background: #fff !important;
    display: inline-grid !important;
    place-content: center;
    flex-shrink: 0;
}
.cb-radio-group input[type="radio"]::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: scale(0);
    transition: 0.15s transform ease-in-out;
    background-color: #2A3D77;
}
.cb-radio-group input[type="radio"]:checked::before {
    transform: scale(1);
}

/* Nút Submit CF7 */
.cb-submit-wrap {
    text-align: center;
    margin-top: 14px;
    position: relative;
}
.cb-submit-btn {
    background: #EBC13B !important;
    color: #2A3D77 !important;
    font-weight: 700 !important;
    font-size: 14.5px !important;
    border: none !important;
    border-radius: 25px !important;
    padding: 10px 32px !important;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(235, 193, 59, 0.4);
    line-height: 1.3 !important;
}
.cb-submit-btn:hover {
    background: #2A3D77 !important;
    color: #EBC13B !important;
}
.cb-form-card .wpcf7-spinner {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
}
.cb-form-card .wpcf7-not-valid-tip {
    font-size: 12px;
    margin-top: 4px;
}
.cb-form-card .wpcf7-response-output {
    margin: 10px 0 0 !important;
    padding: 6px 10px !important;
    font-size: 12.5px !important;
    border-radius: 6px;
}

/* Footer của Popup */
.cb-footer {
    background: #2A3D77;
    color: #EBC13B;
    text-align: center;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Responsive thu gọn vừa vặn trên điện thoại */
@media (max-width: 576px) {
    .cb-popup {
        right: 70px;
        bottom: 15px;
        width: calc(100vw - 85px);
        max-width: 310px;
    }
    .cb-header {
        padding: 14px 16px 32px;
    }
    .cb-title {
        font-size: 17px;
    }
    .cb-desc {
        font-size: 12.5px;
    }
    .cb-card {
        padding: 12px;
        margin-bottom: 10px;
    }
    .cb-card-title {
        font-size: 13.5px;
        margin-bottom: 10px;
    }
    .cb-field {
        margin-bottom: 8px;
    }
    .cb-input, .cb-textarea {
        padding: 8px 10px;
        font-size: 13px;
    }
    .cb-textarea {
        height: 55px;
    }
}