/* WhatsApp Floating Button */
#wpe-whal-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 61px;
    border-radius: 0 !important;
    border: 0 !important;
    /*background-color: #25d366;*/
    background: transparent url(https://d335luupugsy2.cloudfront.net/cms/files/1446/1588875979/$5u0ndp8vgxo) center center no-repeat;
    cursor: pointer;
    /*box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);*/
    box-shadow: none;
    background-size: 60px 60px !important;
    outline: none;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

#wpe-whal-button.balanga{
    animation: balanga 10s infinite
}

@keyframes balanga {
      4.5%, 10.5% {
        transform: translate(0px, 0px) rotate(0deg);
      }
      5% {
        transform: translate(1px, 1px) rotate(0deg);
      }
      5.5% {
        transform: translate(-1px, -2px) rotate(-1deg);
      }
      6% {
        transform: translate(-3px, 0px) rotate(1deg);
      }
      6.5% {
        transform: translate(3px, 2px) rotate(0deg);
      }
      7% {
        transform: translate(1px, -1px) rotate(1deg);
      }
      7.5% {
        transform: translate(-1px, 2px) rotate(-1deg);
      }
      8% {
        transform: translate(-3px, 1px) rotate(0deg);
      }
      8.5% {
        transform: translate(3px, 1px) rotate(-1deg);
      }
      9% {
        transform: translate(-1px, -1px) rotate(1deg);
      }
      9.5% {
        transform: translate(1px, 2px) rotate(0deg);
      }
      10% {
        transform: translate(1px, -2px) rotate(-1deg);
      }
    }

#wpe-whal-button:hover {
    transform: scale(1.1);
    /*box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);*/
}

#wpe-whal-button img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
}

/* Modal Styles */
#wpe-whal-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 100px 20px 100px 20px; /* More padding from right and bottom */
    box-sizing: border-box;
}

.wpe-whal-modal-content {
    background: #f5f3f0; /* Beige background for main content */
    border-radius: 20px;
    padding: 0; /* Remove padding, we'll add it to sections */
    max-width: 400px;
    width: 100%;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: wpe-whal-fadeIn 0.3s ease;
    overflow: hidden; /* Ensure rounded corners work with header */
}

@keyframes wpe-whal-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.wpe-whal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: white; /* White color for green background */
    transition: color 0.3s ease;
    z-index: 2;
}

.wpe-whal-close:hover {
    color: rgba(255, 255, 255, 0.8);
}

.wpe-whal-modal-content h3 {
    background: rgba(38,92,84,1); /* WhatsApp green */
    margin: 0;
    padding: 20px 30px;
    /*font-family: Helvetica, Arial, sans-serif;*/
    font-family: "Open Sans", sans-serif;
    font-size: 16px;
    text-align: left;
    font-weight: 300;
    color: rgb(229, 229, 229);
}

/* Form Styles */

#wpe-whal-form {
    padding: 30px;
    background: #f5f3f0; /* Beige background */
}

/* Phone field container */
.wpe-whal-phone-container {
    display: flex;
    gap: 5px;
}

.wpe-whal-country-select {
    flex: 0 0 auto;
    min-width: 80px;
    max-width: 80px;
    padding: 10px 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.wpe-whal-country-select:focus {
    outline: none;
    border-color: #25d366;
    box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.2);
}

.wpe-whal-phone-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.wpe-whal-phone-input:focus {
    outline: none;
    border-color: #25d366;
    box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.2);
}

/* Update placeholder styling */
.wpe-whal-field input::placeholder,
.wpe-whal-field textarea::placeholder {
    color: #999;
    font-style: italic;
}

.wpe-whal-field {
    margin-bottom: 15px;
}

/*
.wpe-whal-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}
*/

.wpe-whal-field label {
    display: none;
}


.wpe-whal-field .required {
    color: #e74c3c;
}

.wpe-whal-field input,
.wpe-whal-field textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
    background: white; /* Ensure white background */
}

.wpe-whal-field input:focus,
.wpe-whal-field textarea:focus {
    outline: none;
    border-color: #25d366;
    box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.2);
}

.wpe-whal-field textarea {
    resize: vertical;
    min-height: 80px;
}

.wpe-whal-actions {
    margin-top: 20px;
    text-align: center;
}

.wpe-whal-submit {
    /*background-color: #25d366;*/
    background-color: rgba(83,164,81,1)!important;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 500;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 250px; /* Make it wider */
    width: 100%; /* Full width of container */
}

.wpe-whal-submit:hover,
.wpe-whal-submit:focus {
    background-color: #1eb855 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.wpe-whal-submit:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Error Messages */
.wpe-whal-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #f5c6cb;
    font-size: 14px;
}

.wpe-whal-success {
    background-color: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #c3e6cb;
    font-size: 14px;
}

/* Loading State */
.wpe-whal-loading {
    position: relative;
}

/* Add balloon tail pointing to the WhatsApp button */
.wpe-whal-modal-content::after {
    content: '';
    position: absolute;
    bottom: -20px;
    right: 60px; /* Position near where WhatsApp button would be */
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 20px solid white;
    z-index: 1;
}

/* Add shadow to the balloon tail */
.wpe-whal-modal-content::before {
    content: '';
    position: absolute;
    bottom: -22px;
    right: 58px;
    width: 0;
    height: 0;
    border-left: 22px solid transparent;
    border-right: 22px solid transparent;
    border-top: 22px solid rgba(0, 0, 0, 0.1);
    z-index: 0;
}

.wpe-whal-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: wpe-whal-spin 1s linear infinite;
}

@keyframes wpe-whal-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    #wpe-whal-button {
           bottom: 80px; /* Increased from 15px to avoid browser controls */
           right: 16px;
           width: 60px;
           height: 61px;
       }
    
    #wpe-whal-button img {
        width: 28px;
        height: 28px;
    }

     #wpe-whal-modal {
        padding: 62px 13px 130px 13px; /* Reduced horizontal padding for wider modal */
        align-items: center;
    }

    .wpe-whal-modal-content::after {
        right: 30px; /* Adjusted for new width */
    }
    
  .wpe-whal-modal-content::before {
      right: 28px; /* Adjusted for new width */
  }
    
   .wpe-whal-modal-content {
         margin: 0; /* Removed margin for full width effect */
         max-width: calc(100vw - 30px); /* Almost full width */
         width: calc(100vw - 30px); /* Force almost full width */
     }
     
    
   .wpe-whal-modal-content h3 {
         font-size: 18px; /* Increased from 14px */
         padding: 20px 25px; /* Increased padding for better proportions */
         word-wrap: break-word;
         font-weight: 400; /* Slightly bolder */
     }

     #wpe-whal-form {
         padding: 25px; /* Increased padding to match wider modal */
     }
}

@supports (padding: max(0px)) {
    @media (max-width: 480px) {
        #wpe-whal-button {
            bottom: max(80px, env(safe-area-inset-bottom, 20px) + 60px);
        }
    }
}

/* Alternative positioning for landscape mode on mobile */
@media (max-width: 480px) and (orientation: landscape) {
    #wpe-whal-button {
        bottom: 15px; /* Less spacing needed in landscape */
        right: 15px;
    }
}

@media (max-width: 360px) {
     #wpe-whal-modal {
        padding: 60px 10px 150px 10px; /* Increased bottom padding here too */
        align-items: center;
    }
    
    .wpe-whal-modal-content {
        max-width: calc(100vw - 20px);
        width: calc(100vw - 20px);
    }
    
    .wpe-whal-modal-content h3 {
        font-size: 16px; /* Still larger than before */
        padding: 18px 20px;
    }

    #wpe-whal-form {
        padding: 20px;
    }

    .wpe-whal-modal-content::after {
        right: 25px;
    }
    
    .wpe-whal-modal-content::before {
        right: 23px;
    }
}