/* ============================================
   WHATSAPP WIDGET - STYLES
   ============================================ */

/* Reset básico para el widget */
.whatsapp-widget,
.whatsapp-widget * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Contenedor principal */
.whatsapp-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* ============================================
   POPUP
   ============================================ */
.whatsapp-popup {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.whatsapp-popup.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header del popup */
.popup-header {
    background: #25D366;
    padding: 20px 24px;
    color: #ffffff;
}

.popup-header h3 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
}

.popup-header p {
    font-size: 14px;
    font-weight: 400;
    opacity: 0.95;
}

/* Body del popup */
.popup-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Tarjeta de ubicación */
.location-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.location-card:hover {
    border-color: #25D366;
    background: #f0fdf4;
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.12);
}

/* Icono de ubicación */
.location-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    background: #dcfce7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #22c55e;
}

.location-icon svg {
    width: 20px;
    height: 20px;
}

/* Información de ubicación */
.location-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 2px;
}

.location-name {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.location-phone {
    font-size: 13px;
    font-weight: 400;
    color: #6b7280;
}

/* Flecha */
.location-arrow {
    color: #9ca3af;
    transition: color 0.2s ease;
}

.location-card:hover .location-arrow {
    color: #25D366;
}

.location-arrow svg {
    width: 20px;
    height: 20px;
}

/* ============================================
   BOTÓN FLOTANTE
   ============================================ */
.whatsapp-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    position: relative;
}

.whatsapp-button:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
}

.whatsapp-button:active {
    transform: scale(0.95);
}

/* Iconos dentro del botón */
.whatsapp-button svg {
    width: 32px;
    height: 32px;
    color: #ffffff;
    position: absolute;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.whatsapp-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.close-icon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

/* Estado activo del botón */
.whatsapp-button.active .whatsapp-icon {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.whatsapp-button.active .close-icon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* ============================================
   ANIMACIÓN DE PULSO (opcional)
   ============================================ */
.whatsapp-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #25D366;
    opacity: 0.4;
    animation: pulse 2s infinite;
    z-index: -1;
}

.whatsapp-button.active::before {
    animation: none;
    opacity: 0;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }
    70% {
        transform: scale(1.5);
        opacity: 0;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .whatsapp-widget {
        bottom: 16px;
        right: 16px;
    }

    .whatsapp-popup {
        width: calc(100vw - 32px);
        right: 0;
        max-width: 320px;
    }

    .whatsapp-button {
        width: 56px;
        height: 56px;
    }

    .whatsapp-button svg {
        width: 28px;
        height: 28px;
    }
}
