.elementor-kit-3617{--e-global-color-primary:#6EC1E4;--e-global-color-secondary:#54595F;--e-global-color-text:#7A7A7A;--e-global-color-accent:#61CE70;--e-global-typography-primary-font-family:"Roboto";--e-global-typography-primary-font-weight:600;--e-global-typography-secondary-font-family:"Roboto Slab";--e-global-typography-secondary-font-weight:400;--e-global-typography-text-font-family:"Roboto";--e-global-typography-text-font-weight:400;--e-global-typography-accent-font-family:"Roboto";--e-global-typography-accent-font-weight:500;--e-global-typography-583229c-font-family:"Roboto Slab";--e-global-typography-583229c-font-weight:400;}.elementor-kit-3617 e-page-transition{background-color:#FFBC7D;}.elementor-section.elementor-section-boxed > .elementor-container{max-width:1140px;}.e-con{--container-max-width:1140px;}.elementor-widget:not(:last-child){--kit-widget-spacing:20px;}.elementor-element{--widgets-spacing:20px 20px;--widgets-spacing-row:20px;--widgets-spacing-column:20px;}{}h1.entry-title{display:var(--page-title-display);}@media(max-width:1024px){.elementor-section.elementor-section-boxed > .elementor-container{max-width:80%;}.e-con{--container-max-width:80%;}}@media(max-width:767px){.elementor-section.elementor-section-boxed > .elementor-container{max-width:95%;}.e-con{--container-max-width:95%;}}/* Start custom CSS *//* Style dasar tombol */
.rsvp-buttons .elementor-field-option label {
    background: #ffffff;
    border: 2px solid #cfcfcf;
    padding: 12px 18px;
    border-radius: 12px;
    display: inline-block;
    cursor: pointer;
    transition: 0.3s;
    margin-bottom: 10px;
    font-weight: 600;
}

/* Hover */
.rsvp-buttons .elementor-field-option label:hover {
    border-color: #7e7e7e;
}

/* Saat dipilih */
.rsvp-buttons input:checked + label {
    background: #2b2b2b;
    color: #ffffff;
    border-color: #2b2b2b;
}

/* Hilangkan bullet radio asli */
.rsvp-buttons .elementor-field-option input {
    display: none !important;
}

document.addEventListener("DOMContentLoaded", function () {

    const bankSelect = document.querySelector('select[name="form_fields[bank_select]"]');
    const infoBox = document.querySelector("#gift-bank-info");

    if (!bankSelect || !infoBox) return;

    const bankData = {
        bca: {
            bank: "BCA",
            norek: "1234567890",
            nama: "Christiana E"
        },
        bni: {
            bank: "BNI",
            norek: "5678901234",
            nama: "Christiana E"
        },
        bri: {
            bank: "BRI",
            norek: "9876543210",
            nama: "Christiana E"
        }
    };

    const renderInfo = (key) => {
        if (!key || !bankData[key]) {
            infoBox.innerHTML = "";
            return;
        }
        const d = bankData[key];
        infoBox.innerHTML = `
            <b>Bank:</b> ${d.bank}<br>
            <b>No. Rekening:</b> ${d.norek}<br>
            <b>Atas Nama:</b> ${d.nama}<br><br>
            <button id="copy-rek" style="padding:8px 12px;background:#f2f2f2;border-radius:10px;border:1px solid #ddd;cursor:pointer;">Copy No. Rekening</button>
        `;

        // Copy button
        setTimeout(() => {
            const btn = document.querySelector("#copy-rek");
            if (btn) {
                btn.addEventListener("click", () => {
                    navigator.clipboard.writeText(d.norek);
                    btn.innerText = "Copied!";
                });
            }
        }, 50);
    };

    bankSelect.addEventListener("change", function () {
        renderInfo(this.value);
    });

});/* End custom CSS */