.floating-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1;
    background-color: var(--morapi-bubble-bg-color, #ffffff);
    color: var(--morapi-bubble-text-color, #404040) !important;
    padding: 5px 20px;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    width: 230px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.floating-button p {
    align-items: center;
    display: flex;
    margin: 0px;
    color: var(--morapi-bubble-text-color, #404040) !important;
}

.popup-imagen-whatsapp {
    max-width: 100%;
    height: auto;
}

.popup-imagen-whatsapp {
    width: 25px;
    height: 25px;
    margin-right: 10px;
}

.popup-content h2 {
    font-size: 19px;
    font-weight: 700;
    margin: 12px 0 4px 0;
    color: #0f172a;
    line-height: 1.3;
}

.brand-fasia {
    text-align: center;
    margin: 10px 0 4px 0 !important;
    font-size: 12px;
    color: #94a3b8;
}

.popup-content > p {
    font-size: 13px;
    margin: 0 0 12px 0;
    color: #64748b;
    line-height: 1.4;
}

.popup {
    display: none;
    position: fixed;
    bottom: 90px; /* Ajusta la posición del popup para que esté sobre el botón */
    right: 20px;
    z-index: 99999; /* Asegura que el popup esté sobre otros elementos */
    background: #fff;
    width: 350px;
    max-width: calc(100vw - 32px);
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.popup-content {
    padding: 0 18px 14px 18px;
    box-sizing: border-box;
}

.popup .iti__selected-country {
    background: #ff000000 !important;
}

.popup-content .wpforms-container,
.popup-content .wpcf7 {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

.whatsapp-header {
    background: var(--morapi-brand-color, #095e54);
    color: var(--morapi-header-text-color, #ffffff) !important;
    text-align: left;
    padding: 14px 18px;
    margin: 0 -18px 12px -18px;
    display: flex;
    font-weight: 700;
    font-size: 16px;
    align-items: center;
}

.popup .close-btn {
    position: absolute;
    top: 12px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    color: var(--morapi-header-text-color, #ffffff) !important;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.popup .close-btn:hover {
    opacity: 1;
}

/* Ocultar etiquetas <br> autogeneradas por Contact Form 7 dentro del popup y modal */
.popup-content form br,
.fasia-centered-modal-content form br {
    display: none !important;
}

/* Estandarización de inputs en el Popup y Modal Centrado */
.popup-content input[type="text"],
.popup-content input[type="email"],
.popup-content input[type="tel"],
.popup-content select,
.popup-content textarea,
.fasia-centered-modal-content input[type="text"],
.fasia-centered-modal-content input[type="email"],
.fasia-centered-modal-content input[type="tel"],
.fasia-centered-modal-content select,
.fasia-centered-modal-content textarea {
    width: 100% !important;
    max-width: 100% !important;
    height: 40px !important;
    padding: 8px 12px !important;
    box-sizing: border-box !important;
    border: 1.5px solid #cbd5e1 !important;
    border-radius: 8px !important;
    background-color: #ffffff !important;
    font-size: 13.5px !important;
    color: #1e293b !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.02) !important;
    margin-top: 0 !important;
    margin-bottom: 2px !important;
    font-family: inherit !important;
    display: block !important;
}

.popup-content textarea,
.fasia-centered-modal-content textarea {
    min-height: 70px !important;
    height: 70px !important;
    resize: vertical !important;
}

.popup-content input:focus,
.popup-content textarea:focus,
.popup-content select:focus,
.fasia-centered-modal-content input:focus,
.fasia-centered-modal-content textarea:focus,
.fasia-centered-modal-content select:focus {
    border-color: var(--morapi-btn-bg-color, #10b981) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
    outline: none !important;
}

.popup-content label,
.fasia-centered-modal-content label,
.popup-content .wpforms-field-label,
.fasia-centered-modal-content .wpforms-field-label {
    font-size: 12.5px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    margin-top: 0 !important;
    margin-bottom: 4px !important;
    display: block !important;
    text-align: left !important;
}

/* Compactar espaciados de contenedores de formularios de WPForms y Contact Form 7 */
.popup-content .wpforms-field,
.fasia-centered-modal-content .wpforms-field,
.popup-content form p,
.fasia-centered-modal-content form p,
.popup-content .wpcf7-form-control-wrap,
.fasia-centered-modal-content .wpcf7-form-control-wrap {
    margin-top: 0 !important;
    margin-bottom: 8px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    text-align: left !important;
}

.popup-content .wpforms-field-container,
.fasia-centered-modal-content .wpforms-field-container {
    margin-bottom: 0 !important;
}

.popup-content form,
.fasia-centered-modal-content form {
    margin-bottom: 0 !important;
    width: 100% !important;
}

/* Estandarización de Botones de Envío */
.form-morapia-crm button,
.popup-content button.wpforms-submit,
.popup-content input[type="submit"],
.popup-content button[type="submit"],
.fasia-centered-modal-content button.wpforms-submit,
.fasia-centered-modal-content input[type="submit"],
.fasia-centered-modal-content button[type="submit"] {
    background: var(--morapi-btn-bg-color, #10b981) !important;
    color: var(--morapi-btn-text-color, #ffffff) !important;
    border-radius: 50px !important;
    padding: 10px 20px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 42px !important;
    margin-top: 10px !important;
    margin-bottom: 4px !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.2) !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: block !important;
    text-align: center !important;
}

.form-morapia-crm button:hover,
.popup-content button.wpforms-submit:hover,
.popup-content input[type="submit"]:hover,
.popup-content button[type="submit"]:hover,
.fasia-centered-modal-content button.wpforms-submit:hover,
.fasia-centered-modal-content input[type="submit"]:hover,
.fasia-centered-modal-content button[type="submit"]:hover {
    filter: brightness(92%) !important;
    box-shadow: 0 6px 12px -1px rgba(0, 0, 0, 0.15) !important;
}

/* ==========================================
   ESTILOS DE ADMINISTRACIÓN (PANEL PREMIUM REDISEÑADO)
   ========================================== */
.morapi-config-wrap {
    max-width: 960px;
    margin: 30px auto;
    padding: 30px;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.morapi-config-header {
    margin-bottom: 30px;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 20px;
}

.morapi-config-title {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px 0;
    letter-spacing: -0.02em;
}

.morapi-config-subtitle {
    font-size: 14px;
    color: #64748b;
    margin: 0;
}

/* Pestañas (Tabs) */
.morapi-nav-tab-wrapper {
    border-bottom: 1px solid #cbd5e1;
    margin-bottom: 30px;
    display: flex;
    gap: 10px;
    padding: 0;
}

.morapi-nav-tab-wrapper .nav-tab {
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 12px 20px;
    margin: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.02);
}

.morapi-nav-tab-wrapper .nav-tab:hover {
    color: #0f172a;
    background: #e2e8f0;
}

.morapi-nav-tab-wrapper .nav-tab-active,
.morapi-nav-tab-wrapper .nav-tab-active:focus,
.morapi-nav-tab-wrapper .nav-tab-active:hover {
    color: #0284c7;
    background: #ffffff;
    border-color: #cbd5e1;
    border-bottom: 1px solid #ffffff;
    position: relative;
    z-index: 2;
    box-shadow: none;
}

.morapi-nav-tab-wrapper .nav-tab-active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background-color: #0284c7;
    border-radius: 8px 8px 0 0;
}

.morapi-nav-tab-wrapper .nav-tab .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 20px;
}

/* Contenido de Pestaña */
.morapi-tab-content {
    display: none;
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.morapi-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tarjetas (Cards) */
.morapi-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.morapi-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border-color: #cbd5e1;
}

.morapi-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 0;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
}

.morapi-card-title .dashicons {
    color: #0284c7;
    font-size: 20px;
    width: 20px;
    height: 20px;
    line-height: 20px;
}

/* Sistema de Rejilla (Grid) */
.morapi-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .morapi-grid-2 {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.morapi-config-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 25px 0 15px 0;
    padding-left: 10px;
    border-left: 3px solid #0284c7;
    line-height: 1.2;
}

.morapi-section-desc {
    font-size: 13px;
    color: #64748b;
    margin-top: -10px;
    margin-bottom: 20px;
}

.morapi-divider {
    border: 0;
    height: 1px;
    background: #e2e8f0;
    margin: 30px 0;
}

/* Campos de Formulario */
.morapi-config-label {
    display: block;
    margin-top: 15px;
    font-weight: 600;
    color: #334155;
    font-size: 13px;
    margin-bottom: 6px;
}

.morapi-config-input,
.morapi-config-textarea,
.morapi-config-select {
    width: 100%;
    padding: 10px 12px;
    margin-top: 0;
    margin-bottom: 20px;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background-color: #ffffff;
    font-size: 14px;
    color: #1e293b;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.morapi-config-input:focus,
.morapi-config-textarea:focus,
.morapi-config-select:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
    outline: none;
}

.morapi-config-textarea {
    min-height: 100px;
    resize: vertical;
}

.morapi-config-select {
    height: auto;
    line-height: 1.5;
}

/* Contenedor del Interruptor Deslizante (Switch Container) */
.morapi-switch-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.morapi-switch-container:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.morapi-switch-info {
    flex: 1;
    margin-right: 15px;
}

.morapi-switch-label-text {
    font-weight: 700;
    font-size: 14px;
    color: #1e293b;
    display: block;
}

.morapi-switch-desc {
    font-size: 12px;
    color: #64748b;
    font-weight: 400;
    margin-top: 3px;
    line-height: 1.4;
    display: block;
}

/* Interruptor deslizante estilo iOS */
.morapi-switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}

.morapi-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.morapi-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 26px;
}

.morapi-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

input:checked + .morapi-slider {
    background-color: #10b981; /* Verde iOS */
}

input:checked + .morapi-slider:before {
    transform: translateX(20px);
}

/* Botón de Enviar */
.morapi-config-submit {
    margin-top: 30px;
    border-top: 1px solid #f1f5f9;
    padding-top: 20px;
    display: flex;
    justify-content: flex-end;
}

.morapi-config-button-primary {
    background-color: #0284c7;
    border: none;
    color: #ffffff;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(2, 132, 199, 0.2), 0 2px 4px -1px rgba(2, 132, 199, 0.1);
}

.morapi-config-button-primary:hover {
    background-color: #0369a1;
    box-shadow: 0 10px 15px -3px rgba(3, 105, 161, 0.25), 0 4px 6px -4px rgba(3, 105, 161, 0.15);
}

.morapi-config-button-primary:active {
    transform: scale(0.98);
}

.morapi-config-button-primary .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 18px;
}

/* Mensajes de actualización */
.morapi-config-updated {
    margin-top: 10px;
    margin-bottom: 25px;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 12px 16px;
    color: #166534;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.morapi-config-updated .dashicons {
    color: #15803d;
}

/* Modal Centrado Premium (Fasia Centered Modal) */
.fasia-centered-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.fasia-centered-modal.active {
    display: flex;
}

.fasia-centered-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.5); /* Fondo pizarra oscuro translúcido */
    backdrop-filter: blur(8px); /* Efecto desenfoque de fondo */
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fasia-centered-modal.active .fasia-centered-modal-overlay {
    opacity: 1;
}

.fasia-centered-modal-container {
    position: relative;
    background: #ffffff;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    z-index: 100000;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    padding: 24px 24px;
}

.fasia-centered-modal.active .fasia-centered-modal-container {
    transform: scale(1);
    opacity: 1;
}

.fasia-centered-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f1f5f9;
    transition: all 0.2s ease;
}

.fasia-centered-modal-close:hover {
    color: #1e293b;
    background: #e2e8f0;
    transform: rotate(90deg);
}

.fasia-centered-modal-content h2 {
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
    text-align: center;
}

.fasia-centered-modal-content p {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 12px;
    text-align: center;
    line-height: 1.5;
}

.fasia-centered-modal-content .brand-fasia {
    margin-top: 12px;
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
}

.fasia-centered-modal-content .brand-fasia a {
    color: #64748b;
    text-decoration: none;
    font-weight: 500;
}

.fasia-centered-modal-content .brand-fasia a:hover {
    text-decoration: underline;
}