/* Custom WhatsApp Floating Button & Modal */
.whatsapp-custom-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.whatsapp-custom-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
    background: #1da851;
}

.whatsapp-custom-btn svg {
    width: 32px;
    height: 32px;
    fill: #fff;
}

/* Modal Styling */
.wpp-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: none;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 30px;
}

.wpp-modal.active {
    display: flex !important;
    animation: fadeIn 0.3s ease-out;
}

.wpp-modal-content {
    background: #fff;
    width: 90%;
    max-width: 450px;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.wpp-modal-header {
    background: linear-gradient(135deg, #0e0547 0%, #004a87 100%);
    color: #fff;
    padding: 25px 30px;
    text-align: center;
    position: relative;
}

.wpp-modal-header h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.wpp-modal-header p {
    margin: 8px 0 0;
    font-size: 14px;
    opacity: 0.9;
}

.wpp-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.wpp-modal-close:hover {
    opacity: 1;
}

.wpp-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.wpp-form-group {
    margin-bottom: 20px;
    position: relative;
}

.wpp-form-group label {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 500;
    font-size: 15px;
    color: #888;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.wpp-form-group input {
    width: 100%;
    padding: 25px 15px 10px;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fdfdfd;
}

/* Floating Label Logic: When focused OR when there is text (placeholder NOT shown) */
.wpp-form-group:focus-within label,
.wpp-form-group:has(input:not(:placeholder-shown)) label {
    top: 12px;
    transform: translateY(0);
    font-size: 11px;
    font-weight: 700;
    color: #004a87;
    text-transform: uppercase;
}

.wpp-form-group input::placeholder {
    color: transparent; /* Hide actual placeholder to avoid overlap with floating label */
}

.wpp-form-group input:focus {
    border-color: #004a87;
    box-shadow: 0 0 0 3px rgba(0, 74, 135, 0.1);
    background: #fff;
}

.wpp-checkbox-group {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.wpp-checkbox-group input {
    margin-top: 3px;
    min-width: 16px;
    min-height: 16px;
    accent-color: #0e0547;
    cursor: pointer;
}

.wpp-checkbox-group label {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    cursor: pointer;
}

.wpp-submit-btn {
    width: 100%;
    padding: 15px;
    background: #0e0547;
    color: #fff;
    border: none;
    border-radius: 0;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 10px;
}

.wpp-submit-btn:hover {
    background: #004a87;
}

.wpp-submit-btn:active {
    transform: scale(0.98);
}

.wpp-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* Hide RD Station default button and section */
#rd-floating_button-ljpq3eyj, 
#rd-section-k8hluh9z,
[id^="rd-floating_button-"],
[id*="rd-floating_button"],
#rd-button-whatsapp,
.rd-floating-button,
iframe[title*="RD Station"],
iframe[src*="rd.services"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    z-index: -9999 !important;
    width: 0 !important;
    height: 0 !important;
    position: fixed !important;
    top: -9999px !important;
    left: -9999px !important;
}

/* Responsividade */
@media (max-width: 768px) {
    .wpp-modal {
        align-items: center;
        justify-content: center;
        padding: 15px;
    }

    .wpp-modal-content {
        width: 100%;
        max-width: none;
        border-radius: 0;
    }

    .wpp-modal-body {
        padding: 20px;
    }

    .wpp-modal-header {
        padding: 20px;
    }

    .whatsapp-custom-btn {
        bottom: 15px;
        right: 15px;
        width: 55px;
        height: 55px;
    }

    .wpp-modal-content {
        max-height: 95vh;
    }
}
