/* ==========================================================================
   WP Dynamic WhatsApp & RGPD - Estilos del Frontend (Público)
   ========================================================================== */

#wdwr-floating-button-container {
    position: fixed;
    z-index: 999999; 
    display: flex;
    flex-direction: column;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#wdwr-floating-button-container.wdwr-hidden-by-delay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Envoltura relativa para que el tooltip no empuje al botón */
.wdwr-icon-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
}

/* 1. Tooltip (Información emergente) - AHORA FLOTA SIN OCUPAR ESPACIO */
.wdwr-tooltip {
    position: absolute;
    top: 50%;
    background-color: #ffffff;
    color: #333333;
    padding: 8px 14px;
    border-radius: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Alineación del tooltip según la posición general */
.wdwr-pos-right .wdwr-tooltip {
    right: 75px; 
    transform: translateY(-50%) scale(0.9);
    transform-origin: right center;
}
.wdwr-pos-left .wdwr-tooltip {
    left: 75px; 
    transform: translateY(-50%) scale(0.9);
    transform-origin: left center;
}

/* Efecto hover del tooltip */
.wdwr-icon-wrapper:hover .wdwr-tooltip {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

/* 2. El botón flotante */
#wdwr-main-icon {
    width: 60px;
    height: 60px;
    cursor: pointer;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0; padding: 0; border: none;
}
#wdwr-main-icon:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}
#wdwr-main-icon img {
    width: 40px !important; height: 40px !important;
    object-fit: contain !important; display: block !important;
    margin: 0 !important; padding: 0 !important; border: none !important;
    box-shadow: none !important; background: transparent !important;
    max-width: none !important;
}

/* 3. Muro Legal RGPD (DISEÑO CHAT) */
#wdwr-rgpd-modal {
    position: absolute;
    bottom: 75px;
    width: 350px;
    background: #F4F9F6; 
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333333;
    overflow: hidden; 
    display: flex;
    flex-direction: column;
    opacity: 1; visibility: visible; transform: translateY(0);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

/* Alineación de la ventana de chat para que no se salga de la pantalla */
.wdwr-pos-right #wdwr-rgpd-modal { right: 0; left: auto; }
.wdwr-pos-left #wdwr-rgpd-modal { left: 0; right: auto; }

#wdwr-rgpd-modal.wdwr-hidden {
    opacity: 0; visibility: hidden; transform: translateY(15px); pointer-events: none;
}

/* Cabecera Verde */
.wdwr-modal-header {
    color: #ffffff;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.wdwr-modal-title { font-size: 16px; font-weight: 600; }
.wdwr-rgpd-close {
    background: rgba(0, 0, 0, 0.2);
    border: none;
    color: white;
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer;
    transition: background 0.2s;
    padding: 0;
}
.wdwr-rgpd-close:hover { background: rgba(0, 0, 0, 0.4); }

/* Cuerpo y Burbuja de Chat */
.wdwr-modal-body { padding: 20px; }
.wdwr-chat-bubble {
    background: #ffffff;
    padding: 15px;
    border-radius: 0 12px 12px 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    font-size: 14px;
    line-height: 1.5;
    color: #4a4a4a;
    position: relative;
    margin-bottom: 25px;
    margin-left: 10px; 
    border: 1px solid #e6e6e6;
}
.wdwr-chat-bubble::before {
    content: ''; position: absolute; top: 0; left: -10px;
    width: 0; height: 0;
    border-top: 0px solid transparent; border-right: 12px solid #ffffff; border-bottom: 15px solid transparent;
}
.wdwr-chat-bubble::after {
    content: ''; position: absolute; top: -1px; left: -12px;
    width: 0; height: 0;
    border-top: 0px solid transparent; border-right: 13px solid #e6e6e6; border-bottom: 16px solid transparent;
    z-index: -1;
}

/* Checkbox RGPD */
.wdwr-rgpd-checkbox-container {
    display: flex; align-items: flex-start; cursor: pointer; user-select: none; margin-bottom: 10px; transition: transform 0.2s;
}
.wdwr-rgpd-checkbox-container input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.wdwr-checkmark {
    min-width: 20px; height: 20px;
    background-color: #fff; border: 2px solid #25D366; border-radius: 4px;
    margin-right: 12px; display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.wdwr-rgpd-checkbox-container input:checked ~ .wdwr-checkmark { background-color: #25D366; }
.wdwr-checkmark:after {
    content: ""; display: none; width: 5px; height: 10px; border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg); margin-bottom: 2px;
}
.wdwr-rgpd-checkbox-container input:checked ~ .wdwr-checkmark:after { display: block; }
.wdwr-rgpd-text { font-size: 12px; line-height: 1.4; color: #666; }
.wdwr-rgpd-text a { color: #0073aa; text-decoration: underline; }

/* Pie y Botón Abrir Chat */
.wdwr-modal-footer { padding: 0 20px 20px 20px; display: flex; justify-content: flex-end; }
#wdwr-accept-rgpd {
    display: flex; align-items: center; gap: 8px;
    background: #a0a0a0; color: #ffffff; border: none; padding: 10px 24px; border-radius: 25px;
    font-weight: 600; font-size: 15px; cursor: not-allowed; text-decoration: none;
    transition: background 0.2s ease, transform 0.1s ease;
}
#wdwr-accept-rgpd.wdwr-btn-enabled { background: #8e8e8e; cursor: pointer; }
#wdwr-accept-rgpd.wdwr-btn-enabled:hover { background: #7a7a7a; transform: scale(1.02); }

/* Clases de Dispositivos */
@media screen and (min-width: 769px) {
    #wdwr-floating-button-container.wdwr-only-mobile { display: none !important; }
}
@media screen and (max-width: 768px) {
    #wdwr-floating-button-container.wdwr-only-desktop { display: none !important; }
}

/* Responsive nativo para móviles (Sobrescribe márgenes para que siempre quede bien en pantallas pequeñas) */
@media screen and (max-width: 480px) {
    #wdwr-floating-button-container { bottom: 20px !important; }
    .wdwr-pos-right { right: 20px !important; } 
    .wdwr-pos-left { left: 20px !important; }
    #wdwr-rgpd-modal { width: 300px; }
    .wdwr-tooltip { display: none; }
}